Nightmare IPv6: How to disable IPv6 in FreeBSD

Sendmail (up to 13.2 in base system) does not have an option to stop using IPv6 when sending email, but you can use pf to block IPv6 smtp traffic. Try something like this:

/etc/pf: ext_if="em0" block out quick on $ext_if inet6 proto tcp from self to any port 25

Then test it by telnet. If you see permission denied, then sendmail will use IPv4 for sure.

% telnet -6 aspmx.l.google.com 25 Trying .......... telnet: connect to address ..........: Permission denied telnet: Unable to connect to remote host
 
Sorry for reply in old thread. For sendmail 8.18.1, which is in FreeBSD 14.3 now, there's a better way to only use ipv4 for outgoing smtp connection. I put this define before MAILER in my .mc

define(`SMTP_MAILER_FLAGS', `4')
 
Back
Top