Constantly restart postfix to deliver mails

Discussion in 'Server Operation' started by Dominick, May 27, 2014.

  1. Dominick

    Dominick New Member

    Hi everyone,

    I've been trying to figure out in the past 3 days what happened to my mail server (I even tried a fresh install) and nothing has changed so far.

    I doubt the configuration is the issue. For now, only mails sent and received via smtp will be processed. But, I constantly have to restart postfix to process the queue (I do it every 30 seconds for now), even there, the php mail queue is piling up.

    $ postconf -n
    Code:
    alias_database = hash:/etc/aliases
    alias_maps = hash:/etc/aliases
    body_checks = regexp:/etc/postfix/body_checks
    broken_sasl_auth_clients = yes
    command_directory = /usr/sbin
    config_directory = /etc/postfix
    content_filter = amavis:[127.0.0.1]:10024
    daemon_directory = /usr/libexec/postfix
    data_directory = /var/lib/postfix
    debug_peer_level = 2
    header_checks = regexp:/etc/postfix/header_checks
    html_directory = no
    inet_interfaces = all
    inet_protocols = all
    mail_owner = postfix
    mailbox_size_limit = 0
    mailq_path = /usr/bin/mailq.postfix
    manpage_directory = /usr/share/man
    message_size_limit = 0
    mime_header_checks = regexp:/etc/postfix/mime_header_checks
    mydestination = localhost, localhost.localdomain
    myhostname = myownhiddendomain.com
    mynetworks = my.ip.here/32 [my:ipv6:block]/64
    nested_header_checks = regexp:/etc/postfix/nested_header_checks
    newaliases_path = /usr/bin/newaliases.postfix
    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 $smtpd_sender_login_maps
    queue_directory = /var/spool/postfix
    readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
    receive_override_options = no_address_mappings
    relay_domains = mysql:/etc/postfix/mysql-virtual_relaydomains.cf
    relay_recipient_maps = mysql:/etc/postfix/mysql-virtual_relayrecipientmaps.cf
    relayhost =
    sample_directory = /usr/share/doc/postfix-2.6.6/samples
    sendmail_path = /usr/sbin/sendmail.postfix
    setgid_group = postdrop
    smtpd_client_restrictions = check_client_access mysql:/etc/postfix/mysql-virtual_client.cf
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf, reject_unauth_destination, reject_rbl_client zen.spamhaus.org
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_authenticated_header = yes
    smtpd_sasl_path = private/auth
    smtpd_sasl_type = dovecot
    smtpd_sender_login_maps = proxy:mysql:/etc/postfix/mysql-virtual_sender_login_maps.cf
    smtpd_sender_restrictions = reject_authenticated_sender_login_mismatch, check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf
    smtpd_tls_cert_file = /home/certs/ca.crt
    smtpd_tls_key_file = /home/certs/ca.key
    smtpd_tls_security_level = may
    smtpd_use_tls = yes
    transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
    unknown_local_recipient_reject_code = 550
    virtual_alias_domains =
    virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
    virtual_gid_maps = static:5000
    virtual_mailbox_base = /var/vmail
    virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
    virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    virtual_transport = dovecot
    virtual_uid_maps = static:5000
    Code:
     # cat /etc/postfix/master.cf
    smtp      inet  n       -       n       -       -       smtpd
    submission inet n       -       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       -       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       -       n       -       -       qmqpd
    pickup    fifo  n       -       n       60      1       pickup
    cleanup   unix  n       -       n       -       0       cleanup
    qmgr      fifo  n       -       n       300     1       qmgr
    #qmgr     fifo  n       -       n       300     1       oqmgr
    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
    proxywrite unix -       -       n       -       1       proxymap
    smtp      unix  -       -       n       -       -       smtp
    # When relaying mail as backup MX, disable fallback_relay to avoid MX loops
    relay     unix  -       -       n       -       -       smtp
    	-o smtp_fallback_relay=
    #       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
    showq     unix  n       -       n       -       -       showq
    error     unix  -       -       n       -       -       error
    retry     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/bin/maildrop -d ${recipient} ${extension} ${recipient} ${user} ${nexthop} ${sender}
    
    dovecot   unix  -       n       n       -       -       pipe
      flags=DROhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${user}@${nexthop}
    amavis unix - - - - 2 smtp
            -o smtp_data_done_timeout=1200
            -o smtp_send_xforward_command=yes
    
    127.0.0.1:10025 inet n - - - - smtpd
            -o content_filter=
            -o local_recipient_maps=
            -o relay_recipient_maps=
            -o smtpd_restriction_classes=
            -o smtpd_client_restrictions=
            -o smtpd_helo_restrictions=
            -o smtpd_sender_restrictions=
            -o smtpd_recipient_restrictions=permit_mynetworks,reject
            -o mynetworks=127.0.0.0/8
            -o strict_rfc821_envelopes=yes
            -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
    In the following log lines, we can observe that postfix is taking the message in account (one I sent to myself), but not doing anything. So I restarted it and it gets processed and then stuck, meaning I have to restart again to get it in my Inbox.

    Code:
    May 26 23:34:06 MAILSERVER postfix/smtpd[6560]: connect from myhostname.isp.com[ipv4.addr.at.home]
    May 26 23:34:07 MAILSERVER postfix/smtpd[6560]: B825D506E53: client=myhostname.isp.com[ipv4.addr.at.home], sasl_method=PLAIN, [email protected]
    May 26 23:34:08 MAILSERVER postfix/cleanup[6569]: B825D506E53: message-id=<[email protected]>
    May 26 23:34:28 MAILSERVER postfix/postfix-script[6952]: stopping the Postfix mail system
    May 26 23:34:28 MAILSERVER postfix/master[5506]: terminating on signal 15
    May 26 23:34:28 MAILSERVER postfix/postfix-script[7024]: starting the Postfix mail system
    May 26 23:34:28 MAILSERVER postfix/master[7025]: daemon started -- version 2.6.6, configuration /etc/postfix
    May 26 23:34:28 MAILSERVER postfix/qmgr[7028]: B825D506E53: from=<[email protected]>, size=596, nrcpt=1 (queue active)
    May 26 23:34:29 MAILSERVER postfix/smtpd[7049]: connect from unknown[127.0.0.1]
    May 26 23:34:29 MAILSERVER postfix/smtpd[7049]: 6857A506E54: client=unknown[127.0.0.1]
    May 26 23:34:29 MAILSERVER postfix/cleanup[7056]: 6857A506E54: message-id=<[email protected]>
    May 26 23:34:29 MAILSERVER postfix/smtpd[7049]: disconnect from unknown[127.0.0.1]
    May 26 23:34:29 MAILSERVER amavis[3370]: (03370-03) Passed CLEAN {RelayedInternal}, DKIM_ALWAYS LOCAL [ipv4.addr.at.home]:59926 [ipv4.addr.at.home] <[email protected]> -> <[email protected]>, Message-ID: <[email protected]>, mail_id: QSISAXSPaaTy, Hits: -2.9, size: 596, queued_as: 6857A506E54, 581 ms
    May 26 23:34:29 MAILSERVER postfix/smtp[7029]: B825D506E53: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=22, delays=21/0/0/0.58, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 6857A506E54)
    May 26 23:34:29 MAILSERVER postfix/qmgr[7028]: B825D506E53: removed
    May 26 23:34:41 MAILSERVER postfix/postfix-script[7209]: stopping the Postfix mail system
    May 26 23:34:41 MAILSERVER postfix/master[7025]: terminating on signal 15
    May 26 23:34:41 MAILSERVER postfix/postfix-script[7305]: starting the Postfix mail system
    May 26 23:34:41 MAILSERVER postfix/master[7306]: daemon started -- version 2.6.6, configuration /etc/postfix
    May 26 23:34:41 MAILSERVER postfix/qmgr[7317]: 6857A506E54: from=<[email protected]>, size=1002, nrcpt=2 (queue active)
    May 26 23:34:42 MAILSERVER dovecot: lda([email protected]): sieve: msgid=<[email protected]>: stored mail into mailbox 'INBOX'
    May 26 23:34:42 MAILSERVER postfix/pipe[7323]: 6857A506E54: to=<[email protected]>, relay=dovecot, delay=13, delays=12/0.02/0/0.34, dsn=2.0.0, status=sent (delivered via dovecot service)
    May 26 23:34:42 MAILSERVER postfix/qmgr[7317]: 6857A506E54: removed
    I checked amavisd, spamassassin & cie and they are all running. Any help would be appreciated.

    Thanks,
    Dom
     
    Last edited: May 27, 2014
  2. srijan

    srijan New Member HowtoForge Supporter

    Please stop all process of postfix, then stop further start the service of postfix & check
     
  3. Dominick

    Dominick New Member

    Hi,

    Could you be a bit more clear? You want me to stop all postfix processes & cie? So, dovecot, amavisd, clamd.amavisd, clamd, etc should be stopped? Then check what, since nothing is going to happen.

    Code:
    [[email protected] ~]# service postfix stop
    Shutting down postfix:                                     [  OK  ]
    [[email protected] ~]# service postfix check
    [[email protected] ~]# service postfix start
    Starting postfix:                                          [  OK  ]
    
    Thanks,
     
    Last edited: May 27, 2014
  4. srijan

    srijan New Member HowtoForge Supporter

    Proceed like

    Then further try to check
     
  5. Dominick

    Dominick New Member

    Hi,

    I tried, but no conclusion can be done. Nothing fails while executing the commands...

    This is a production server that stopped working after updates have been applied and a reboot done.

    Here are the packages updated at the time.

    Code:
    May 23 13:50:26 Updated: betterlinux-1.1.8-1.el6.x86_64
    May 23 13:50:34 Installed: betterlinux-kernel-2.6.32-431.17.1.el6.bl1.1.8_1.x86_64
    May 23 21:45:13 Updated: php-tcpdf-6.0.072-1.el6.noarch
    May 23 21:45:20 Updated: clamav-db-0.98.3-1.el6.x86_64
    May 23 21:45:22 Updated: tzdata-2014b-3.24.el6.noarch
    May 23 21:45:29 Updated: glibc-2.12-1.132.el6_5.1.x86_64
    May 23 21:45:41 Updated: glibc-common-2.12-1.132.el6_5.1.x86_64
    May 23 21:45:43 Updated: libxml2-2.7.6-14.el6_5.1.x86_64
    May 23 21:45:45 Updated: clamav-0.98.3-1.el6.x86_64
    May 23 21:45:46 Updated: kernel-headers-2.6.32-431.17.1.el6.bl1.1.8_1.x86_64
    May 23 21:45:48 Updated: glibc-headers-2.12-1.132.el6_5.1.x86_64
    May 23 21:45:51 Updated: selinux-policy-3.7.19-231.el6_5.3.noarch
    May 23 21:46:17 Updated: selinux-policy-targeted-3.7.19-231.el6_5.3.noarch
    May 23 21:46:18 Updated: glibc-devel-2.12-1.132.el6_5.1.x86_64
    May 23 21:46:19 Updated: clamd-0.98.3-1.el6.x86_64
    May 23 21:46:20 Updated: libxml2-devel-2.7.6-14.el6_5.1.x86_64
    May 23 21:46:21 Updated: mdadm-3.2.6-7.el6_5.2.x86_64
    May 23 21:46:22 Updated: pm-utils-1.2.5-10.el6_5.1.x86_64
    May 23 21:46:25 Updated: php-tcpdf-dejavu-sans-fonts-6.0.072-1.el6.noarch
    May 23 21:46:27 Updated: tzdata-java-2014b-3.24.el6.noarch
    May 23 21:49:54 Updated: php-common-5.4.28-1.el6.remi.x86_64
    May 23 21:49:54 Updated: php-pdo-5.4.28-1.el6.remi.x86_64
    May 23 21:49:55 Updated: php-cli-5.4.28-1.el6.remi.x86_64
    May 23 21:49:58 Updated: php-5.4.28-1.el6.remi.x86_64
    May 23 21:50:03 Updated: php-devel-5.4.28-1.el6.remi.x86_64
    May 23 21:50:06 Updated: php-mssql-5.4.28-1.el6.remi.x86_64
    May 23 21:50:07 Updated: php-odbc-5.4.28-1.el6.remi.x86_64
    May 23 21:50:08 Updated: php-mysql-5.4.28-1.el6.remi.x86_64
    May 23 21:50:09 Updated: php-gd-5.4.28-1.el6.remi.x86_64
    May 23 21:50:10 Updated: php-tidy-5.4.28-1.el6.remi.x86_64
    May 23 21:50:11 Updated: php-xmlrpc-5.4.28-1.el6.remi.x86_64
    May 23 21:50:11 Updated: php-soap-5.4.28-1.el6.remi.x86_64
    May 23 21:50:12 Updated: php-xml-5.4.28-1.el6.remi.x86_64
    May 23 21:50:12 Updated: php-bcmath-5.4.28-1.el6.remi.x86_64
    May 23 21:50:13 Updated: php-process-5.4.28-1.el6.remi.x86_64
    May 23 21:50:14 Updated: php-recode-5.4.28-1.el6.remi.x86_64
    May 23 21:50:14 Updated: php-snmp-5.4.28-1.el6.remi.x86_64
    May 23 21:50:16 Updated: php-mbstring-5.4.28-1.el6.remi.x86_64
    May 23 21:50:17 Updated: php-ldap-5.4.28-1.el6.remi.x86_64
    May 23 21:50:18 Updated: php-imap-5.4.28-1.el6.remi.x86_64
    May 23 21:50:18 Updated: php-mcrypt-5.4.28-1.el6.remi.x86_64
    May 23 21:51:55 Updated: mysql-libs-5.5.37-1.el6.remi.x86_64
    May 23 21:51:58 Updated: mysql-5.5.37-1.el6.remi.x86_64
    May 23 21:52:01 Installed: xulrunner-last-26.0-2.el6.remi.x86_64
    May 23 21:52:04 Updated: 1:php-pear-1.9.4-27.el6.remi.noarch
    May 23 21:52:05 Updated: php-pecl-apc-3.1.15-0.4.20130912.el6.remi.5.4.x86_64
    May 23 21:52:10 Updated: firefox-26.0-2.el6.remi.x86_64
    May 23 21:52:14 Updated: mysql-server-5.5.37-1.el6.remi.x86_64
    May 23 21:52:14 Updated: remi-release-6.5-1.el6.remi.noarch
    May 23 21:53:04 Updated: vnstat-1.11-1.el6.rf.x86_64
    May 23 21:55:17 Updated: php-tcpdf-6.0.077-1.el6.remi.noarch
    May 23 21:55:17 Updated: php-tcpdf-dejavu-sans-fonts-6.0.077-1.el6.remi.noarch
    May 23 21:55:18 Installed: perl-Geo-IP-1.38-1.el6.rf.x86_64
    May 23 21:55:19 Updated: awstats-7.1-1.el6.rf.noarch
    May 23 21:55:23 Updated: phpMyAdmin-4.2.2-1.el6.remi.noarch
    May 23 21:55:24 Updated: perl-Net-Server-0.99-1.el6.rf.noarch
    May 23 21:55:25 Updated: htop-1.0.3-1.el6.rf.x86_64
    May 23 21:55:26 Updated: perl-IO-Multiplex-1.13-1.el6.rf.noarch
    May 23 21:55:27 Updated: cabextract-1.4-1.el6.rf.x86_64
    May 23 21:55:27 Updated: perl-Convert-TNEF-0.18-1.el6.rf.noarch
    May 23 21:55:28 Updated: pure-ftpd-1.0.36-1.el6.rf.x86_64
    
    I will try reverting back to the original kernel tonight, since there might be a correlation with it.

    Sincerely,
    Dom
     

Share This Page