Search code examples
debiansendmaildebian-stretch

Use specific IPv6 address in sendmail's outgoing smtp connections


I'm using sendmail on Debian 9 (version 8.15.2-8), and I'm trying to set sendmail to use a specific IPv6 address.

The system has several IPv6 addresses, but some of the do not have PTR records, which means that if sendmail uses these addresses, they don't work as well.

I would like to set sendmail to ONLY use one of the IPv6 addresses available on the system, and ignore the others. I've tried searching on Google and on stackoverflow but couldn't find anyone with a similar issue.

In /etc/mail/sendmail.mc there are a few lines specificing which addresses to listen to:

dnl DAEMON_OPTIONS(`Family=inet6, Name=MTA-v6, Port=smtp, Addr=::')dnl

I of course replaced the :: with my specific IPv6 address (and rebuilt the config and restarted sendmail), but sendmail still ends up using one of the other IPv6 addresses available on the system.

Hope I was clear enough. Thanks!


Solution

    1. dnl in sendmail's *.mc files marks "comment to the end of line"
    2. DAEMON_OPTIONS are for incoming smtp connections.
      Use CLIENT_OPTIONS for outgoing smtp connections.