Postfix won't deliver locally, relay all (Redhat EL5.1)

Discussion in 'Installation/Configuration' started by TvL, Jan 8, 2008.

  1. TvL

    TvL New Member

    Postfix won't deliver locally, relays all (Redhat EL5.1)

    Hi all,

    I'm having problems getting postfix to work in my setup.
    I have followed the CentOS5.1 perfect server howto. I thought this would resemble most to RHEL5.1.

    I installed ispconfig by modding the dist.txt file in the install_ispconfig directory and modded the files under /root/install_ispconfig/mod to incorporate the RHEL configuration.

    I didn't have any problems until I tried to sent an email. Everything works except that. For some reason postfix won't deliver the mails locally when I sent an email.

    The following errors show up while sending an email:
    Code:
    Jan  8 15:59:03 myispconfig sendmail[10902]: m08Ex3U5010902: from=root, size=49, class=0, nrcpts=1, msgid=<[email protected]_domain.org>, [email protected]
    Jan  8 15:59:03 myispconfig postfix/smtpd[10890]: connect from testrhguest[127.0.0.1]
    Jan  8 15:59:03 myispconfig postfix/smtpd[10890]: setting up TLS connection from testrhguest[127.0.0.1]
    Jan  8 15:59:03 myispconfig sendmail[10902]: STARTTLS=client, relay=[127.0.0.1], version=TLSv1/SSLv3, verify=FAIL, cipher=DHE-RSA-AES256-SHA, bits=256/256
    Jan  8 15:59:03 myispconfig postfix/smtpd[10890]: TLS connection established from testrhguest[127.0.0.1]: TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)
    Jan  8 15:59:03 myispconfig postfix/smtpd[10890]: 7D4C6766417: client=testrhguest[127.0.0.1], [email protected]_domain.org
    Jan  8 15:59:03 myispconfig postfix/cleanup[10894]: 7D4C6766417: message-id=<[email protected]_domain.org>
    Jan  8 15:59:03 myispconfig postfix/qmgr[10808]: 7D4C6766417: from=<[email protected]_domain.org>, size=687, nrcpt=1 (queue active)
    Jan  8 15:59:03 myispconfig sendmail[10902]: m08Ex3U5010902: [email protected], ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30049, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as 7D4C6766417)
    Jan  8 15:59:03 myispconfig postfix/smtpd[10890]: disconnect from testrhguest[127.0.0.1]
    Jan  8 15:59:03 myispconfig postfix/smtp[10895]: certificate verification failed for mail.replaced_example.com: num=20:unable to get local issuer certificate
    Jan  8 15:59:03 myispconfig postfix/smtp[10895]: certificate verification failed for mail.replaced_example.com: num=27:certificate not trusted
    Jan  8 15:59:03 myispconfig postfix/smtp[10895]: certificate verification failed for mail.replaced_example.com: num=21:unable to verify the first certificate
    Jan  8 15:59:03 myispconfig postfix/smtp[10895]: 7D4C6766417: to=<[email protected]_domain.org>, orig_to=<[email protected]>, relay=mail.replaced_example.com[10.10.1.32]:25, delay=0.1, delays=0.05/0/0.02/0.03, dsn=2.0.0, status=sent (250 ok 1199804343 qp 8791)
    Jan  8 15:59:03 myispconfig postfix/qmgr[10808]: 7D4C6766417: removed
    
    my /etc/postfix/main.cf (have hacked a lot in this file)
    Code:
    queue_directory = /var/spool/postfix
    command_directory = /usr/sbin
    daemon_directory = /usr/libexec/postfix
    mail_owner = postfix
    inet_interfaces = all
    unknown_local_recipient_reject_code = 550
    relayhost = mail.replaced_example.com
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    
    
    debug_peer_level = 2
    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.3.3/samples
    readme_directory = /usr/share/doc/postfix-2.3.3/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 10.14.1.10
    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
    myhostname = myispconfig.replaced_domain.com
    home_mailbox = Maildir/
    mailbox_command = procmail -a "$EXTENSION"
    virtual_maps = hash:/etc/postfix/virtusertable
    mydestination = /etc/postfix/local-host-names
    
    my /etc/postfix/master.cf (without comments)
    Code:
    smtp      inet  n       -       n       -       -       smtpd
    pickup    fifo  n       -       n       60      1       pickup
    cleanup   unix  n       -       n       -       0       cleanup
    qmgr      fifo  n       -       n       300     1       qmgr
    tlsmgr    unix  -       -       n       1000?   1       tlsmgr
    rewrite   unix  -       -       n       -       -       trivial-rewrite
    bounce    unix  -       -       n       -       0       bounce
    defer     unix  -       -       n       -       0       bounce
    trace     unix  -       -       n       -       0       bounce
    verify    unix  -       -       n       -       1       verify
    flush     unix  n       -       n       1000?   0       flush
    proxymap  unix  -       -       n       -       -       proxymap
    smtp      unix  -       -       n       -       -       smtp
    relay     unix  -       -       n       -       -       smtp
            -o fallback_relay=
    showq     unix  n       -       n       -       -       showq
    error     unix  -       -       n       -       -       error
    discard   unix  -       -       n       -       -       discard
    local     unix  -       n       n       -       -       local
    virtual   unix  -       n       n       -       -       virtual
    lmtp      unix  -       -       n       -       -       lmtp
    anvil     unix  -       -       n       -       1       anvil
    scache    unix  -       -       n       -       1       scache
    maildrop  unix  -       n       n       -       -       pipe
      flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
    old-cyrus unix  -       n       n       -       -       pipe
      flags=R user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -m ${extension} ${user}
    cyrus     unix  -       n       n       -       -       pipe
      user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user}
    uucp      unix  -       n       n       -       -       pipe
      flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
    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=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient
    
    dig mx test.local
    Code:
    ; <<>> DiG 9.3.3rc2 <<>> mx test.local
    ;; global options:  printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23636
    ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
    
    ;; QUESTION SECTION:
    ;test.local.                    IN      MX
    
    ;; ANSWER SECTION:
    test.local.             86400   IN      MX      10 myispconfig.replaced_domain.com.
    
    ;; AUTHORITY SECTION:
    test.local.             86400   IN      NS      myispconfig.replaced_domain.com.
    
    ;; ADDITIONAL SECTION:
    myispconfig.replaced_domain.com. 81928 IN       A       10.14.1.10
    
    ;; Query time: 0 msec
    ;; SERVER: 10.14.1.10#53(10.14.1.10)
    ;; WHEN: Tue Jan  8 16:06:28 2008
    ;; MSG SIZE  rcvd: 102
    
    /etc/postfix/virtusertable
    Code:
    ###################################
    #
    # ISPConfig virtusertable Configuration File
    #         Version 1.0
    #
    ###################################
    [email protected]    web1_tole
    [email protected]    web1_tole
    @www.test.local    web1_tole
    [email protected]    web1_tole
    [email protected]    web1_tole
    @test.local    web1_tole
    
    I'm no postfix expert and hope somebody sees what I have done wrong.
    Kind regards,
    Tom
     
    Last edited: Jan 8, 2008
  2. TvL

    TvL New Member

    The problem is solved.

    When sending an email, the maillog said:
    Jan 8 15:59:03 myispconfig postfix/smtp[10895]: 7D4C6766417: to=<[email protected]_domain.org>, orig_to=<[email protected]>, relay=mail.replaced_example.com[10.10.1.32]:25, delay=0.1, delays=0.05/0/0.02/0.03, dsn=2.0.0, status=sent (250 ok 1199804343 qp 8791)

    For some reason myispconfig.replaced_domain.org was not in the local-host-names file... Therefor the server did not know the mail was meant to be delivered local.
     

Share This Page