Postfix mail for example.com loops back to myself

Discussion in 'Installation/Configuration' started by twgray, Feb 11, 2014.

  1. twgray

    twgray New Member

    Just installed latest ISPConfig onto Ubuntu Server 12.04 according to "The Perfect Server - Ubuntu 12.04 LTS (Apache2, BIND, Dovecot, ISPConfig 3)". When trying to send email to my new email domain, I get the following Mail delivery System error email from my sending email provider:

    Code:
    This is the mail system at host mx-caprica.easydns.com.
    
    I'm sorry to have to inform you that your message could not
    be delivered to one or more recipients. It's attached below.
    
    For further assistance, please send mail to postmaster.
    
    If you do so, please include this problem report. You can
    delete your own text from the attached returned message.
    
    The mail system <[email protected]>: mail for frankensteins-lab.com loops back to myself
    
    Reporting-MTA: dns; mx-caprica.easydns.com
    X-Postfix-Queue-ID: C71C3B86D1
    X-Postfix-Sender: rfc822; [email protected]
    Arrival-Date: Mon, 10 Feb 2014 18:47:58 -0500 (EST)
    
    Final-Recipient: rfc822; [email protected]
    Original-Recipient: rfc822;[email protected]
    Action: failed
    Status: 5.4.6
    Diagnostic-Code: X-Postfix; mail for frankensteins-lab.com loops back to myself
    
    This is my /etc/postfix/main.cf content:

    Code:
    # See /usr/share/postfix/main.cf.dist for a commented, more complete version
    # Debian specific:  Specifying a file name will cause the first
    # line of that file to be used as the name.  The Debian default
    # is /etc/mailname.
    #myorigin = /etc/mailname
    smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
    biff = no
    # appending .domain is the MUA's job.
    append_dot_mydomain = no
    # Uncomment the next line to generate "delayed mail" warnings
    #delay_warning_time = 4h
    readme_directory = /usr/share/doc/postfix
    # 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
    # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
    # information on enabling SSL in the smtp client.
    myhostname = server1.frankensteins-lab.com
    alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
    alias_database = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
    myorigin = /etc/mailname
    mydestination = frankensteins-lab.com, localhost.localdomain, localhost
    relayhost =
    mynetworks = 127.0.0.0/8 [::1]/128
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    html_directory = /usr/share/doc/postfix/html
    virtual_alias_domains =
    virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, proxy:mysql:/etc/postfix/mysql-virtual_email2email.$
    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
    inet_protocols = all
    smtpd_sasl_auth_enable = yes
    broken_sasl_auth_clients = yes
    smtpd_sasl_authenticated_header = yes
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_recipient_access mysql:/etc/postfix/mysql-vi$
    smtpd_tls_security_level = may
    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 $virtua$
    smtpd_sender_restrictions = check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf
    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
    dovecot_destination_recipient_limit = 1
    smtpd_sasl_type = dovecot
    smtpd_sasl_path = private/auth
    content_filter = amavis:[127.0.0.1]:10024
    receive_override_options = no_address_mappings
    message_size_limit = 0
    
    And this is the ouput of postconf -n:

    Code:
    alias_database = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
    alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
    append_dot_mydomain = no
    biff = no
    body_checks = regexp:/etc/postfix/body_checks
    broken_sasl_auth_clients = yes
    config_directory = /etc/postfix
    content_filter = amavis:[127.0.0.1]:10024
    dovecot_destination_recipient_limit = 1
    header_checks = regexp:/etc/postfix/header_checks
    html_directory = /usr/share/doc/postfix/html
    inet_interfaces = all
    inet_protocols = all
    mailbox_size_limit = 0
    maildrop_destination_concurrency_limit = 1
    maildrop_destination_recipient_limit = 1
    message_size_limit = 0
    mime_header_checks = regexp:/etc/postfix/mime_header_checks
    mydestination = frankensteins-lab.com, localhost.localdomain, localhost
    myhostname = server1.frankensteins-lab.com
    mynetworks = 127.0.0.0/8 [::1]/128
    myorigin = /etc/mailname
    nested_header_checks = regexp:/etc/postfix/nested_header_checks
    owner_request_special = no
    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
    readme_directory = /usr/share/doc/postfix
    receive_override_options = no_address_mappings
    recipient_delimiter = +
    relay_domains = mysql:/etc/postfix/mysql-virtual_relaydomains.cf
    relay_recipient_maps = mysql:/etc/postfix/mysql-virtual_relayrecipientmaps.cf
    relayhost =
    smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
    smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
    smtpd_client_message_rate_limit = 100
    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
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_authenticated_header = yes
    smtpd_sasl_path = private/auth
    smtpd_sasl_type = dovecot
    smtpd_sender_restrictions = check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf
    smtpd_tls_cert_file = /etc/postfix/smtpd.cert
    smtpd_tls_key_file = /etc/postfix/smtpd.key
    smtpd_tls_security_level = may
    smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
    smtpd_use_tls = yes
    transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
    virtual_alias_domains =
    virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, proxy:mysql:/etc/postfix/mysql-virtual_email2email.cf, hash:/var/lib/mailman/data/virtual-mailman
    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
    
    Please note that, as per other googled threads, I have tried:

    mydestination = frankensteins-lab.com, localhost.localdomain, localhost

    as well as:

    mydestination = $myhostname, localhost.localdomain, localhost

    and both give the same errors. Does anyone have any further suggestions?
     
  2. srijan

    srijan New Member HowtoForge Supporter

    HI twgray,

    Please add FQDN to mydestination to the mydestination line in /etc/postfix/main.cf and restart Postfix:

    Br//
    Srijan
     
  3. twgray

    twgray New Member

    As I stated in my post, I already tried that...and just to be sure, I just tried it again...and it gives the same responder error.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The fqdn may not be listed in mydestination, this is causing this problem. Please remove it from there. You may not list a domain in mydestination on a postfix virtual user setup that shall be used for mailboxes. Then check /etc/mailname, the domain may not be listed there as well. in all 3 places: myhostname, mydestination and /etc/mailname you will have to use the hostame of the server (server1.frankensteins-lab.com) and not (frankensteins-lab.com), then restart postfix.
     
  5. twgray

    twgray New Member

    till, the fqdn is server1.frankensteins-lab.com, and myhostname, mydestination, and /etc/mailname are set to that, already.

    I have made a bit of progress...I can now send email, but the problem mentioned above still exists when I try to send email to any user at this domain. Following is the /var/log/mail.log:

    Code:
    Feb 11 12:14:42 server1 postfix/smtpd[4441]: warning: database /var/lib/mailman/data/virtual-mailman.db is older than source file /var/lib/mailman/data/virtual-mailman
    Feb 11 12:14:42 server1 postfix/smtpd[4441]: connect from mail-oa0-f41.google.com[209.85.219.41]
    Feb 11 12:14:42 server1 postfix/trivial-rewrite[4446]: warning: do not list domain frankensteins-lab.com in BOTH virtual_mailbox_domains and relay_domains
    Feb 11 12:14:42 server1 postfix/cleanup[4450]: warning: database /var/lib/mailman/data/virtual-mailman.db is older than source file /var/lib/mailman/data/virtual-mailman
    Feb 11 12:14:42 server1 postfix/smtpd[4441]: C807D481147: client=mail-oa0-f41.google.com[209.85.219.41]
    Feb 11 12:14:42 server1 postfix/cleanup[4450]: C807D481147: message-id=<[email protected]>
    Feb 11 12:14:42 server1 postfix/qmgr[3614]: C807D481147: from=<[email protected]>, size=1939, nrcpt=1 (queue active)
    Feb 11 12:14:42 server1 postfix/smtpd[4441]: disconnect from mail-oa0-f41.google.com[209.85.219.41]
    Feb 11 12:14:47 server1 postfix/smtpd[4454]: warning: database /var/lib/mailman/data/virtual-mailman.db is older than source file /var/lib/mailman/data/virtual-mailman
    Feb 11 12:14:47 server1 postfix/smtpd[4454]: connect from localhost.localdomain[127.0.0.1]
    Feb 11 12:14:47 server1 postfix/trivial-rewrite[4446]: warning: do not list domain frankensteins-lab.com in BOTH virtual_mailbox_domains and relay_domains
    Feb 11 12:14:47 server1 postfix/smtpd[4454]: 58D184817BF: client=localhost.localdomain[127.0.0.1]
    Feb 11 12:14:47 server1 postfix/cleanup[4450]: 58D184817BF: message-id=<[email protected]>
    Feb 11 12:14:47 server1 postfix/qmgr[3614]: 58D184817BF: from=<[email protected]>, size=2466, nrcpt=1 (queue active)
    Feb 11 12:14:47 server1 postfix/trivial-rewrite[4446]: warning: do not list domain frankensteins-lab.com in BOTH virtual_mailbox_domains and relay_domains
    Feb 11 12:14:47 server1 postfix/smtpd[4454]: disconnect from localhost.localdomain[127.0.0.1]
    Feb 11 12:14:47 server1 amavis[1502]: (01502-05) Passed CLEAN, [209.85.219.41] [76.183.228.176] <[email protected]> -> <[email protected]>, Message-ID: <[email protected]$
    Feb 11 12:14:47 server1 postfix/smtp[4451]: C807D481147: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=4.6, delays=0.13/0.02/0.01/4.5, dsn=2.0.0, status=sent $
    Feb 11 12:14:47 server1 postfix/qmgr[3614]: C807D481147: removed
    Feb 11 12:14:47 server1 postfix/smtpd[4441]: connect from cpe-76-183-228-176.tx.res.rr.com[76.183.228.176]
    Feb 11 12:14:47 server1 postfix/smtp[4455]: warning: host server1.frankensteins-lab.com[76.183.228.176]:25 greeted me with my own hostname server1.frankensteins-lab.com
    Feb 11 12:14:47 server1 postfix/smtp[4455]: warning: host server1.frankensteins-lab.com[76.183.228.176]:25 replied to HELO/EHLO with my own hostname server1.frankensteins-lab.com
    Feb 11 12:14:47 server1 postfix/smtp[4455]: 58D184817BF: to=<[email protected]>, relay=server1.frankensteins-lab.com[76.183.228.176]:25, delay=0.3, delays=0.02/0.02/0.25/0, dsn$
    Feb 11 12:14:47 server1 postfix/smtpd[4441]: disconnect from cpe-76-183-228-176.tx.res.rr.com[76.183.228.176]
    Feb 11 12:14:47 server1 postfix/cleanup[4450]: A73A8481856: message-id=<[email protected]>
    Feb 11 12:14:47 server1 postfix/bounce[4456]: 58D184817BF: sender non-delivery notification: A73A8481856
    Feb 11 12:14:47 server1 postfix/qmgr[3614]: A73A8481856: from=<>, size=4532, nrcpt=1 (queue active)
    Feb 11 12:14:47 server1 postfix/qmgr[3614]: 58D184817BF: removed
    Feb 11 12:14:48 server1 postfix/smtp[4455]: connect to gmail-smtp-in.l.google.com[2607:f8b0:4003:c01::1a]:25: Network is unreachable
    Feb 11 12:14:49 server1 postfix/smtp[4455]: A73A8481856: to=<[email protected]>, relay=gmail-smtp-in.l.google.com[173.194.77.27]:25, delay=1.8, delays=0.06/0/0.53/1.2, dsn=2.0.0, stat$
    Feb 11 12:14:49 server1 postfix/qmgr[3614]: A73A8481856: removed
    Feb 11 12:15:01 server1 postfix/smtpd[4441]: connect from localhost.localdomain[127.0.0.1]
    Feb 11 12:15:01 server1 postfix/smtpd[4441]: lost connection after CONNECT from localhost.localdomain[127.0.0.1]
    Feb 11 12:15:01 server1 postfix/smtpd[4441]: disconnect from localhost.localdomain[127.0.0.1]
    Feb 11 12:15:01 server1 dovecot: pop3-login: Disconnected (no auth attempts): rip=127.0.0.1, lip=127.0.0.1, secured
    Feb 11 12:15:01 server1 dovecot: imap-login: Disconnected (no auth attempts): rip=127.0.0.1, lip=127.0.0.1, secured
    
    Any further ideas?
     
  6. twgray

    twgray New Member

    OK, I've done everything I can think to do, with the exception of singing to it and my all incoming email is bounced due to "Postfix mail for example.com loops back to myself". I've made sure that /etc/mailname is set to server1.exampe.com. I've made sure that mydestination and myhostname are set to server1.example.com, as per till's recommendation, and the problem persists. Any further suggestions are appreciated!
     
  7. N3RVE

    N3RVE New Member

    For others searching for a solution to this problem, I resolved it by removing the FQDN from mydestination
    Code:
    mydestination = localhost, localhost.localdomain
     
  8. codywohlers

    codywohlers New Member

    Yes! Thank-you. This still applies (postfix 2.11.0-1ubuntu1) and solved my problem.
    To be able to forward mail with virtual aliases from my domain.com and sub.domain.com I had to do this in main.cf:
    Code:
    myhostname = server.domain.com
    myorigin = domain.com
    mydestination = localhost
    virtual_alias_domains = domain.com sub.domain.com
     

Share This Page