System Administration & Network Administration
ubuntu email postfix domain alias
Updated Wed, 31 Aug 2022 05:48:11 GMT

postfix loops back to myself email issue (was working before apt upgrade Ubuntu)

Everything was working normal till apt upgrade on Ubuntu 20.04 LTS, don't even remember what was upgraded, just routine, didn't change any config...

I really tried to fix, searched, but I don't know what to do...


    Jun  9 23:47:40 newyork postfix/smtp[23810]: 18FB52F0FE3: 
    delay=0.01, delays=0/0/0/0, dsn=5.4.6, 
    status=bounced (mail for loops back to myself

The DNS seems OK, was working fine.

enter image description here


    # See /usr/share/postfix/ 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 = no
    # See -- default to 2 on
    # fresh installs.
    compatibility_level = 2
    # TLS parameters
    smtpd_tls_security_level = may
    smtp_tls_security_level = may
    smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
    smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
    myorigin = /etc/mailname
    relayhost = 
    mynetworks = [::ffff:]/104 [::1]/128
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    inet_protocols = all
    sender_bcc_maps = hash:/etc/postfix/bcc
    sender_dependent_default_transport_maps = hash:/etc/postfix/dependent
    mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
    home_mailbox = Maildir/
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_security_options = noanonymous
    broken_sasl_auth_clients = yes
    smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
    allow_percent_hack = no
    tls_server_sni_maps = hash:/etc/postfix/sni_map
    milter_default_action = accept
    smtpd_milters = inet:localhost:8891
    non_smtpd_milters = inet:localhost:8891
    # new config working
    mydestination = $myhostname, localhost.$mydomain, $mydomain,
    alias_maps = hash:/etc/postfix/aliases
    alias_database = hash:/etc/postfix/aliases
    #virtual_alias_maps = hash:/etc/postfix/virtual
    #virtual_alias_domains = hash:/etc/postfix/virtual
    message_size_limit = 32500000
    smtputf8_enable = no

The alias_maps



The mydestination has but not Therefore, Postfix thinks this is outside of the local systems and tries to deliver it using the MX 1 record, which resolves to the local loopback.

I guess it was probably working before for the reason was either in $myhostname or $mydomain which has for an unknown reason changed during the update.

Comments (1)

  • +0 – So simple, crazy, it works! Thank u — Jun 11, 2022 at 02:25  

External Links

External links referenced by this document: