Postfix doesn't connect to telnet

Discussion in 'Server Operation' started by Vic Steele, Jul 18, 2008.

  1. Vic Steele

    Vic Steele New Member

    Hi all. First of all, thanks to Falko for his tutorials.
    I have a system prepared for run as a generic Web Server. I use Debian Etch as OS and I've already installed all things necessaries (Apache Webserver, Php, MySQL, etc...).
    All works so good, except Postfix, I don't be succesful to start it.
    I follow these two tutorials:
    1) The Perfect Setup;
    2) Virtual Users And Domains With Postfix, Courier and MySQL.

    Following this tutorials, all is ok and I'm able to get all the services started. For example, if I launch /etc/init.d/postfix start, it starts and looks ok.
    So it doesn't work, and if I launch "telnet localhost 25", this is the response:
    Code:
    # telnet localhost 25
    Trying 127.0.0.1...
    Connected to localhost.localdomain.
    Escape character is '^]'.
    And nothing else matters.
    All the other things in the 2nd tutorial are good and work fine.
    I don't know what's wrong. Maybe I failed to write "server1.example.com", I wrote in all "hostname.dyndns.org", where hostname is my real hostname, obviously.
    So, what is my wrongs? If necessary, I can post other, for example a configuration file, if you want to take a look.
    I repeat: all the processes start good, following the 2nd tutorial I've problems only in the final command, when I must to launch telnet for testing the correct status.

    I want to say thanks in advance for your support, and say sorry if my English is not perfect, cause I come from Italy.
     
  2. falko

    falko Super Moderator

    Are there any errors in your mail log?
     
  3. Vic Steele

    Vic Steele New Member

    On /var/log/mail.log there are many rows like these:

     
    Last edited: Jul 20, 2008
  4. falko

    falko Super Moderator

    Can you post your /etc/postfix/main.cf?
     
  5. Vic Steele

    Vic Steele New Member

    Of course:

    In "domain.dyndns" there is my real domain name selected on dyndns.org.
     
  6. falko

    falko Super Moderator

    Please run
    Code:
    postconf -e 'proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps'
    and restart Postfix.
     
  7. Vic Steele

    Vic Steele New Member

    You're the boss! Now it seems to work (it responds to telnet, I must try enough the rest, but that's all I need for now).
    Thank you so much.
     
  8. Mariusz_S

    Mariusz_S New Member

    Now it seems to work

    You're the boss!! :)

    Now it seems to work

    Thank you so much.
     
  9. jonasgreatguide

    jonasgreatguide New Member

    Thanks a lot.
    This is very helpful.
     
  10. jetfix

    jetfix New Member

    Can you please help me Falko? I'm playing around this postfix-game along one month ... and can't get it to work correctly!

    I can send and receive emails to the world from real linux accounts ... but can't use squirrelmail or use virtual accounts


    /var/log/mail.log says:

    Nov 16 08:10:54 mail authdaemond: SQL query: SELECT email, password, "", 5000, 5000, "/home/vmail", CONCAT(SUBSTRING_INDEX(email,'@',1),'/',SUBSTRING_INDEX(email,'@',1),'/'), "", "", "" FROM users WHERE email = 'ghost@mail.helpdesk.in.ua'
    Nov 16 08:10:54 mail authdaemond: zero rows returned
    Nov 16 08:10:54 mail authdaemond: no password available to compare
    Nov 16 08:10:54 mail authdaemond: authmysql: REJECT - try next module



    and my configuration files are these:

    /etc/postfix/main.cf

    smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
    biff = no
    append_dot_mydomain = no
    readme_directory = /usr/share/doc/postfix

    # TLS parameters
    smtpd_tls_cert_file = /etc/postfix/smtpd.cert
    smtpd_tls_key_file = /etc/postfix/smtpd.key
    smtpd_use_tls = yes
    smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
    smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache


    myhostname = mail.helpdesk.in.ua
    mydomain = helpdesk.in.ua

    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    mydestination = localhost, localhost.helpdesk.in.ua, helpdesk.in.ua, mail.helpdesk.in.ua
    relayhost =
    mynetworks = 127.0.0.0/8
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all

    tml_directory = /usr/share/doc/postfix/html

    virtual_alias_domains =
    virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
    virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    virtual_mailbox_base = /home/vmail
    virtual_uid_maps = static:5000
    virtual_gid_maps = static:5000

    smtpd_sasl_authenable = yes
    broken_sasl_auth_clients = yes
    smtpd_sasl_authenticated_header = yes
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination

    proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $vir$
    smtpd_sasl_auth_enable = yes

    P.S. I'm not using forwarding or quotas ...



    /etc/courier/audaemondrc

    authmodulelist="authmysql"
    daemons=5
    authdaemonvar=/var/run/courier/authdaemon
    DEBUG_LOGIN=2



    /etc/courier/authmysqlrc

    MYSQL_SERVER localhost
    MYSQL_USERNAME mail_admin
    MYSQL_PASSWORD :))))))))))
    MYSQL_PORT 0
    MYSQL_DATABASE mail
    MYSQL_UID_FIELD 5000
    MYSQL_GID_FIELD 5000
    MYSQL_USER_TABLE users
    MYSQL_CRYPT_PWFIELD password
    MYSQL_LOGIN_FIELD email
    MYSQL_HOME_FIELD "/home/vmail"
    MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,'@',1),'/',SUBSTRING_INDEX(email,'@',1),'/')


    what else? any ideas? I really don't understand why authdaemond does such a strange SQL query as I posted in the beginning of my reply...


    Please help if you will.
     
  11. falko

    falko Super Moderator

    /etc/courier/authmysqlrc must look as follows:

    Code:
    MYSQL_SERVER localhost
    MYSQL_USERNAME mail_admin
    MYSQL_PASSWORD mail_admin_password
    MYSQL_PORT 0
    MYSQL_DATABASE mail
    MYSQL_USER_TABLE users
    MYSQL_CRYPT_PWFIELD password
    #MYSQL_CLEAR_PWFIELD password
    MYSQL_UID_FIELD 5000
    MYSQL_GID_FIELD 5000
    MYSQL_LOGIN_FIELD email
    MYSQL_HOME_FIELD "/home/vmail"
    MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')
    #MYSQL_NAME_FIELD
    MYSQL_QUOTA_FIELD quota
     
  12. giannileggio

    giannileggio New Member

    Hello, i have the same problem of the first post of this thread.
    Postfix is running, my tail /var/log/maillog in empty

    Code:
    telnet localhost 25
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    
    Code:
    netstat -anp | grep 'LISTEN ' | grep :25
    tcp        0      0 0.0.0.0:25                  0.0.0.0:*                   LISTEN      3734/master         
    tcp        0      0 :::25                       :::*                        LISTEN      3734/master
    Code:
    nmap localhost
    
    Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2010-12-05 07:51 EST
    Interesting ports on localhost.localdomain (127.0.0.1):
    Not shown: 1670 closed ports
    PORT     STATE SERVICE
    25/tcp   open  smtp
    53/tcp   open  domain
    80/tcp   open  http
    110/tcp  open  pop3
    143/tcp  open  imap
    783/tcp  open  spamassassin
    953/tcp  open  rndc
    993/tcp  open  imaps
    995/tcp  open  pop3s
    3306/tcp open  mysql
    
    Can you help me, please? Thank you
     
  13. jetfix

    jetfix New Member

    Postfix doesn't use /var/log/maillog .. instead take a look at these:

    /var/log/mail.log
    /var/log/mail.info
    /var/log/mail.err
     
  14. giannileggio

    giannileggio New Member

    I don't have these files on my server
    (i searched in /var/log and with 'locate' command)
     
  15. jetfix

    jetfix New Member

    ???? I don't know why.... authdaemonrc file find and set next parametr value:

    DEBUG_LOGIN=2

    ... this will give you detailed repost .. may be nothing hapends and that's why no files are being created ... also after making this setting take a look at /var/log/syslog .. it may also hold some information... go&conquer)))
     
  16. jetfix

    jetfix New Member

    and another one..that I'm thinking of ...you may have a mistake in your mysql_virtual ... files .. check if everything (especialy username for mysql) correct in these files.
     
  17. giannileggio

    giannileggio New Member

    Thanks for your help
    My log files are still empty, all of them (i setted the debug_login = 2)

    Now i'll go to check mysql configurations files
     
  18. giannileggio

    giannileggio New Member

    I checked mysql configurations and are right.
     
  19. jetfix

    jetfix New Member

    So .. is it working now ?
     
  20. giannileggio

    giannileggio New Member

    No, I'm still at the same point.

    I can telnet pop3 and imap but i can't reach postfix on port 25 :(
     

Share This Page