Even if you are an IT professional and run an email system, you could be forgiven for not being immediately aware that there is such a thing as SMTP callbacks, also referred to as callback verification. As you will see from the Wikipedia article, the feature was never widely adopted, and for all too understandable reasons.
Note: This piece is also available without trackers but classic formatting only here.
If you do run a mail system, you have probably heard about that feature's predecessor, the still-required but rarely used SMTP
VRFY
and EXPN
commands. Those commands offer a way to verify whether an address is valid and to show the component addresses that a mailing list resolves to, respectively.Back when all things inter-networking were considered experimental and it was generally thought that information should flow freely in and between those experimental networks, it was quite common for mail servers to offer
VRFY
and EXPN
service to all comers. I'm old enough to remember using
VRFY
by hand, telnet
-ing to port 25 on a mail server and running VRFY $user@$domain.$tld
commands to check whether an email address was indeed valid. I've forgotten which domains and persons were involved, but I imagine the reason why was that I wanted to contact somebody who had said something interesting in a post to a USENET news group.But networkers trying to make contact with each other were not the only ones who discovered the VRFY and EXPN commands. Soon spammers were using those commands to actively harvest actually! valid! deliverable! addresses, and by 1999 the RFC2505 best practices document recommended disabling the features altogether. After all, there would usually be some other way available to find somebody's email address (there was even a FAQ, a longish Frequently Asked Questions document with apparent USENET origins written and maintained on the subject, a copy of which can be found here).
In roughly the same time frame, somebody came up with the idea of SMTP callbacks. The idea was that all domains on the Internet need to publish the address of their mail exchangers via DNS MX (mail exchanger) records. The logical next step is then that when a piece of mail arrives over SMTP, the receiving end should be able to contact the sender domain's known mail exchanger to check that the sender address is indeed valid. If you by now hear the echoes of
VRFY
and EXPN
, you're right. There are indications that some early implementations did in fact use VRFY
for that purpose.But then the world changed, and you could not rely on VRFY being available in the post-RFC2505 world.
In the post-RFC2505 world, the other side would most likely not offer up any useful information in response to VRFY commands, and you would most likely be limited to the short interchange that the Wikipedia entry quotes,
HELO <verifier host name>
MAIL FROM:<>
RCPT TO:<the address to be tested>
QUIT
It is worth noting, as many have over the years, that the MX records only specify where a domain expects to receive mail, not where valid mail from the domain is supposed to originate. Several mechanisms to help identify valid mail senders for a domain have been devised in the intervening years, but none existed at the time SMTP callbacks were considered even remotely useful.
MAIL FROM:
part asmx42.antispamcloud.com-1503146097-testing@bsdly.com
$localhostname-$epochtime-testing
@targetdomain.$tld
(in our case, bsdly.com) appended. I had at this point totally forgotten about SMTP callbacks, but I decided to check the logs for any traces of activity involving that host. The only trace I could find in the logs was at the spamd-serving firewall in front of the bsdly.com domain's secondary mail exchanger:Aug 19 14:35:27 delilah spamd[26915]: 207.244.64.181: connected (25/24)
Aug 19 14:35:38 delilah spamd[26915]: (GREY) 207.244.64.181: <> ->
<mx42.antispamcloud.com-1503146097-testing@bsdly.com>
Aug 19 14:35:38 delilah spamd[15291]: new entry 207.244.64.181 from <>
to <mx42.antispamcloud.com-1503146097-testing@bsdly.com>, helo
mx18-12.smtp.antispamcloud.com
Aug 19 14:35:38 delilah spamd[26915]: 207.244.64.181: disconnected after
11 seconds.
But the retry never happened, and even if it had, that particular local-part would anyway have produced an "
Unknown user
" bounce. But at that point I decided to do a bit of investigation and dug out what seemed to be a reasonable point of contact for the antispamcloud.com domain and sent an email with a question about the activity.That message bounced, with the following explanation in the bounce message body:
DOMAINS@ANTISPAMCLOUD.COM
host filter10.antispamcloud.com [31.204.155.103]
SMTP error from remote mail server after end of data:
550 The sending IP (213.187.179.198) is listed on https://spamrl.com as a source of dictionary attacks.
213.187.179.198
is the IPv4 address of the primary mail exchanger for bsdly.net, bsdly.com and a few other domains under my care.
I remain unconvinced that the description of that problem is accurate, but investigation at this end can not proceed without at least some supporting evidence such as times of incidents, addresses or even networks affected.
If there is a problem at this end, it will be fixed. But that will not happen as a result of handwaving and insults. Actual evidence to support further investigation is needed.
Until verifiable evidence of some sort materializes, I will assume that your end is misinterpreting normal greylisting behavior or acting on unfounded or low-quality reports from less than competent sources.
The domain bsdly.com was one I registered some years back mainly to fend off somebody who offered to help the owner of the bsdly.net domain acquire the very similar bsdly.com domain at the price of a mere few hundred dollars.
My response was to spend something like ten dollars (or was it twenty?) to register the domain via my regular registrar. I may even have sent back a reply about trying to sell me what I already owned, but I have not bothered to dig that far back into my archives.
The domain does receive mail, but is otherwise not actively used. However, as the list of spamtraps can attest (the full list does not display in a regular browser, since some of the traps are interpreted as html tags, if you want to see it all, fetch the text file instead), others have at times tried to pass off something or other with from addresses in that domain.
But with the knowledge that this outfit's customers are believers in SMTP callbacks as a way to identify spam, here is my hypothesis on what actually happened:
On August 19th 2017, my greylist scanner identified the following new entries referencing the bsdly.com domain:
anecowuutp@bsdly.com
pkgreewaa@bsdly.com
eemioiyv@bsdly.com
keerheior@bsdly.com
mx42.antispamcloud.com-1503146097-testing@bsdly.com
vbehmonmin@bsdly.com
euiosvob@bsdly.com
otjllo@bsdly.com
akuolsymwt@bsdly.com
mx42.antispamcloud.com
was contacted by any of the roughly 5000 hosts blacklisted at bsdly.net at the time, with an attempt to deliver a message with a MAIL FROM:
of either anecowuutp@bsdly.com, pkgreewaa@bsdly.com, eemioiyv@bsdly.com or perhaps most likely keerheior@bsdly.com, which appears as a bounce-to address in the same hourly greylist dump where mx42.antispamcloud.com-1503146097-testing@bsdly.com first appears as a To: address.
1503143365
date -r
to
Sat Aug 19 13:49:25 CEST 2017
1503146138
, which translates to Sat Aug 19 14:35:38 CEST 2017
.- register attempt to deliver mail
- look up the domain stated in the MAIL FROM: or perhaps even the HELO or EHLO
- contact the domain's mail exchangers with the rump SMTP dialog quoted earlier
- with no confirmation or otherwise of anything other than the fact that the domain's mail exchangers do listen on the expected port, proceed to whatever the next step is.
- a mail system that is set up for SMTP callbacks received a request to deliver mail from keerheior@bsdly.com
- the primary mail exchanger for bsdly.com has the IPv4 address 213.187.179.198
We have no indication that the system performing the SMTP callout used any such mechanism to find an indication as to whether the communication partner was in fact in any way connected to the domain it was trying to deliver mail for.
So,
- If you are involved in selling or operating a system that behaves like the one described here and are in fact generating blacklists based on those very naive assumptions, you need to stop doing so right away.
Your mistaken assumptions help produce bad data which could lead to hard to debug problems for innocent third parties.
Or as we say in the trade, you are part of the problem. - If you are operating a system that does SMTP callbacks but doesn't do much else, you are part of a small problem and likely only inconveniencing yourself and your users.
The fossil record (aka the accumulated collection of spamtrap addresses at bsdly.net) indicates that the callback variant that includes epoch times is rare enough (approximately 100 unique hosts registered over a decade) that callback activity in total volume probably does not rise above the level of random background noise.
There may of course be callback variants that have other characteristics, and if you see a way to identify those from the data we have, I would very much like to hear from you. - If you are a customer of somebody selling antispam products, you have reason to demand an answer to just how, if at all, your antispam supplier utilizes SMTP callbacks. If they think it's a fine and current feature, you have probably been buying snake oil for years.
- If you are the developer or maintainer of mail server code that contains the SMTP callbacks feature, please remove the code. Leaving it disabled by default is not sufficient. Removing the code is the only way to make sure the misfeature will never again be a source of confusing problems.
The data this article is based on still exists and will be available for further study as long as the request comes wit a reasonable justification. I welcome comments in the comment field or via email (do factor in any possible greylist delay, though).
Any corrections or updates that I find necessary based on your responses will be appended to the article.
Update 2017-09-05: Since the article was originally published, we've seen a handful of further SMTP callback incidents. The last few we've handled by sending the following to the addresses that could be gleaned from whois on the domain name and source IP address (with
mx.nxdomain.nx
and 192.0.2.74 inserted as placeholders here to protect the ignorant):Hi,
I see from my greylist dumps that the host identifying as
mx.nxdomain.nx, IP address 192.0.2.74
is performing what looks like SMTP callbacks, with the (non-existent of course) address
mx.nxdomain.nx-1504629949-testing@bsdly.com
as the RCPT TO: address.
It is likely that this activity has been triggered by spam campaigns using made up addresses in one of our little-used domains as from:addresses.
A series of recent incidents here following the same pattern are summarized in the article
https://bsdly.blogspot.com/2017/08/twenty-plus-years-on-smtp-callbacks-are.html
Briefly, the callbacks do not work as you expect. Please read the article and then disable that misfeature. Otherwise you will be complicit in generating false positives for your SMTP blacklist.
If you have any questions or concerns, please let me know.
Yours sincerely,
Peter N. M. Hansteen
If you've received a similarly-worded notice recently, you know why and may be closer to having a sanely run mail service.Update 2017-11-02: It looks like the spamrl.com service still has customers that believe in the same claim made in the bounce messages quoted earlier in this article and perform SMTP callbacks exactly like they did when this article was first written. If you have any verifiable information on that outfit and their activities, I would very much like to hear from you.
Update 2024-10-03: Please note that the IP addresses quoted in this piece do no longer resolve to any host in any of our domains.
Actually, callback code is useful in some situations. For example, exim allows you to make a callout for the recipient, which is extremely useful in the case of a mail relay where you don't know which users exist on the backend. But I agree with you it's almost always a bad idea when used to verify the sender.
ReplyDeleteOpenBsd with i3wm is a great optiom,try it!
ReplyDeleteVery nice post, thank you for sharing
ReplyDeleteI am not entirely sure that you'd appreciate my comment, and hesitating to write it. Anyway.
ReplyDeleteYour post is a bit misguided, based on lots of guesswork and firm opinions. There are other possible chains of events where your results aren't matching the facts. Let's see some.
First, greylisting is ineffective, and it has to die!
Nice ain't it? Well, technically, it has its bright and dark sides and often causes so much trouble without the gains that it really should be exterminated. However I wouldn't write a blog post about it and definitely wouldn't give it such title since it'd only show my ignorance and opinionated approach. I live with greylisting servers around, and try to counteract their braindeadness. However, this is not my main topic, I just wanted to show _your_ approach to SAV (sender address verification).
So, first, what are you observing?
You see the part where the external server checks whether you'd accept _any_ email as valid: it tries to send you a patent nonsense address and see whether you accept it as valid or not. Either way it gets cached and you're not bothered about it for a longer while. You can defeat it by _not_ replying, then there's nothing to cache, and the checks will be repeatedly seen. (Unless the admin specifically modifies the caching to actually neg-cache non-responding and smtp-invalid hosts.) You decide how useful it is for you.
Then, as you have correctly guessed, this information is used for SAV: if the server is known to accept any garbage as valid then there's no point to go on with verification, and you won't see any of such; when the server properly rejects the rubbish the check will verify whether the sender is deliverable, and act on it.
(to be continued)
Let's see if you'd reached this point in your analysis (theoretically), what could be the reason behind SAV?
ReplyDeleteYou would guess "filtering spam". Partially, yes, since - despite your guessing - there are plenty of spam using invalid (random) senders, and plenty of once-valid senders are disabled by the original provider noticing that it's been used for spamming, so the email nicely gets rejected. I mean, in reality, not in theory (that's "fact based").
But the main reason for many people are _deliverability_. The SAV ensures one important thing: the email coming in contain a Return-path with would accept the reply, DSN, bounce, or similar.
What happens when there's no SAV, and the email gets accepted, and later it turns out that the Return-Path is bogus? Well, you have an email, which cannot be delivered to the recipient (for various reasons, including policy, full mailbox, timeouts, whatever) and cannot be delivered to the sender (since it isn't deliverable).
What then? Either you keep it forever (it's not really feasible on the long term, apart from it being completely pointless) or you detroy it, both means "you lose email".
You said you've been around for a long time. You may remember those RFCs and discussions, when people said "never, ever, EVER lose email; deliver it this way or that way, don't lose it; reliability is king". Yep. It's been a long time ago. The North still remembers. ;-)
So, yes, reliability. Greylist causes (valid) mail to be delayed or bounced, but not to be lost: greylist is not evil. SAV ensures mail not to be lost: SAV is not evil. Receiving mail, and then deleting it is evil: it's lost without a useful trace (in the world of non-responding mail relay admins). Maybe when DMARC will be universal and those detroyed mail will be traceable (which I sincerely doubt ever would happen, and it'd use resources a few magnitudes more than it'd use now), maybe then SAV would lose its ground. Until then it serves a specific purpose and while it may be your opinion to dislike it, technically you are possibly able to understand the utility of it.
(And let me point out that killing off VRFY haven't offered much gain since the same just happens by RCPT TO, so the criminals are just fine while the valid users suffer. Neither "solution" have stopped spam flowing, nor did greylist or SAV or BATV or SPF or ARC or ....)
Sidenote: discussion using this submicro comment window is extremely painful.
Sidenote2: it was rejected as "can't be longer than 4096 chars" while it's 3819.
Behind spamrl.com is Spam Experts. It is the only software that can access this list (spamrl.com is not publicly available). On top of this, if you check Spam Expert's knowledge base, they make it clear that spamrl.com is part of their commercial operations.
ReplyDeleteI am really grateful to read this article, this is nice and informative thanks for sharing.
ReplyDeleteJust a very minor note on date command and epoch time conversion: with GNU tools I would expect only "date -d @EPOCHTIMEINSECONDS" to work ... the stated "date -r SECONDS" won't generally work (only on BSD environments?). Or did I miss something?
ReplyDeleteYes, you are right that "date -r $epochtime" is a BSDism. Much of what I write here is somewhat OpenBSD-centric.
Delete