I've been a happy courier user for almost 2 years, but one little thing that always has been bugging me on the administration side, is the way courier deals with invalid MX records pointing to IP addresses.
Yes, I'm totally aware that the domain with broken MX records is at fault, but telling this reason to an unhappy user won't solve the problem, and you can't really argue against their pragmatic approach: "I send it from hotmail, yahoo or any of your competitors, and it worked fine".
So, our only choice as sysadmins is to add static routes in esmtproutes, apologize to our user, try to convince him that it's not our fault, and send a mail to the postmaster of that domain, asking them to please fix their DNS. As a consequence, we end with a rather big esmtproutes file, a user questioning about the quality of our service and a remote sysadmin asking for our support to fix their problem (in the best case, since the vast majority, won't give a damn).
I'm not against this policy on the case of MX pointing to CNAMEs since this is more problematic, imposes some technical overhead and is not as frequent as the other problem (at least in my case). But I find a little "extreme" that courier will fail the message even when valid, first choice MX servers are available, but a secondary or lower priority bad MX record is found.
Recently I decided to try the latest 0.43 version. For my surprise, I
noticed that Sam's approach to the MX problem has changed a bit. I
remember that the first versions I tried wouldn't deliver messages to
simple hostnames (Sam's answer to that request was that something without valid MX records wasn't a valid e-mail address),
but it seems that recent versions don't have a problem with that. I
didn't notice since I carry my big esmtproutes as I upgrade my installation.
Well, to finish this lengthy read, I made some minor modifications in order to avoid the infamous "This domain's MX violates RFC 1035" messages. I'm sending the diff files for your review. If anyone is interested, please give it a try, if you find a correction to this patch, please share it.
I would prefer Sam to produce an official patch, and give us the choice to perform this checks or no. "BE_A_MX_WHORE" sounds like a good name for the controlling env var I think ;-)
--- courier/module.esmtp/esmtpclient.c.orig 2003-01-04 23:06:08.000000000 -0500
+++ courier/module.esmtp/esmtpclient.c 2003-09-19 18:19:33.000000000 -0500
@@ -391,14 +391,6 @@
continue;
rfc1035_ntoa(&addr, buf);
- if (strcmp(buf, p->hostname) == 0)
- {
- hard_error(del, ctf,
- "This domain's DNS violates RFC 1035.");
- rfc1035_mxlist_free(mxlist);
- return;
- }
-
if (!q && !static_route &&
(config_islocal(p->hostname, 0)
|| isloopback(buf)))--- courier/submit.C.orig 2003-09-07 15:38:33.000000000 -0500
+++ courier/submit.C 2003-09-19 17:43:04.000000000 -0500
@@ -692,8 +692,6 @@
continue;
rfc1035_ntoa(&addr, buf);
- if (strcmp(buf, p->hostname) == 0)
- break;
if (bofh_chkbadmx(buf))
{
