SMTP Callouts

After doing several rounds of mop-ups after moving all the mailing lists from gmane.org to gmane-mx.org, I was wondering whether there were any way of checking whether a mailing list is dead for sure or not (mostly to see what percentage had been ported), and… of course there isn’t.

But you can use SMTP callouts to do a somewhat inaccurate check. If you don’t know what that it, it’s this:

You just say MAIL FROM and RCPT TO to the mail server, and it’ll say whether that looks okidoke or not, without delivering any mail to the victim I mean recipient.

The problems are, of course, manifold, and you really shouldn’t do this unless you have at least some handle on the possible repercussions, because SMTP is a war zone. Spammers try to send you spam, and everybody else tries to make that as difficult as possible.

But I wrote a little Emacs Lisp library for it, and put it on Microsoft Github.

Basic usage notes:

Some MTAs will reject the email if the host you’re running this on isn’t listed in the SPF records for the “MAIL FROM” address. In that case, you can add the host you’re running this on to the SPF record for that address:

v=spf1 mx a […] ip4:172.217.20.46 -all

Some MTAs will respond with a “451” code, which means “send the mail again later”, and this is usually because greylisting is in effect. It may or may not have checked whether the recipient exists first. Some MTAs respond with a “451” even if they never accept mail for that address. This library counts “451” as a failure, but you may not want to.

Some MTAs will say they accepts mail to all recipients, but then do the “real” check after data has been sent (and the MTA checks whether the contents look like spam or the like).

The actions this function takes may remind some MTAs of actions spammers take, and you may end up in RBLs as a suspected spammer. This is very much the case if the address you’re checking doesn’t actually exist, as people feed random delivery attempts to the spam-fighting RBLs, even if the addresses in question have, at one point in the past, been valid.

So I’m running the gmane.conf checker on a host that’s not my MTA at all, because I assume that it’ll be “burned” once I’m done checking.

Fun!

Leave a Reply