Can't send or receive emails

Discussion in 'General' started by Aligator12, Jul 22, 2015.

  1. Aligator12

    Aligator12 New Member

    Hello,
    I recently updated ISPconfig to the latest version and ever since I updated, I am not able to send or receive emails. Every time I attempt to send an email I receive this error message"Diagnostic-Code: X-Postfix; mail transport unavailable". I am running the latest version of ubuntu on a dedicated server.

    Thanks in advance,
    Ali
     
  2. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    Maybe you can show some lines from mail.log when you try to send a mail? And check, that amavis and dovecot are running.
     
  3. Aligator12

    Aligator12 New Member

    Here are some lines that might help from mail.log

    Code:
    
    2 20:56:30 server1 postfix/qmgr[20579]: A86B750C047F: from=<[email protected]>, size=1847, nrcpt=1 (queue active)
    Jul 22 20:56:30 server1 postfix/qmgr[20579]: warning: connect to transport private/amavis: No such file or directory
    Jul 22 20:56:30 server1 postfix/error[22636]: A86B750C047F: to=<[email protected]>, relay=none, delay=273631, delays=273631/0.01/0/0.05, dsn=4.3.0, status=deferred (mail transport unavailable)
    Jul 22 20:56:50 server1 dovecot: imap(ali@domaincom): Connection closed in=43 out=875
    
    
    P.S I replaced the real domain with domain.com

    Both Dovecot and Amavis are running as well
     
  4. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    And what are the settings for the amavis-service in postfix master.cf? I use
    Code:
    amavis unix - - - - 10 smtp
        -o smtp_data_done_timeout=1200
        -o smtp_send_xforward_command=yes
        -o disable_dns_lookups=yes
    
    and content_filter = amavis:[127.0.0.1]:10024 in the main.cf
     
  5. Aligator12

    Aligator12 New Member

    Master.cf
    Code:
    mailman   unix  -       n       n       -       -       pipe
    
      flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
    
      ${nexthop} ${user}
    
    
    
    smtp-amavis     unix    -       -       -       -       2       smtp
    
            -o smtp_data_done_timeout=1200
    
            -o smtp_send_xforward_command=yes
    
            -o disable_dns_lookups=yes
    
            -o max_use=20
    
    
    
    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_delay_reject=no
    
            -o smtpd_client_restrictions=permit_mynetworks,reject
    
            -o smtpd_helo_restrictions=
    
            -o smtpd_sender_restrictions=
    
            -o smtpd_recipient_restrictions=permit_mynetworks,reject
    
            -o smtpd_data_restrictions=reject_unauth_pipelining
    
            -o smtpd_end_of_data_restrictions=
    
            -o mynetworks=127.0.0.0/8
    
            -o smtpd_error_sleep_time=0
    
            -o smtpd_soft_error_limit=1001
    
            -o smtpd_hard_error_limit=1000
    
            -o smtpd_client_connection_count_limit=0
    
            -o smtpd_client_connection_rate_limit=0
    
            -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks
    
            -o content_filter=
    
            -o receive_override_options=no_header_body_checks
    
    dovecot   unix  -       n       n       -       -       pipe
    
      flags=DROhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop}
    
    
    The content_filter = amavis:[127.0.0.1]:10024 in the main.cf is commented out
     
  6. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    ISPconfig adds content_filter = amavis:[127.0.0.1]:10024 to the main.cf.
    smtp-amavis in your master.cf should be amavis.
    Did you run reconfigure services during the update?
     
  7. Aligator12

    Aligator12 New Member

    Yes, twice.

    Should i try once more?
     
  8. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    No. Which OS are you running? And can you post your master.cf an main.cf?
     
  9. Aligator12

    Aligator12 New Member

    Ubuntu 14.04.2
    Master.cf

    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
    #2525      inet  n       -       n       -       -       smtpd -o smtpd_recipient_restrictions=$smtpd_recipient_restrictions_mailfilter
    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 vmail ${extension} ${recipient} ${user} ${nexthop} ${sender}
    #
    # 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}
    
    smtp-amavis     unix    -       -       -       -       2       smtp
            -o smtp_data_done_timeout=1200
            -o smtp_send_xforward_command=yes
            -o disable_dns_lookups=yes
            -o max_use=20
    
    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_delay_reject=no
            -o smtpd_client_restrictions=permit_mynetworks,reject
            -o smtpd_helo_restrictions=
            -o smtpd_sender_restrictions=
            -o smtpd_recipient_restrictions=permit_mynetworks,reject
            -o smtpd_data_restrictions=reject_unauth_pipelining
            -o smtpd_end_of_data_restrictions=
            -o mynetworks=127.0.0.0/8
            -o smtpd_error_sleep_time=0
            -o smtpd_soft_error_limit=1001
            -o smtpd_hard_error_limit=1000
            -o smtpd_client_connection_count_limit=0
            -o smtpd_client_connection_rate_limit=0
            -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks
             -o content_filter=
             -o receive_override_options=no_header_body_checks
    dovecot   unix  -       n       n       -       -       pipe
      flags=DROhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop}
    
    
    Main.cf
    Code:
    # Network/Connections
    myhostname = server1.xxx.com
    myorigin = /etc/mailname
    mydestination = server1.xxx.com, localhost, localhost.localdomain
    relayhost = 
    mynetworks = 127.0.0.0/8 [::1]/128
    inet_interfaces = all
    default_destination_concurrency_limit = 2
    
    # Databases
    alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
    alias_database = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
    
    # SASL / SMTP authentication
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_authenticated_header = yes
    smtpd_sasl_local_domain = 
    smtpd_sasl_path = private/auth
    smtpd_sasl_type = dovecot
    broken_sasl_auth_clients = yes
    
    # TLS parameters
    smtpd_tls_cert_file = /etc/postfix/smtpd.cert
    smtpd_tls_key_file = /etc/postfix/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
    
    # Security/Relay
    smtpd_delay_reject = yes
    smtpd_helo_restrictions = reject_invalid_hostname
    smtpd_sender_restrictions = check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf
    
    # Mailbox/Message
    home_mailbox = Maildir/
    mailbox_command = procmail -a "$EXTENSION"
    mailbox_size_limit = 0
    message_size_limit = 104857600
    unknown_local_recipient_reject_code = 550
    recipient_delimiter = +
    
    # misc
    biff = no
    allow_percent_hack = no
    append_at_myorigin = no
    append_dot_mydomain = no
    swap_bangpath = no
    readme_directory = /usr/share/doc/postfix
    inet_protocols = all
    smtpd_sasl_security_options = noanonymous
    smtp_tls_security_level = may
    smtpd_tls_security_level = may
    smtpd_tls_auth_only = no
    smtp_tls_note_starttls_offer = yes
    smtpd_tls_CAfile = /etc/ssl/certs/cacert.pem
    smtpd_tls_loglevel = 1
    smtpd_tls_received_header = yes
    smtpd_tls_session_cache_timeout = 3600s
    tls_random_source = dev:/dev/urandom
    
    
    #content_filter = amavis:[127.0.0.1]:10024
    virtual_alias_domains = 
    virtual_alias_maps = hash:/var/lib/mailman/data/virtual-mailman, proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, proxy:mysql:/etc/postfix/mysql-virtual_email2email.cf
    virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
    virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    virtual_mailbox_base = /var/vmail
    virtual_uid_maps = static:5000
    virtual_gid_maps = static:5000
    transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
    relay_domains = mysql:/etc/postfix/mysql-virtual_relaydomains.cf
    relay_recipient_maps = mysql:/etc/postfix/mysql-virtual_relayrecipientmaps.cf
    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
    smtpd_client_restrictions = check_client_access mysql:/etc/postfix/mysql-virtual_client.cf
    smtpd_client_message_rate_limit = 100
    maildrop_destination_concurrency_limit = 1
    maildrop_destination_recipient_limit = 1
    virtual_transport = dovecot
    header_checks = regexp:/etc/postfix/header_checks
    mime_header_checks = regexp:/etc/postfix/mime_header_checks
    nested_header_checks = regexp:/etc/postfix/nested_header_checks
    body_checks = regexp:/etc/postfix/body_checks
    owner_request_special = no
    smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
    smtpd_tls_protocols = !SSLv2,!SSLv3
    smtp_tls_protocols = !SSLv2,!SSLv3
    dovecot_destination_recipient_limit = 1
    #receive_override_options = no_address_mappings
    html_directory = /usr/share/doc/postfix/html
    content_filter = amavis:[127.0.0.1]:10024
    receive_override_options = no_address_mappings
    
    
     
  10. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    Your configs are not from a normal ispconfig setup/update.
    In the main.cf use content_filter = smtp-amavis:[127.0.0.1]:10024
    In the master.cf change at least the flags for DOvecot to DROhu user=vmail:vmail argv=/usr/lib/dovecot/dovecot-deliver -f ${sender} -d ${user}@${nexthop}
    And make sure, that amavis listens on Port 10024 (netstat -tanp|grep 10024).
     
  11. Aligator12

    Aligator12 New Member

    I followed your instructions and then tried to send an email. The email was successfully sent, but unfortunately never received. I sent it to a gmail email
     
  12. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    Did you see any errors in the mail.log during the transfer to gmail? Have you check the spam-folder, too?
     
  13. Aligator12

    Aligator12 New Member

    I checked /var/log/mail.log and Found no error messages, and checked the spam folder
     
  14. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    IF the mail was sucessfull delivered to google, you should ask google.
     
  15. Aligator12

    Aligator12 New Member

    I just attempted to send mail from the gmail account to the server I have not received it
     
  16. Aligator12

    Aligator12 New Member

    I just restarted postfix and attempted to send/recieve emails. I checked the logs and found this error:
    Code:
    Jul 23 15:40:54 server1 postfix/smtpd[8789]: warning: hostname hosted-by.hostgrad.ru does not resolve to address 185.40.4.32: Name or service not known
    
    Jul 23 15:40:54 server1 postfix/smtpd[8789]: connect from unknown[185.40.4.32]
    
    Jul 23 15:40:57 server1 postfix/smtpd[8789]: warning: unknown[185.40.4.32]: SASL LOGIN authentication failed: UGFzc3dvcmQ6
    
    Jul 23 15:40:57 server1 postfix/smtpd[8789]: lost connection after AUTH from unknown[185.40.4.32]
    
    Jul 23 15:40:57 server1 postfix/smtpd[8789]: disconnect from unknown[185.40.4.32]
    
     
  17. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    From time to time someone tries to connect to your server... Check for connects from gmail in your log. And make sure, that your port 25 is open an reachable from outside.
     
  18. Aligator12

    Aligator12 New Member

    Here is the full error log, it seems to have also just generated the private/amvis error once more
    Code:
    Jul 23 15:40:12 server1 dovecot: imap-login: Login: user=<ali@[email protected]>, method=PLAIN, rip=, lip=85.25.185.197, mpid=8828, TLS, session=<TqrSBosb2gAu6Ss/>
    
    Jul 23 15:40:23 server1 postfix/smtpd[8691]: connect from unknown[]
    
    Jul 23 15:40:23 server1 postfix/smtpd[8691]: Anonymous TLS connection established from unknown[]: TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)
    
    Jul 23 15:40:23 server1 postfix/smtpd[8691]: 8F93450C1698: client=unknown[46.233.43.63], sasl_method=PLAIN, sasl_username=ali@[email protected]
    
    Jul 23 15:40:23 server1 postfix/cleanup[8700]: 8F93450C1698: message-id=<[email protected]>
    
    Jul 23 15:40:23 server1 postfix/qmgr[8680]: 8F93450C1698: from=<ali@[email protected]>, size=1610, nrcpt=1 (queue active)
    
    Jul 23 15:40:23 server1 postfix/qmgr[8680]: warning: connect to transport private/amavis: No such file or directory
    
    Jul 23 15:40:23 server1 postfix/error[8682]: 8F93450C1698: to=<a.youssef16@[email protected]>, relay=none, delay=0.24, delays=0.21/0/0/0.03, dsn=4.3.0, status=deferred (mail transport unavailable)
    
    Jul 23 15:40:23 server1 postfix/smtpd[8691]: disconnect from unknown[46.233.43.63]
    
    Jul 23 15:40:24 server1 dovecot: imap-login: Login: user=<[email protected]>, method=PLAIN, rip=4, lip=85.25.185.197, mpid=8830, TLS, session=<DEKNB4sb3QAu6Ss/>
    
    Jul 23 15:40:33 server1 dovecot: imap([email protected]): Connection closed in=66 out=821
    
    Jul 23 15:40:33 server1 dovecot: imap([email protected]): Connection closed in=2873 out=20520
    
    Jul 23 15:40:50 server1 dovecot: [email protected]): Connection closed in=43 out=875
    
    Jul 23 15:40:51 server1 dovecot: imap-login: Login: [email protected]>, method=PLAIN, rip=3, lip=85.25.185.197, mpid=8833, TLS, session=<DEAhCYsb8QAu6Ss/>
    
    Jul 23 15:40:51 server1 dovecot: imap-login: Login: user=<[email protected]>, method=PLAIN, rip=46.233.43.63, lip=85.25.185.197, mpid=8834, TLS, session=<8GwhCYsb8AAu6Ss/>
    
    Jul 23 15:40:54 server1 postfix/smtpd[8789]: warning: hostname hosted-by.hostgrad.ru does not resolve to address 185.40.4.32: Name or service not known
    
    Jul 23 15:40:54 server1 postfix/smtpd[8789]: connect from unknown[185.40.4.32]
    
    Jul 23 15:40:57 server1 postfix/smtpd[8789]: warning: unknown[185.40.4.32]: SASL LOGIN authentication failed: UGFzc3dvcmQ6
    
    Jul 23 15:40:57 server1 postfix/smtpd[8789]: lost connection after AUTH from unknown[185.40.4.32]
    
    Jul 23 15:40:57 server1 postfix/smtpd[8789]: disconnect from unknown[185.40.4.32]
    
    Jul 23 15:40:59 server1 dovecot: imap([email protected]: Connection closed in=177 out=2224
    
    Jul 23 15:41:12 server1 dovecot: imap-login: Login: user=<[email protected]>, method=PLAIN, rip=46.233.43.63, lip=85.25.185.197, mpid=8845, TLS, session=<hztnCosbCAAu6Ss/>
    
    Jul 23 15:41:21 server1 dovecot: imap([email protected]): Connection closed in=177 out=2224
    
    
    
     
  19. Aligator12

    Aligator12 New Member

    Port 25 is opened
    Code:
    iptables -I INPUT -p tcp -m tcp --dport 25 -j ACCEPT
    
     
  20. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    Is the entry related to a mail before you changed the configs?
    See Post #10 - if you play around with the configs, you can break the mailflow. Is there any reasons why you changed the configs?
     

Share This Page