postfix issue - can't get email after upgrade to 8.04

Discussion in 'Server Operation' started by adza, Nov 14, 2009.

  1. adza

    adza New Member

    Hi There, i've just upgraded my 6.06 server to 8.04 (sun ultra60), however I can't get the email configs to work at all anymore.. i've tried to rebuild the email settings as per the perfect setup tutorial, however no joy abounds...I can see mail in /var/mail/adza however i can't get a client to download that mail... is there a setting i need to set to allow the server to accept connections from clients on the internal network somehow? I am totally stumped here, been struggling with this for over a week now.. :S
     
  2. adza

    adza New Member

    an update

    as an update, on the tutorial there is a section where you 'check' everything is okay, by telnet localhost 25 and then ehlo localhost. The resulting outputs say that if you see 250-STARTTLS and 250-AUTH LOGIN PLAIN then all is good. When doing this i see the 250-STARTTLS however the other line for me shows 250-AUTH LOGIN PLAIN DIGEST-MD5 CRAM-MD5.. is this causing my issues? How can i get this to resolve to what is specified in the tutorial?
     
  3. falko

    falko Super Moderator Howtoforge Staff

    Any errors in your mail log?
    What's in /etc/postfix/main.cf and /etc/postfix/sasl/smtpd.conf?
     
  4. adza

    adza New Member

    mail errors

    Hi Falko, thanks for the reply.. here's my main.cf and smtpd.conf (sorry bout the late reply --- assignments, work arrgggh :mad:)... the mail log shows error in authentications though, i think it's the sasl configs... however my smtpd.conf has only two lines

    Code:
    pwcheck_method: saslauthd
    mech_list: plain login
    
    here's my main.cf file as well

    Code:
    # See /usr/share/postfix/main.cf.dist for a commented, more complete version
    
    
    # Debian specific:  Specifying a file name will cause the first
    # line of that file to be used as the name.  The Debian default
    # is /etc/mailname.
    #myorigin = /etc/mailname
    
    smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
    biff = no
    
    # appending .domain is the MUA's job.
    append_dot_mydomain = no
    
    # Uncomment the next line to generate "delayed mail" warnings
    #delay_warning_time = 4h
    
    readme_directory = no
    
    # TLS parameters
    smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
    smtpd_tls_key_file = /etc/postfix/ssl/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
    
    # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
    # information on enabling SSL in the smtp client.
    
    myhostname = sellers.gotdns.com
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    mydestination = sellers.gotdns.com, localhost.gotdns.com, localhost
    relayhost = 
    mynetworks = 127.0.0.0/8
    mailbox_command = procmail -a "$EXTENSION"
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    inet_protocols = all
    smtpd_sasl_local_domain = 
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_security_options = noanonymous
    broken_sasl_auth_clients = yes
    smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
    smtpd_tls_auth_only = no
    smtp_use_tls = yes
    smtp_tls_note_starttls_offer = yes
    smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
    smtpd_tls_loglevel = 1
    smtpd_tls_received_header = yes
    smtpd_tls_session_cache_timeout = 3600s
    tls_random_source = dev:/dev/urandom
    home_mailbox = Maildir/
    virtual_alias_maps = hash:/etc/postfix/virtual
    
    here's the last couple of lines from my /var/log/mail.log file

    Code:
    Nov 16 20:50:44 sellers authdaemond.plain: modules="authpam", daemons=5
    Nov 16 20:50:50 sellers postfix/master[4651]: daemon started -- version 2.5.4, configuration /etc/postfix
    Nov 16 20:56:44 sellers courierpop3login: Connection, ip=[::ffff:192.168.0.6]
    Nov 16 20:56:45 sellers courierpop3login: LOGIN, user=adza, ip=[::ffff:192.168.0.6]
    Nov 16 20:56:45 sellers courierpop3login: LOGOUT, user=adza, ip=[::ffff:192.168.0.6], top=0, retr=0, time=0
    Nov 16 20:56:47 sellers courierpop3login: Connection, ip=[::ffff:192.168.0.6]
    Nov 16 20:56:47 sellers courierpop3login: LOGIN, user=adza, ip=[::ffff:192.168.0.6]
    Nov 16 20:56:47 sellers courierpop3login: LOGOUT, user=adza, ip=[::ffff:192.168.0.6], top=0, retr=0, time=0
    
    but's it's what's in the auth.log that i think is the issue...

    Code:
    Nov 16 20:53:13 sellers sshd[4863]: Accepted password for adza from 192.168.0.6 port 50053 ssh2
    Nov 16 20:53:13 sellers sshd[4865]: pam_unix(sshd:session): session opened for user adza by (uid=0)
    Nov 16 20:53:13 sellers sshd[4865]: pam_env(sshd:setcred): Unable to open env file: /etc/default/locale: No such file or directory
    Nov 16 20:53:42 sellers sudo:     adza : TTY=pts/0 ; PWD=/etc/postfix/sasl ; USER=root ; COMMAND=/bin/cp smtpd.conf /home/adza/smtpd.conf
    Nov 16 20:53:42 sellers sudo: pam_unix(sudo:session): session opened for user root by adza(uid=0)
    Nov 16 20:53:42 sellers sudo: pam_unix(sudo:session): session closed for user root
    Nov 16 20:57:01 sellers sudo:     adza : TTY=pts/0 ; PWD=/var/log ; USER=root ; COMMAND=/bin/cp mail.log /home/adza/mail.log
    Nov 16 20:57:01 sellers sudo: pam_unix(sudo:session): session opened for user root by adza(uid=0)
    Nov 16 20:57:01 sellers sudo: pam_unix(sudo:session): session closed for user root
    Nov 16 20:57:47 sellers sudo:     adza : TTY=pts/0 ; PWD=/home/adza ; USER=root ; COMMAND=/bin/chmod 777 mail.log
    Nov 16 20:57:47 sellers sudo: pam_unix(sudo:session): session opened for user root by adza(uid=0)
    Nov 16 20:57:47 sellers sudo: pam_unix(sudo:session): session closed for user root
    Nov 16 20:59:25 sellers sudo:     adza : TTY=pts/0 ; PWD=/var/log ; USER=root ; COMMAND=/bin/cp auth.log /home/adza/auth.log
    
    The client (thunderbird) keeps telling me theres no mail on the server but the /var/mail/adza mailfile keeps expanding everyday... I can see the email using mutt from the cli on the server, but i kinda need to DL into a client.. hehe... any help would be muchly appreciated :)
     
  5. sjau

    sjau Local Meanie Moderator

    shouldn't the Maildirs be in ~/Maildir?
    At least that's what I read form the config. But then, you do the local delivery with procmail. What is it's config?
     
  6. adza

    adza New Member

    thanks sjau, this may sound like a stupid question but where's it's config? I can only find a reference to procmail in /usr/bin ... it does have file permissions of -rwsr-sr-x... i've never seen s as a file permission before.. only increasing the confusion...
     
  7. sjau

    sjau Local Meanie Moderator

    server-wide configs are in /etc somewhere. The procmail config should be directly in the /etc folder. Not sure for the name though.
     
  8. sjau

    sjau Local Meanie Moderator

    the file is /etc/procmailrc

    I have the following on top:

    Code:
    verbose=yes
    LOGFILE=/var/log/procmail.log
    
    DEFAULT=$HOME/Maildir/
    MAILDIR=$HOME/Maildir
    
    I'd suggest you try that also and afer editing the file restart procmail and then run

    Code:
    tail -f /var/log/procmail.log
    
    Then send yourself an email and check if (a) procmail really intercepts it [it should as you say in the postfix main.cf that procmail should] and (b) check where it goes.

    If the mails are now correctly delivered, then comment the first two lines (verbose/logfile) out.
     
  9. adza

    adza New Member

    also, here's my master.cf file as well...

    Code:
    #
    # Postfix master process configuration file.  For details on the format
    # of the file, see the master(5) manual page (command: "man 5 master").
    #
    # Do not forget to execute "postfix reload" after editing this file.
    #
    # ==========================================================================
    # service type  private unpriv  chroot  wakeup  maxproc command + args
    #               (yes)   (yes)   (yes)   (never) (100)
    # ==========================================================================
    smtp      inet  n       -       -       -       -       smtpd
    #submission inet n       -       -       -       -       smtpd
    #  -o smtpd_tls_security_level=encrypt
    #  -o smtpd_sasl_auth_enable=yes
    #  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
    #  -o milter_macro_daemon_name=ORIGINATING
    #smtps     inet  n       -       -       -       -       smtpd
    #  -o smtpd_tls_wrappermode=yes
    #  -o smtpd_sasl_auth_enable=yes
    #  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
    #  -o milter_macro_daemon_name=ORIGINATING
    #628      inet  n       -       -       -       -       qmqpd
    pickup    fifo  n       -       -       60      1       pickup
    cleanup   unix  n       -       -       -       0       cleanup
    qmgr      fifo  n       -       n       300     1       qmgr
    #qmgr     fifo  n       -       -       300     1       oqmgr
    tlsmgr    unix  -       -       -       1000?   1       tlsmgr
    rewrite   unix  -       -       -       -       -       trivial-rewrite
    bounce    unix  -       -       -       -       0       bounce
    defer     unix  -       -       -       -       0       bounce
    trace     unix  -       -       -       -       0       bounce
    verify    unix  -       -       -       -       1       verify
    flush     unix  n       -       -       1000?   0       flush
    proxymap  unix  -       -       n       -       -       proxymap
    proxywrite unix -       -       n       -       1       proxymap
    smtp      unix  -       -       -       -       -       smtp
    # When relaying mail as backup MX, disable fallback_relay to avoid MX loops
    relay     unix  -       -       -       -       -       smtp
    	-o smtp_fallback_relay=
    #       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
    showq     unix  n       -       -       -       -       showq
    error     unix  -       -       -       -       -       error
    retry     unix  -       -       -       -       -       error
    discard   unix  -       -       -       -       -       discard
    local     unix  -       n       n       -       -       local
    virtual   unix  -       n       n       -       -       virtual
    lmtp      unix  -       -       -       -       -       lmtp
    anvil     unix  -       -       -       -       1       anvil
    scache    unix  -       -       -       -       1       scache
    #
    # ====================================================================
    # Interfaces to non-Postfix software. Be sure to examine the manual
    # pages of the non-Postfix software to find out what options it wants.
    #
    # Many of the following services use the Postfix pipe(8) delivery
    # agent.  See the pipe(8) man page for information about ${recipient}
    # and other message envelope options.
    # ====================================================================
    #
    # maildrop. See the Postfix MAILDROP_README file for details.
    # Also specify in main.cf: maildrop_destination_recipient_limit=1
    #
    maildrop  unix  -       n       n       -       -       pipe
      flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
    #
    # See the Postfix UUCP_README file for configuration details.
    #
    uucp      unix  -       n       n       -       -       pipe
      flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
    #
    # Other external delivery methods.
    #
    ifmail    unix  -       n       n       -       -       pipe
      flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
    bsmtp     unix  -       n       n       -       -       pipe
      flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
    scalemail-backend unix	-	n	n	-	2	pipe
      flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
    mailman   unix  -       n       n       -       -       pipe
      flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
      ${nexthop} ${user}
    
     
  10. adza

    adza New Member

    SJau, creating that procmail file worked! i can now receive mail in the client... i still can't send mail however... it fails with the fattached error message...
     

    Attached Files:

  11. adza

    adza New Member

    in the auth.log file i find the following.. it seems that saslauthd can't start properly...

    Code:
    Nov 20 20:19:14 sellers saslauthd[5241]: detach_tty      : Cannot start saslauthd
    Nov 20 20:19:14 sellers saslauthd[5241]: detach_tty      : Another instance of saslauthd is currently running
    Nov 20 20:19:20 sellers sudo:     adza : TTY=pts/0 ; PWD=/var/mail ; USER=root ; COMMAND=/etc/init.d/saslauthd restart
    Nov 20 20:19:20 sellers sudo: pam_unix(sudo:session): session opened for user root by adza(uid=0)
    Nov 20 20:19:20 sellers sudo: pam_unix(sudo:session): session closed for user root
    Nov 20 20:19:20 sellers saslauthd[5252]: detach_tty      : could not lock pid file /var/run/saslauthd/saslauthd.pid: Resource temporarily unavailable
    Nov 20 20:19:20 sellers saslauthd[5251]: detach_tty      : Cannot start saslauthd
    Nov 20 20:19:20 sellers saslauthd[5251]: detach_tty      : Another instance of saslauthd is currently running
    Nov 20 20:20:52 sellers sudo:     adza : TTY=pts/0 ; PWD=/var/log ; USER=root ; COMMAND=/bin/cp auth.log /home/adza/
    
     
  12. adza

    adza New Member

    The tutorial says that i should telnet to localhost 25, the ehlo localhost 25, if i see the lines
    Code:
    250-STARTTLS
    250-AUTH
    
    then everything is fine... however, i see the lines...

    Code:
    250-STARTTLS
    250-AUTH NTLM LOGIN PLAIN DIGEST-MD5 CRAM-MD5
    250-AUTH=NTLM LOGIN PLAIN DIGEST-MD5 CRAM-MD5
    
    and the authentication doesn't work for sending mail... ??
     
  13. falko

    falko Super Moderator Howtoforge Staff

    What's the output of
    Code:
    updatedb
    locate smtpd.conf
    ?
     
  14. adza

    adza New Member

    Hi falko, output as follows

    Code:
    /etc/postfix/sasl/smtpd.conf
    /root/smtpd.conf
    
     
  15. falko

    falko Super Moderator Howtoforge Staff

    What's in /root/smtpd.conf?

    What is the output of
    Code:
    postconf -d
    ?
     
  16. adza

    adza New Member

    Hi falko, output of postconf -d is attached, also the /root/smtpd.conf as below
    Code:
    pwdcheck_method: saslauthd
    mech_list: plain login
    
     

    Attached Files:

  17. falko

    falko Super Moderator Howtoforge Staff

    Everything's looking ok. Can you post the output of
    Code:
    netstat -tap
    ?
     
  18. adza

    adza New Member

    HI Falko, still at this.. :S thanks for the help btw...

    Code:
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
    tcp        0      0 *:mysql                 *:*                     LISTEN      4457/mysqld     
    tcp        0      0 *:www                   *:*                     LISTEN      4774/apache2    
    tcp        0      0 *:ftp                   *:*                     LISTEN      4632/vsftpd     
    tcp        0      0 sellers.gotdns.c:domain *:*                     LISTEN      4247/named      
    tcp        0      0 localhost.locald:domain *:*                     LISTEN      4247/named      
    tcp        0      0 *:smtp                  *:*                     LISTEN      5869/master     
    tcp        0      0 localhost.localdoma:953 *:*                     LISTEN      4247/named      
    tcp        0      0 *:https                 *:*                     LISTEN      4774/apache2    
    tcp6       0      0 [::]:imaps              [::]:*                  LISTEN      4341/couriertcpd
    tcp6       0      0 [::]:pop3s              [::]:*                  LISTEN      4379/couriertcpd
    tcp6       0      0 [::]:pop3               [::]:*                  LISTEN      4357/couriertcpd
    tcp6       0      0 [::]:imap2              [::]:*                  LISTEN      4319/couriertcpd
    tcp6       0      0 [::]:9999               [::]:*                  LISTEN      4269/sshd       
    tcp6       0      0 [::]:smtp               [::]:*                  LISTEN      5869/master     
    tcp6       0      0 ip6-localhost:953       [::]:*                  LISTEN      4247/named      
    tcp6       0      0 sellers.gotdns.com:9999 192.168.0.6:42606       ESTABLISHED 8893/sshd: adza [pr
    
     
  19. falko

    falko Super Moderator Howtoforge Staff

    Looks ok. I was thinking that maybe Sendmail or another MTA was running instead of Postfix, but that's not the case... :confused:
     
  20. adza

    adza New Member

    Hi Falko, it seems to be authentication that is the issue... received this email from the system this morning...

    Code:
     Out: 220 sellers.gotdns.com ESMTP Postfix (Ubuntu)
     In:  EHLO [192.168.0.6]
     Out: 250-sellers.gotdns.com
     Out: 250-PIPELINING
     Out: 250-SIZE 10240000
     Out: 250-VRFY
     Out: 250-ETRN
     Out: 250-STARTTLS
     Out: 250-AUTH NTLM LOGIN PLAIN DIGEST-MD5 CRAM-MD5
     Out: 250-AUTH=NTLM LOGIN PLAIN DIGEST-MD5 CRAM-MD5
     Out: 250-ENHANCEDSTATUSCODES
     Out: 250-8BITMIME
     Out: 250 DSN
     In:  STARTTLS
     Out: 454 4.7.0 TLS not available due to local problem
     In:  AUTH CRAM-MD5
     Out: 334 PDc2MzIyNDE2OC4xNjI3MTMxQHNlbGxlcnMuZ290ZG5zLmNvbT4=
     In:  YWR6YSA3ZTg3NTFlNDgyYWRhZGY0YTRjOWJkMTRkMzUyNjFiYQ==
     Out: 535 5.7.8 Error: authentication failed: authentication failure
     In:  AUTH NTLM TlRMTVNTUAABAAAAB4IIAAAAAAAAAAAAAAAAAAAAAAA=
     Out: 334
         TlRMTVNTUAACAAAAJAAkADAAAAAFggIAUc0dLHGwyjcAAAAAAAAAAAAAAAAAAAAAUwBFAEwATABFAFIAUwAuAEcATwBUAEQATgBTAC4AQwBPAE0A
     In:
         TlRMTVNTUAADAAAAGAAYAFAAAAAYABgAaAAAAAAAAABAAAAACAAIAEAAAAAIAAgASAAAAAAAAAAAAAAABYIAAGEAZAB6AGEAYQBkAHoAYQBh/l1IqC80L0ujjoS4mxiRBfTWLd+xuKVh/l1IqC80L0ujjoS4mxiRBfTWLd+xuKU=
     Out: 535 5.7.8 Error: authentication failed: authentication failure
     In:  AUTH PLAIN AGFkemEAMXNoYW5rczEh
     Out: 535 5.7.8 Error: authentication failed: authentication failure
     In:  AUTH LOGIN
     Out: 334 VXNlcm5hbWU6
     In:  YWR6YQ==
     Out: 334 UGFzc3dvcmQ6
     In:  MXNoYW5rczEh
     Out: 535 5.7.8 Error: authentication failed: authentication failure
     In:  QUIT
     Out: 221 2.0.0 Bye
     

Share This Page