Outgoing mail suddenly not working anymore

Discussion in 'Installation/Configuration' started by Cris Kolkman, Nov 2, 2016.

  1. Cris Kolkman

    Cris Kolkman Member

    Hello,

    I can't send any mail anymore, getting this error:
    39F385D614A 4983273 Mon Oct 31 10:03:33 [email protected]
    (connect to 127.0.0.1[127.0.0.1]:10026: Connection refused)
    [email protected]

    Strange thing is that it's trying to connect to port 10026, but I don't have it anywhere configured.
    [root@mailserver ~]# cat /etc/postfix/main.cf | grep 10026
    [root@mailserver ~]# cat /etc/postfix/main.cf | grep 10024
    content_filter = amavis:[127.0.0.1]:10024
    [root@mailserver ~]#

    It does not find anything on 10026.

    [root@mailserver ~]# netstat -ntap
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1393/mysqld
    tcp 0 0 127.0.0.1:10027 0.0.0.0:* LISTEN 7376/master
    tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN 7376/master
    tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 2201/dovecot
    tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 2201/dovecot
    tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN 7376/master
    tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 883/pure-ftpd (SERV
    tcp 0 0 ***.***.***.***:53 0.0.0.0:* LISTEN 810/named
    tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 810/named
    tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 759/sshd
    tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 7376/master
    tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 810/named
    tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 2201/dovecot
    tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 2201/dovecot
    tcp 0 0 127.0.0.1:199 0.0.0.0:* LISTEN 758/snmpd
    tcp 0 0 127.0.0.1:10024 0.0.0.0:* LISTEN 6535/amavisd (maste
    tcp 0 0 127.0.0.1:10025 0.0.0.0:* LISTEN 7376/master
    tcp 0 64 ***.***.***.***:22 62.112.191.47:56115 ESTABLISHED 3530/sshd: root@pts
    tcp 0 0 127.0.0.1:3306 127.0.0.1:36544 ESTABLISHED 1393/mysqld
    tcp 0 0 127.0.0.1:36544 127.0.0.1:3306 ESTABLISHED 6537/amavisd (ch1-a
    tcp 61 0 127.0.0.1:58252 127.0.0.1:10025 CLOSE_WAIT 6537/amavisd (ch1-a
    tcp 0 0 ***.***.***.***:993 194.171.76.136:39779 ESTABLISHED 4401/dovecot/imap-l
    tcp 0 0 ***.***.***.***:993 194.171.76.136:65510 ESTABLISHED 8260/dovecot/imap-l
    tcp 0 0 ***.***.***.***:993 194.171.76.136:38649 ESTABLISHED 4405/dovecot/imap-l
    tcp6 0 0 :::587 :::* LISTEN 7376/master
    tcp6 0 0 :::110 :::* LISTEN 2201/dovecot
    tcp6 0 0 :::143 :::* LISTEN 2201/dovecot
    tcp6 0 0 :::8080 :::* LISTEN 870/httpd
    tcp6 0 0 :::80 :::* LISTEN 870/httpd
    tcp6 0 0 :::465 :::* LISTEN 7376/master
    tcp6 0 0 :::8081 :::* LISTEN 870/httpd
    tcp6 0 0 :::21 :::* LISTEN 883/pure-ftpd (SERV
    tcp6 0 0 :::53 :::* LISTEN 810/named
    tcp6 0 0 :::22 :::* LISTEN 759/sshd
    tcp6 0 0 :::25 :::* LISTEN 7376/master
    tcp6 0 0 ::1:953 :::* LISTEN 810/named
    tcp6 0 0 :::443 :::* LISTEN 870/httpd
    tcp6 0 0 :::993 :::* LISTEN 2201/dovecot
    tcp6 0 0 :::995 :::* LISTEN 2201/dovecot
    tcp6 0 0 ::1:10024 :::* LISTEN 6535/amavisd (maste
    tcp6 0 0 ***.***.***.***:8080 62.112.191.47:19433 TIME_WAIT -
    tcp6 0 0 ***.***.***.***:443 62.112.191.47:39547 TIME_WAIT -
    tcp6 0 0 ***.***.***.***:8080 62.112.191.47:27829 TIME_WAIT -
    tcp6 0 0 ***.***.***.***:8080 62.112.191.47:59863 TIME_WAIT -
    tcp6 0 0 ***.***.***.***:8080 62.112.191.47:53219 TIME_WAIT -
    tcp6 0 0 ***.***.***.***:8080 62.112.191.47:29479 TIME_WAIT -
    tcp6 0 0 ***.***.***.***:8080 62.112.191.47:16698 TIME_WAIT -
    tcp6 0 0 ***.***.***.***:8080 62.112.191.47:40169 TIME_WAIT -
    tcp6 0 0 ***.***.***.***:8080 62.112.191.47:49802 TIME_WAIT -
    tcp6 0 0 ***.***.***.***:8080 62.112.191.47:47269 ESTABLISHED 2193/httpd
    tcp6 0 0 ***.***.***.***:8080 62.112.191.47:45633 TIME_WAIT -
    tcp6 0 0 ***.***.***.***:8080 62.112.191.47:62690 TIME_WAIT -
    tcp6 0 0 ***.***.***.***:8080 62.112.191.47:18858 TIME_WAIT -
    [root@mailserver ~]#

    (Replaced server IP with ***.***.***.***)

    Why is it trying to connect to port 10026 while I didn't change anything and sending mails went fine.
     
  2. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    10026 is amavis. it should be defined in postfix/master.cf
     
  3. Cris Kolkman

    Cris Kolkman Member

    Where should it be defined than?
    This is my master.cf:

    [root@mailserver ~]# cat /etc/postfix/master.cf
    #
    # 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 - n - - smtpd
    #smtp inet n - n - 1 postscreen
    #smtpd pass - - n - - smtpd
    #dnsblog unix - - n - 0 dnsblog
    #tlsproxy unix - - n - 0 tlsproxy
    submission inet n - n - - smtpd
    # -o syslog_name=postfix/submission
    # -o smtpd_tls_security_level=encrypt
    # -o smtpd_sasl_auth_enable=yes
    # -o smtpd_reject_unlisted_recipient=no
    # -o smtpd_client_restrictions=$mua_client_restrictions
    # -o smtpd_helo_restrictions=$mua_helo_restrictions
    # -o smtpd_sender_restrictions=$mua_sender_restrictions
    # -o smtpd_recipient_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 syslog_name=postfix/smtps
    # -o smtpd_tls_wrappermode=yes
    # -o smtpd_sasl_auth_enable=yes
    # -o smtpd_reject_unlisted_recipient=no
    # -o smtpd_client_restrictions=$mua_client_restrictions
    # -o smtpd_helo_restrictions=$mua_helo_restrictions
    # -o smtpd_sender_restrictions=$mua_sender_restrictions
    # -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject
    # -o milter_macro_daemon_name=ORIGINATING
    #628 inet n - n - - qmqpd
    pickup unix n - n 60 1 pickup
    cleanup unix n - n - 0 cleanup
    qmgr unix n - n 300 1 qmgr
    #qmgr unix 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
    relay unix - - n - - smtp
    # -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
    #
    # ====================================================================
    # 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} ${extension} ${recipient} ${user} ${nexthop} ${sender}
    #
    # ====================================================================
    #
    # Recent Cyrus versions can use the existing "lmtp" master.cf entry.
    #
    # Specify in cyrus.conf:
    # lmtp cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
    #
    # Specify in main.cf one or more of the following:
    # mailbox_transport = lmtp:inet:localhost
    # virtual_transport = lmtp:inet:localhost
    #
    # ====================================================================
    #
    # Cyrus 2.1.5 (Amos Gouaux)
    # Also specify in main.cf: cyrus_destination_recipient_limit=1
    #
    #cyrus unix - n n - - pipe
    # user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user}
    #
    # ====================================================================
    #
    # Old example of delivery via Cyrus.
    #
    #old-cyrus unix - n n - - pipe
    # flags=R user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -m ${extension} ${user}
    #
    # ====================================================================
    #
    # 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/local/sbin/bsmtp -f $sender $nexthop $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}
    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


    127.0.0.1:10027 inet n - 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
    -o smtp_send_xforward_command=yes
    -o milter_default_action=accept
    -o milter_macro_daemon_name=ORIGINATING
    -o disable_dns_lookups=yes

    And it was working before, didn't change anything in the postfix config files.
    Also when I check "netstat -ntap", port 10026 is not listed there to listen.

    [root@mailserver ~]# netstat -ntap | grep amavis
    tcp 0 0 127.0.0.1:10024 0.0.0.0:* LISTEN 2201/amavisd (maste
    tcp 0 0 127.0.0.1:37270 127.0.0.1:3306 ESTABLISHED 2202/amavisd (ch1-a
    tcp 0 0 127.0.0.1:46690 127.0.0.1:10025 ESTABLISHED 2202/amavisd (ch1-a
    tcp6 0 0 ::1:10024 :::* LISTEN 2201/amavisd (maste
    [root@mailserver ~]#

    The complete netstat -ntap is in my first post.
     
  4. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    sorry, not in the master.cf. postfix uses 10025 and 10027 while amavis uses 10024 and 10026. This is defined in 50-user:

    $inet_socket_port = [10024,10026];
    $forward_method = 'smtp:127.0.0.1:*';
    $notify_method = 'smtp:127.0.0.1:*';
    $interface_policy{'10026'} = 'ORIGINATING';
    $policy_bank{'ORIGINATING'} = {
    originating => 1,
    smtpd_discard_ehlo_keywords => ['8BITMIME'],
    };
     
    Cris Kolkman likes this.
  5. Cris Kolkman

    Cris Kolkman Member

    Thank you Florian.
    This is what I find in my amavisd.conf:
    [root@mailserver ~]# cat /etc/amavisd/amavisd.conf | grep inet_socket_port
    # option(s) -p overrides $inet_socket_port and $unix_socketname
    $inet_socket_port = 10024; # listen on this local TCP port(s)
    # $inet_socket_port = [10024,10026]; # listen on multiple TCP ports

    Seems that amavisd is not configured to use port 10026 but only 10024.
    Really strange because this didn't happen before.
    I commented the first and uncommented the second so it listens to both, think it's solved now, I'll keep an eye out.
     
  6. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    Did you choose reconfigure services during the upgrade?
     
  7. Cris Kolkman

    Cris Kolkman Member

    Yes I did reconfigure them, you think that's the problem? (Can't remember I edited that line in amavisd.conf before I upgraded ISPConfig though)
     
  8. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    Maybe you have another amavis-config somewhere on your system and the updated uses this config. ARe you running centos?
     
  9. Cris Kolkman

    Cris Kolkman Member

    Hmmm sorry for the late reply.
    There are 2 amavisd.conf files on the server
    1. /etc/amavisd.conf
    2. /etc/amavisd/amavisd.conf

    It seems like it's using number 2 though.

    Yes it's running on CentOS.
     
  10. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    CentOS changed the location for the amvis-confg a while ago but they did not remove the old file. But this depends on you OS-Version. Try to rename /etc/amavisd.conf and run ispconfig-update again and choose reconfigure services.
     

Share This Page