Postfix delivery problem

Discussion in 'Installation/Configuration' started by erebus, Oct 26, 2007.

  1. erebus

    erebus New Member

    Hello all,

    The last days I noticed a weird problem related to postfix and its mail delivery. Before I start explaining the situation I want to say that I 've already searched for two days in the forum and found tons of problems related to the 'catchall' functionality and the local-host-names file. I don't know if this is the case for me, but I would try to explain the problem, pointing out what I have tested/changed so far.

    First of all normal e-mail accounts seem to work well. The problem is with the 'catchall' functionality, especially when forwarding the 'catchall' account to a normal account. I.e.:

    I have a website www.web.tld and a normal account info@web.tld. I have another website in ISPConfig, named www.city.tld and have set there a catchall account info@city.tld which forwards all mail to info@web.tld. The problem is that these catchall e-mails for city.tld are never delivered to info@web.tld but instead are delivered to the local root account!

    The machine name is nemesis.web.tld, which is not set as a vhost in ISPConfig, and I also use the alias mail.web.tld which is not set as vhost too.

    Here is my main.cf file:

    Code:
    queue_directory = /var/spool/postfix
    command_directory = /usr/sbin
    daemon_directory = /usr/libexec/postfix
    mail_owner = postfix
    myhostname = nemesis.web.tld
    mydomain = nemesis.web.tld
    myorigin = nemesis.web.tld
    inet_interfaces = all
    unknown_local_recipient_reject_code = 550
    debugger_command =
             PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
             xxgdb $daemon_directory/$process_name $process_id & sleep 5
    sendmail_path = /usr/sbin/sendmail.postfix
    newaliases_path = /usr/bin/newaliases.postfix
    mailq_path = /usr/bin/mailq.postfix
    setgid_group = postdrop
    html_directory = no
    manpage_directory = /usr/share/man
    sample_directory = /usr/share/doc/postfix-2.2.10/samples
    readme_directory = /usr/share/doc/postfix-2.2.10/README_FILES
    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
    mynetworks = 127.0.0.0/8
    smtpd_tls_auth_only = no
    smtp_use_tls = yes
    smtpd_use_tls = yes
    smtp_tls_note_starttls_offer = yes
    smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
    smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
    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
    virtual_maps = hash:/etc/postfix/virtusertable
    mydestination = /etc/postfix/local-host-names
    Here is my hostname:

    Code:
    [erebus@nemesis ~]$ hostname
    nemesis
    [erebus@nemesis ~]$ hostname -f
    nemesis.web.tld
    Here is the contents of my local-host-names:

    Code:
    localhost
    nemesis.web.tld
    localhost.nemesis.web.tld
    localhost.web.tld
    localhost.localdomain
    www.web.tld
    web.tld
    www.city.tld
    city.tld
    www.uni.tld
    uni.tld
    
    [...]
    a bunch of other (www.)names.tld created by ISPConfig
    [...]
    
    #### MAKE MANUAL ENTRIES BELOW THIS LINE! ####
    mail.web.tld
    nemesis.web.tld is also the name I use in ISPConfig's setup (but there is NO vhost with that name). I 've also tried to use mail.web.tld instead of 'nemesis.web.tld' in master.cf but in vain.

    Here are the relevant maillog entries:

    Code:
    Oct 26 15:01:15 nemesis postfix/cleanup[4065]: CD3A044022A: message-id=<4721D6BD.2090303@sh.tld>
    Oct 26 15:01:15 nemesis postfix/qmgr[850]: CD3A044022A: from=<info@sh.tld>, size=1484, nrcpt=1 (queue active)
    Oct 26 15:01:15 nemesis postfix/local[4207]: CD3A044022A: to=<root@nemesis.web.tld>, orig_to=<test@city.tld>, relay=local, delay=1, status=sent (delivered to mailbox)
    Oct 26 15:01:15 nemesis postfix/qmgr[850]: CD3A044022A: removed
    Oct 26 15:01:15 nemesis postfix/smtpd[3983]: disconnect from mx-out.for.tld[193.92.150.x]
    [root@nemesis /var/mail]# tail -n 30 /var/log/maillog
    Those 'root' mails, are stored in /var/mail where the 'root' file is increasing because of those deliveries:

    Code:
    [root@nemesis /var/mail]# l
    total 2.1M
    drwxrwxr-x   2 root mail 4.0K Oct 26 14:47 ./
    drwxr-xr-x  14 root root 4.0K Sep 20 17:14 ../
    -rw-------   1 root mail 2.1M Oct 26 14:47 root
    However catchall for other domains seem to work, i.e.:

    Code:
    Oct 26 14:04:48 nemesis postfix/local[2648]: 5A190440228: to=<web.tld_info@nemesis.web.tld>, orig_to=<info@uni.tld>, relay=local, delay=18, status=sen
    t (delivered to command: /usr/bin/procmail -f-)
    Oct 26 14:04:48 nemesis postfix/qmgr[850]: 5A190440228: removed
    (uni.tld has a catchall for info@web.tld too).

    Also, DNS and MX records are in place for all the above domains.

    Any ideas are very welcome as this is a production server and I don't know what else to do (not any experience with postfix too).

    P.S. In the above logs I have changed the real domains for obvious reasons; however I have changed them carefully and each one represents the real one.
     
    Last edited: Oct 26, 2007
  2. till

    till Super Moderator

    Do you have any aliases in the postfix aliases file?
     
  3. erebus

    erebus New Member

    Here are the contents of the /etc/aliases file:

    Code:
    #
    #  Aliases in this file will NOT be expanded in the header from
    #  Mail, but WILL be visible over networks or from /bin/mail.
    #
    #       >>>>>>>>>>      The program "newaliases" must be run after
    #       >> NOTE >>      this file is updated for any changes to
    #       >>>>>>>>>>      show through to sendmail.
    #
    
    # Basic system aliases -- these MUST be present.
    mailer-daemon:  postmaster
    postmaster:     root
    
    # General redirections for pseudo accounts.
    bin:            root
    daemon:         root
    adm:            root
    lp:             root
    sync:           root
    shutdown:       root
    halt:           root
    mail:           root
    news:           root
    uucp:           root
    operator:       root
    games:          root
    gopher:         root
    ftp:            root
    nobody:         root
    radiusd:        root
    nut:            root
    dbus:           root
    vcsa:           root
    canna:          root
    wnn:            root
    rpm:            root
    nscd:           root
    pcap:           root
    apache:         root
    webalizer:      root
    dovecot:        root
    fax:            root
    quagga:         root
    radvd:          root
    pvm:            root
    amanda:         root
    privoxy:        root
    ident:          root
    named:          root
    xfs:            root
    gdm:            root
    mailnull:       root
    postgres:       root
    sshd:           root
    smmsp:          root
    postfix:        root
    netdump:        root
    ldap:           root
    squid:          root
    ntp:            root
    mysql:          root
    desktop:        root
    rpcuser:        root
    rpc:            root
    nfsnobody:      root
    
    ingres:         root
    system:         root
    toor:           root
    manager:        root
    dumper:         root
    abuse:          root
    
    # mailman aliases
    mailman:        postmaster
    mailman-owner:  mailman
    
    newsadm:        news
    newsadmin:      news
    usenet:         news
    ftpadm:         ftp
    ftpadmin:       ftp
    ftp-adm:        ftp
    ftp-admin:      ftp
    www:            webmaster
    webmaster:      root
    noc:            root
    security:       root
    hostmaster:     root
    info:           postmaster
    marketing:      postmaster
    sales:          postmaster
    support:        postmaster
    
    # trap decode to catch security attacks
    decode:         root
    
    # Person who should get root's mail
    #root:          marc
    I think I don't have any other aliases file on my system. Here are the contents of /etc/postfix to verify:

    Code:
    [root@nemesis /etc/postfix]# l
    total 336K
    drwxr-xr-x   3 root root 4.0K Oct 22 11:42 ./
    drwxr-xr-x  75 root root  12K Oct 26 16:29 ../
    -rw-r--r--   1 root root  16K Jul 21 14:42 access
    -rw-r--r--   1 root root  11K Jul 21 14:42 canonical
    -rw-r--r--   1 root root 9.4K Jul 21 14:42 generic
    -rw-r--r--   1 root root  17K Jul 21 14:42 header_checks
    -rw-r--r--   1 root root  12K Jul 21 14:42 LICENSE
    -rw-r--r--   1 root root 1.6K Oct 26 16:29 local-host-names
    -rw-r--r--   1 root root 1.6K Oct 26 16:29 local-host-names~
    -rw-r--r--   1 root root  27K Oct 26 12:32 main.cf
    -rw-r--r--   1 root root  14K Jul 21 14:42 main.cf.default
    -rw-r--r--   1 root root  27K Sep 25 04:39 main.cf.orig
    -rw-r--r--   1 root root 1.3K Jul 21 14:42 makedefs.out
    -rw-r--r--   1 root root 4.1K Jul 21 14:42 master.cf
    -rw-r--r--   1 root root  17K Jul 21 14:42 postfix-files
    -rwxr-xr-x   1 root root 6.3K Jul 21 14:42 postfix-script*
    -rwxr-xr-x   1 root root  22K Jul 21 14:42 post-install*
    -rw-------   1 root root 1.0K Oct 27 02:30 prng_exch
    -rw-r--r--   1 root root 6.4K Jul 21 14:42 relocated
    drwxr-xr-x   2 root root 4.0K Sep 29 05:11 ssl/
    -rw-r--r--   1 root root 1.6K Jul 21 14:42 TLS_LICENSE
    -rw-r--r--   1 root root  11K Jul 21 14:42 transport
    -rw-r--r--   1 root root  12K Jul 21 14:42 virtual
    -rw-r--r--   1 root root  13K Oct 26 16:29 virtusertable
    -rw-r--r--   1 root root  13K Oct 26 16:29 virtusertable~
    -rw-r--r--   1 root root  24K Oct 26 16:29 virtusertable.db
    Thank you very much in advance for helping me on this...
     
  4. till

    till Super Moderator

    You should clean up your aliases file, I recommend to remove at least the following lines:

    info: postmaster
    marketing: postmaster
    sales: postmaster
    support: postmaster

    and then run:

    postmap /etc/aliases
     
  5. erebus

    erebus New Member

    I commented out the lines you suggested, but when I run postmap I get the following:

    Code:
    [root@nemesis ~]# postmap /etc/aliases
    postmap: warning: /etc/aliases, line 11: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 14: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 15: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 16: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 17: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 18: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 19: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 20: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 21: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 22: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 23: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 24: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 25: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 26: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 27: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 28: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 29: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 30: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 31: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 32: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 33: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 34: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 35: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 36: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 37: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 38: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 39: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 40: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 41: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 42: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 43: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 44: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 45: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 46: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 47: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 48: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 49: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 50: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 51: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 52: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 53: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 54: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 55: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 56: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 57: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 58: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 59: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 60: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 61: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 62: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 63: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 64: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 66: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 67: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 68: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 69: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 70: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 71: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 74: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 75: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 77: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 78: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 79: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 80: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 81: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 82: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 83: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 84: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 85: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 86: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 87: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 88: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 97: record is in "key: value" format; is this an alias file?
    postmap: warning: /etc/aliases, line 101: record is in "key: value" format; is this an alias file?
    Any suggestions?

    P.S. Also I forgot to mention that this /etc/aliases file is the default one, generated from Centos 4.5. I hadn't ever touched this file until today.
     
  6. till

    till Super Moderator

    Sorry, please run just the command:

    newaliases

    to update the aliases db file.
     
  7. erebus

    erebus New Member

    After a quick investigation, postalias seemed to have done the trick instead of postmap:

    Code:
    [root@nemesis ~]# postalias /etc/aliases
    [root@nemesis ~]# l /etc/aliases*
    -rw-r--r--  1 root root  1.6K Oct 28 17:04 /etc/aliases
    -rw-r-----  1 root smmsp  12K Oct 28 17:13 /etc/aliases.db
    Code:
    Oct 28 17:14:43 nemesis postfix/local[16232]: E6FD24405A1: to=<web.tld_info@nemesis.web.tld>, orig_to=<test@city.tld>, relay=local, delay=16, status=sent (delivered to command: /usr/bin/procmail -f-)
    Success! Further investigation to follow. Thank you very much for your help till!

    P.S. For the records, here is the difference between postmap and postalias (taken from the man pages):

    postmap:
    postalias:
    Thanks once more!

    Edit: 'newaliases' also ran with no errors - I hope it is the same as the postalias I mentioned above.
     
  8. rodrigobrasil29

    rodrigobrasil29 New Member

    (Host or domain name not found. Name service error for name=gmail.com type=AAAA: ....

    Hi there,

    I got a postfix configured like mailing just to send emails and from nothin its stopped to send emails for external domains. i can send just to my domains.
    My log show me:
    Code:
    maillist postfix/smtp[1361]: 627653060: to=<rodrigobrasil29@gmail.com>,
     relay=none, delay=0.04, delays=0.02/0/0.01/0, dsn=5.4.4, status=bounced 
    (Host or domain name not found. Name service error for name=gmail.com type=AAAA: Host found but no data record of requested type)
    When i send to my domain:
    Code:
    Jun 26 08:17:56 maillist postfix/qmgr[1356]: E7E373043: from=<root@al.sc.gov.br>,
     size=925, nrcpt=1 (queue active)Jun 26 08:18:16 maillist postfix/smtp[1361]: E7E373043:
     to=<rodrigo@alesc.sc.gov.br>, relay=eslovenia.alesc.sc.gov.br[200.192.66.25]:25, delay=308,
     delays=288/0.02/10/10, dsn=2.6.0, status=sent (250 2.6.0 <20140626111308.E7E373043@maillist.al.sc.gov.br>
     Queued mail for delivery)
    If someone could help!
     
  9. patrickheinz

    patrickheinz New Member

    Rodrigo,

    Can you ping 'gmail.com'?
    And
    Code:
    host -t MX gmail.com
    ?

    It seems to be a dns resolution problem.

    Is there additional configuration at your /etc/hosts? And /etc/resolv.conf ?

    Espero que ajude ;D

    --
     

Share This Page