0

I think this question is related to this post but I feel that it's different enough to warrant a separate post.

I currently have my Sendmail server configured to send to a downstream VIP. In my sendmail.mc file, I have:

define(`SMART_HOST',`relay:[vip.example.local]')dnl

My understanding is that because the value is enclosed in brackets, sendmail will perform a DNS query and send to the A record that is returned.

I want to have sendmail query the MX record instead. What is the appropriate syntax for that?

Based on the prior post, I suspect that it should be:

define(`SMART_HOST',`vip.example.local')dnl

but I'm not sure if the RELAY: reference is needed.

1 Answer 1

2
define(`SMART_HOST',`relay:[vip.example.local]')dnl

Square brackets in above sendmail config disable looking for MX records first, sendmail goes straight to looking for A/AAAA records.

relay: prefix selects mailer sendmail uses to send to host(s) listed after prefix. SMTP based relay mailer is used by default anyway => usually relay: prefix may be skipped. Keeping it makes difference only in some "unusual" situations.
[technicalities: sendmail ignores "naked" relays with names listed in $=w, some people modify relay mailer to use it for sending to non standard port also on localhost]

So you should use vip.example.local (no square brackets, no mailer) to make sendmail look for MX records of vip.example.local and use them if present.

define(`SMART_HOST',`vip.example.local')dnl
4
  • So technically, would define(`SMART_HOST',`relay:vip.example.local')dnl work (with the relay part added)?
    – Mike B
    Jul 29, 2015 at 16:57
  • 1
    relay:vip.example.local selects relay mailer explicitly. vip.example.local selects relay mailer implicitly UNLESS other sendmail options change "default" mailer to another mailer. Sendmail configuration can be simple but sky is the limit for possible complexity :-)
    – AnFi
    Jul 29, 2015 at 18:34
  • But if I'm already using the relay mailer for the original syntax, why would I potentially not want to use it for the modified smarthost? Sorry I guess I'm not familiar with what exactly a mailer does.
    – Mike B
    Jul 29, 2015 at 18:45
  • Both versions are almost the same. There is no difference in most of typical configurations, there are subtle differences in non typical situations or configurations. I personally recommend version without relay mailer but it is a matter of preferred "style-guide". It does not achieve level "right versus wrong" difference.
    – AnFi
    Jul 29, 2015 at 19:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .