One of my company's mail servers got blacklisted by SpamCop last week, which led to our learning a new mail server configuration tweak that's needed in today's spam infested world. We do "e-marketing" mailings, but these are mostly sent to people who specifically sign up for them on corporate web sites - our cients tend to the big and bad-publicity/legal action averse, so everything tends to be very strictly above board. But it turned out the servers we use for this weren't blacklisted, it was the one we use for regular user emails to/from our staff.
We got blacklisted for 48 hours based on a "spamtrap"; an email coming from one of our servers was sent to an email account set up by SpamCop strictly to detect unsolicited mail. The idea is that the spamtrap email address is never given out in a context that would attract legitimate, solicited email. Unfortunately SpamCop is very tight with details on their processes for spamtrap addresses, and there is a lot of variation in how such addresses can be managed.
The strictest spamtrap policy would be simply to set up an address on a server, but never publish it in any way. However some spamtrappers might carefully leak the address in certain controlled ways, for example putting it on an HTML page somewhere for address harvesting crawlers to find, or maybe even using it to send an email to a known address-list seller knowing they'll add it to their lists.
A potential problem with all of these is that spammers and email worms tend to forge email addresses and the sent-from lines that track an email's progress through the Net, and these days they use legitimate addresses and servers. So if they pick your address or your email server and use it in an email to a spamtrap, you can potentially end up on a blacklist.
As it turns out, SpamCop seems to avoid falling for this. The trick that got us blacklisted was actually more subtle, and is a side effect of collateral spam. Collatoral spam is the flood of bounces, "our system detected a virus in your message" alerts, and other useless crap that gets sent to an address that is used as a patsy by the spammers and email worms. If a spamtrap address is used as a patsy address in a spam or worm that is sent to your system, if your system automatically sends a bounce or "you sent us a virus" message, you'll be blacklisted.
At first glance, this is a shitty thing to do in the case of bounces. Mail servers that automatically send "you have a virus" emails to addresses that have been forged in incoming emails deserve to be slammed, they serve no purpose other than to help these people spread chaos to wider audience. My own mail server has filters that refuse to accept delivery of messages that look like a virus alert, with a message explaining why this is stupid.
But bounces are a necessary part of email transportation, in fact they're required by email standards, so at first SpamCop's policy looks like it punishes you for complying with the standards. As it turns out though, there are two ways to bounce mails.
The old way is to take delivery of an email and close the SMTP connection before checking whether the email is addressed to a legitimate user. If not, a new email is created and sent to the appropriate headers of the received email. This has become a Bad Thing, because it means you send a bounce to a potentially (95%+ of the time these days) forged address, not to the original sender; this is collatoral spam.
The new way (probably not new as a configuration option, but certainly new as a "best practice") is to check the address and reject it during the SMTP connection. This tells the server actually attempting to deliver the mail to you that you don't want it, so nobody is involved who wasn't already a part of sending the invalid email. The original sender is still notified that the address they tried to send to doesn't exist, they're just notified by the other email server.
There are a few drawbacks. It used to be considered bad practice to give immediate feedback during SMTP as to whether an address exists at your server. I was taught early on that a mail server should disable the VRFY command, which asks "does this user exist"? The reason being, a script can connect to your mail server and randomly try different addresses in the hopes of discovering a working address to add to a spam-list. The new fix makes it pretty easy to do this, but it's pretty clear that these days most spammers won't bother to see if an address is legit, they'll mail to anything. (Spammers these days just don't have the class that the spammers did in the romantic old days, do they?)
Another problem is with mail servers that actually don't know what addresses are legitimate, such as those providing an email domain relay service, or acting as a gateway into some more complicated system. If you use a Unix mail server on the front end to block spam, and then deliver to an internal Exchange server, you may not want to have to keep user addresses synchronized. But if you don't, you're in danger of getting your mail server blacklisted for sending collatoral spam.
Ugly, ugly, ugly.
So how can you see which way your mail server is configured? Use your favorite terminal program to have this conversation:
kief@icarus:~$ telnet smtp.my.com 25
Trying 192.168.1.10...
Connected to smtp.my.com.
Escape character is '^]'.
220 smtp.my.com ESMTP Postfix
HELO icarus
250 smtp.my.com
MAIL FROM: myaddress@my.com
250 Ok
RCPT TO: nosuchaddress@my.com
550 : Recipient address rejected: User unknown in virtual alias table
quit
221 Bye
Connection closed by foreign host.
The above conversation means you're rejecting it right away. If it accepts the recipient, either that recipient exists, or the mail server is going to send a bounce to whatever address you enter in the Sender or From header in the body, if you continue the conversation.
Alternately, if your mail server is the same one used for SMTP delivery by your mail client, you can just use your client to create a message to a bogus address at your domain and try to send it, but this test depends on your client and configuration.