2

My machine (CentOS, sendmail-8.14.7-5.el7) accepts emails from machines and forwards all of them to my smarthost my-smarthost.mydomain.com, which in turn has several dynamic MX-records). Local mail stays local (using the alias-file).

sendmail.mc:
define(`SMART_HOST', `smtp:my-smarthost.mydomain.com')dnl

Today I noticed a problem:

# mailq
        /var/spool/mqueue (1 request)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
02AG1YBC023172     1239 Tue Mar 10 17:01 <sender@some-domain.com>
      8BITMIME   (host map: lookup (non-domain.com): deferred)
                     <john.doe@non-domain.com>

# sendmail -v -q
Running /var/spool/mqueue/02AG1YBC023172 (sequence 1 of 1)
non-domain.com: Name server timeout
<john.doe@non-domain.com>... Transient parse error -- message queued for future delivery

Why does sendmail try to dns lookup the addresses inside the mails? I thought it just forwards everything non-local to the smarthost!

I tried to use the trick to disable DNS-lookup with

define(`confSERVICE_SWITCH_FILE',`/etc/mail/service.switch')dnl

and so on, but there is a problem with that: This also disables the MX-search for the smarthost! So the dynamic MX-records for my smarthost are no longer found/used!

Any ideas how to stop sendmail from doing anything except relaying to the smarthost?

  • How do you define non-local in your rules? If you are using an IP (or an IP, fqdn mixture) then `sendmail might need to resolve to evaluate the rule. – Eduardo Trápani Mar 10 '20 at 20:49

1 Answers1

2

Consider using FEATURE(nocanonify)

nocanonify Don't pass addresses to $[ ... $] for canonification by default, i.e., host/domain names are considered canonical, except for unqualified names, which must not be used in this mode (violation of the standard). […]

It should stop sendmail from asking DNS about domains in header addresses.

AnFi
  • 1,546
  • 1
    Would you consider adding some words of explanation on why and how this solves the problem? Link-only-answers are often considered not so helpful and tend to get deleted ... – AdminBee Mar 11 '20 at 07:38
  • No, I didn't consider it because I was not aware that this option prevents the usage of DNS lookups for checking/canonification. (Yes I didn't understand that "Don't pass addresses to $[ ... $] for canonification by default" means DNS lookups.)

    But you are correct: If I set this feature sendmail works as expected!

    – Petra Verheim Mar 11 '20 at 09:45
  • This seems to have solved an issue I was having with a server that uses a smart relay host, Thanks! – Henry van Megen Mar 15 '21 at 12:57