I have an email server configured with multiple-instance of sendmail running each on different IPv4 and IPv6 addresses.
Everything is running smooth until a point where for some domains/emails (apparently random) sendmail try to send the email from the IPv6 address instead of the IPv4 and I begin to receive messages like:

What I observed, but I'm not sure that this is the issue, the MX record for the bad-domain is a CNAME instead of direct A or AAAA record.

I'm using Sendmail 8.14.5 on Fedora 16 all the IP's are statically configured (IPv4 + IPv6)
If the base issue can't be solved there is a way to instruct sendmail to use only IPv4 for a list of specified domains ?

I edited the Question to include a part from the config file.
–
szjozsefFeb 24 '13 at 20:30

Yes. Is working perfectly for a few hours sending hundred of emails, but after a while maybe because of some strange destionation address, begins to try to send from IPv6 to IPv4 destinations....
–
szjozsefFeb 24 '13 at 20:51

It seems the issue is with non-RFC compliant domains which has MX servers which resolves to CNAME records instead of A records. An example domain: orange.net, their MX records is: smtp-in.orange.net which resolves to : CNAME mail-in.freeserve.com which resolves to an IP address. More example domains: donpac.ru, montevideo.com.uy
–
szjozsefFeb 24 '13 at 21:00

This is my question also, respectively is there any method to force the delivery in IPv4 for this kind of domains ?
–
szjozsefFeb 24 '13 at 21:20

None of those MX records/CNAME's end up with IPv6 addresses; they're all IPv4. So my best guess is.. obscure Sendmail bug?
–
Michael Hampton♦Feb 24 '13 at 21:21

1 Answer
1

Whilst the comments above seem to suggest that this isn't a v4-by-domain issue, I had cause to need to do exactly what you describe, today, and found this question whilst searching.

The method I found to force v4 delivery on a domain-by-domain basis is to enable mailertable, by having

FEATURE(`mailertable')

in my sendmail.mc (if it's already there, you don't need to add it again). Then I force v4-based delivery by overriding the DNS And instructing delivery to go to a v4 address in the mailertable file; this is from /etc/mail/mailertable:

.example.com esmtp:[260.240.18.38]
example.com esmtp:[260.240.18.38]

I don't normally redact domain names, but I don't wish to embarrass the colleagues who have wrongly implemented smtp-over-ipv6, and thus need me to force delivery over v4. The IP address is obviously false, also; but in production it's the v4 address of their primary MX, taken from the DNS.