Postfix sending to A not MX

Robert Heller heller at deepsoft.com
Sat Feb 26 02:02:16 UTC 2022


At Fri, 25 Feb 2022 16:46:28 -0800 "Ubuntu user technical support,? not for general discussions" <ubuntu-users at lists.ubuntu.com> wrote:

> 
> Folks
> 
> I'm running Ubuntu server 20.04.3.  I find that Postfix is trying to 
> send mail to the destination 'a' record and obviously failing.  The 
> 'dig mx' command shows actual MX values for sonic.net.

What is the setting for myorigin in main.cf?  $mydomain or $myhostname?

If the MX record is for $mydomain, but if the message is from $myhostname, 
postfix will try to find a mx record for $myhostname and not $mydomain...


> 
> Can you advise?
> 
> The case in question is sending mail to me at my ISP from a Ubuntu 
> server located outside that ISP.  The file /var/log/mail.log shows: 
> (I have obscured real user and domain names, user 'quser', and domain 'qdomain'
> The destination of the email is also obscured, and is 'qtarget').
> 
> Feb 25 17:12:59 qserver postfix/postfix-script[564854]: starting the 
> Postfix mail system
> Feb 25 17:12:59 qserver postfix/master[564856]: daemon started -- 
> version 3.4.13, configuration /etc/postfix
> Feb 25 17:13:36 qserver postfix/pickup[564857]: 3F8F6300DB8: uid=1000 
> from=<quser>
> Feb 25 17:13:36 qserver postfix/cleanup[564944]: 3F8F6300DB8: 
> message-id=<20220226001336.3F8F6300DB8 at qserver.quser.org>
> Feb 25 17:13:36 qserver postfix/qmgr[564858]: 3F8F6300DB8: 
> from=<quser at quser.org>, size=372, nrcpt=1 (queue active)
> Feb 25 17:14:06 qserver postfix/smtp[564948]: connect to 
> sonic.net[209.204.190.64]:25: Connection timed out
> Feb 25 17:14:06 qserver postfix/smtp[564948]: 3F8F6300DB8: 
> to=<qtarget at sonic.net>, relay=none, delay=30, delays=0.02/0.02/30/0, 
> dsn=4.4.1, status=deferred (connect to sonic.net[209.204.190.64]:25: 
> Connection timed out)
> Feb 25 17:15:11 qserver postfix/pickup[564857]: 552E5300E01: uid=0 
> from=<root at qserver>
> Feb 25 17:15:11 qserver postfix/cleanup[564944]: 552E5300E01: 
> message-id=<20220226001511.552E5300E01 at qserver.quser.org>
> Feb 25 17:15:11 qserver postfix/qmgr[564858]: 552E5300E01: 
> from=<root at qserver>, size=3132, nrcpt=1 (queue active)
> Feb 25 17:15:11 qserver postfix/local[565301]: 552E5300E01: 
> to=<quser at localhost>, orig_to=<alert at quser.org>, relay=local, 
> delay=0.02, delays=0.01/0.01/0/0.01, dsn=2.0.0, status=sent 
> (delivered to command: /usr/bin/procmail -a "$EXTENSION")
> Feb 25 17:15:11 qserver postfix/qmgr[564858]: 552E5300E01: removed
> Feb 25 17:15:11 qserver postfix/postfix-script[565315]: stopping the 
> Postfix mail system
> Feb 25 17:15:11 qserver postfix/master[564856]: terminating on signal 15
> Feb 25 17:15:12 qserver postfix/postfix-script[565946]: warning: 
> unable to create missing queue directories
> Feb 25 17:15:12 qserver postfix/postfix-script[565966]: warning: 
> symlink leaves directory: /etc/postfix/./makedefs.out
> Feb 25 17:15:12 qserver postfix/postfix-script[566139]: starting the 
> Postfix mail system
> Feb 25 17:15:12 qserver postfix/master[566141]: daemon started -- 
> version 3.4.13, configuration /etc/postfix
> Feb 25 17:15:13 qserver dovecot: master: Warning: Killed with signal 
> 15 (by pid=566149 uid=0 code=kill)
> Feb 25 17:15:14 qserver dovecot: master: Dovecot v2.3.7.2 (3c910f64b) 
> starting up for imap, pop3, lmtp (core dumps disabled)
> Feb 25 17:20:12 qserver postfix/qmgr[566143]: 3F8F6300DB8: 
> from=<quser at quser.org>, size=372, nrcpt=1 (queue active)
> Feb 25 17:20:12 qserver postfix/qmgr[566143]: 17C3B3010BF: 
> from=<quser at quser.org>, size=368, nrcpt=1 (queue active)
> Feb 25 17:20:42 qserver postfix/smtp[567014]: connect to 
> sonic.net[209.204.190.64]:25: Connection timed out
> Feb 25 17:20:42 qserver postfix/smtp[567010]: connect to 
> sonic.net[209.204.190.64]:25: Connection timed out
> Feb 25 17:20:42 qserver postfix/smtp[567014]: 17C3B3010BF: 
> to=<qtarget at sonic.net>, relay=none, delay=1129, 
> delays=1099/0.02/30/0, dsn=4.4.1, status=deferred (connect to 
> sonic.net[209.204.190.64]:25: Connection timed out)
> Feb 25 17:20:42 qserver postfix/smtp[567010]: 3F8F6300DB8: 
> to=<qtarget at sonic.net>, relay=none, delay=426, delays=396/0.03/30/0, 
> dsn=4.4.1, status=deferred (connect to sonic.net[209.204.190.64]:25: 
> Connection timed out)
> 
> 
> 
> 
> 
> My /etc/postfix/main.cf is enclosed below;
> 
> 
> 
> alias_database                      = hash:/etc/aliases
> alias_maps                          = hash:/etc/aliases
> append_dot_mydomain                 = no
> biff                                = no
> command_directory                   = /usr/sbin
> compatibility_level                 = 2
> data_directory                      = /var/lib/postfix
> debug_peer_level                    = 2
> debugger_command                    = 
> PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
>     ddd $daemon_directory/$process_name $process_id & sleep 5
> default_privs                       = nobody
> disable_dns_lookups                 = yes
> home_mailbox                        = Maildir/
> inet_interfaces                     = all
> inet_protocols                      = ipv4
> local_recipient_maps                = proxy:unix:passwd.byname $alias_maps
> mail_owner                          = postfix
> mailbox_command                     = /usr/bin/procmail -a "$EXTENSION"
> mailbox_size_limit                  = 0
> mua_client_restrictions             = permit_sasl_authenticated, reject
> mua_helo_restrictions               = permit_mynetworks, 
> reject_non_fqdn_hostname, reject_invalid_hostname, permit
> mua_sender_restrictions             = permit_sasl_authenticated, reject
> mydestination                       = localhost.$mydomain localhost $mydomain
> mydomain                            = quser.org
> myhostname                          = qserver.quser.org
> mynetworks                          = 127.0.0.0/8 192.168.0.0/16 
> 10.0.0.0/8 172.16.0.0/12
> myorigin                            = $mydomain
> queue_directory                     = /var/spool/postfix
> readme_directory                    = no
> recipient_delimiter                 = +
> relayhost                           =
> smtp_tls_CApath                     = /etc/ssl/certs
> smtp_tls_security_level             = may
> smtp_tls_session_cache_database     = btree:${data_directory}/smtp_scache
> smtpd_banner                        = $myhostname ESMTP $mail_name (Ubuntu)
> smtpd_relay_restrictions            = permit_mynetworks 
> permit_sasl_authenticated defer_unauth_destination
> smtpd_tls_cert_file                 = /etc/ssl/certs/ssl-cert-snakeoil.pem
> smtpd_tls_key_file                  = /etc/ssl/private/ssl-cert-snakeoil.key
> smtpd_tls_security_level            = may
> unknown_local_recipient_reject_code = 550
> virtual_alias_domains               = qserver.quser.org
> virtual_alias_maps                  = hash:/etc/postfix/virtualusers
> 
> 

-- 
Robert Heller             -- Cell: 413-658-7953 GV: 978-633-5364
Deepwoods Software        -- Custom Software Services
http://www.deepsoft.com/  -- Linux Administration Services
heller at deepsoft.com       -- Webhosting Services
                                                                                                   




More information about the ubuntu-users mailing list