There’s really no debate that despite all efforts to combat it, spam email continues to grow and thrive on the internet. Since I host my own email server (providing accounts for myself, my family, and a few friends), I’ve watched as gargantuan volumes of unsolicited email stream in over the wire, and I’ve had to keep up to speed on the latest and greatest spamfighting techniques in order to keep our mailboxes reasonably free of the nuisance. That being said, the whole system has always felt like a fragile beast, and when my spam system fails for even a few minutes, my inbox can get buried. (For example, a component of my filters got overloaded this morning for just over six minutes, and over 50 spam emails slipped through in that period.) So, for the past year, I’ve been hunting for ways to optimize my mail setup in order to lessen the load on the spam filters, and one specific way has eluded me until this morning. Being that I’ve actively searched for this very solution for over a year and not had success until today, I figured I’d describe what I did in case anyone else is looking for the same fix.

(Really, I shouldn’t have to tell you this, but what follows is an extremely detailed, low-level description of my mail setup and the innards of a spam filtering system. It’s dorky, and you probably won’t want to read the rest unless you’ve imbibed a good deal of caffeine and know your way around sendmail.)

I figure I should start out with a description of my mail server setup, which I’d imagine is pretty similar to quite a few others out there. My mail server is a Linux box, and I’m running sendmail 8.13 and Cyrus IMAP Server as my mail transport and mail delivery agents, respectively. I run SpamAssassin as my spam filter and ClamAV as my virus scanner; sendmail interacts with both of them through milters (spamass-milter for SpamAssassin, and clamav-milter for ClamAV). I host email for about a dozen people across two dozen different domains, so I use sendmail’s virtual user functionality to map each valid email address to a mail server account.

All in all, there’s not a lot out-of-the-ordinary to this setup, but one bit of it has been both frustrating to me and the source of a tremendous load on my spam filters. Watching my log files, I saw the entire mail delivery process play out in the following sequence:

  1. a piece of email would stream in from the outside world and sendmail would accept it;
  2. sendmail would pass it off to the spam filter system using spamass-milter;
  3. the spam filter system would perform its checks and then send it back to sendmail with a spam score;

  4. sendmail would pass it off to the virus scanner using clamav-milter;
  5. the virus scanner would perform its checks and then send it back with a decision on whether any bugs were found;
  6. sendmail would pass it off to Cyrus;
  7. Cyrus would check to see who the recipient of the mail should be, and deliver it to that user’s mailbox.

While this works perfectly for valid users, I started to see a problem when an incoming email was addressed to a nonexistent user. Instead of sendmail checking the validity of the intended recipient’s email address at the very first step, my setup would happily pass the email through the entire system, and only reject it when Cyrus couldn’t find a valid recipient mailbox. And while this isn’t a huge problem if we’re talking about the occasionally-misaddressed message, today’s spammers are fond of dictionary attacks on mail hosts, and if 100 different emails came in at the same moment but only one of them was addressed to a valid user, all 100 would still be passed through the spam filters and virus scanner. (It’s like a college professor grading 100 term papers and then figuring out afterwards that only one of them was actually for the course he’s teaching.) When the load got high enough that the filters started to time out, spam would slip through to me and my users. Despite searching high and low for a solution to this for a while now, it wasn’t until today that I figured out what was going wrong. And lo and behold, it turns out that the biggest problem was with my assumptions about how sendmail behaves, and that the solution was in changing those assumptions, and then changing my virtual user setup to match what actually goes on.

When sendmail is set up with virtual user hosting, the virtusertable file holds all the information mapping email addresses to mail server accounts. (For example, there are about 40 or 50 different email addresses that all funnel into my one email inbox.) My assumption has always been that when sendmail receives a new email, it looks up the recipient email address in the virtusertable file to figure out who should get the email, and rejects it instead if the address doesn’t exist in the file. Thus, I couldn’t understand how nonexistent email addresses were getting through that first step in the processing chain, and all my searching was focused on this one point. After finally finding this discussion thread today, though, I learned that my assumption was wrong — sendmail uses the virtusertable as a supplement to other information about the validity of email addresses, and recipients who don’t show up in that file aren’t necessarily considered to be invalid. Better yet, it’s possible to declare wildcard addresses as specifically invalid in the virtusertable file, so sendmail can reject email immediately and avoid the load of scanning it for spam and viruses.

Once I added a single line to the bottom of my virtusertable file:

@queso.com     error:nouser 550 No such user

the results were exactly what I wanted; I was able to watch my logs as hundreds of invalidly-addressed messages were instantly rejected rather than shunted into the spam and virus filters. (This isn’t a hyperbole — in the 73 minutes after I made the change to the queso.com domain, 1,450 messages were rejected, or one every three seconds.) I tested the setup a bit more and then made the same change for all of the other domains I host, and now everything’s running perfectly.

So, if you host your own email server and have noticed an uptick in the load spam’s exerting on your system, you might want to take a look and see if you’re processing the incoming mail in the most efficient way. Now that my setup has been optimized, it’s only the occasional message that makes it all the way through to the spam filter stage; I’m literally seeing more than a thousand messages an hour that are rejected outright rather than forced through the filters. It’s pretty satisfying.

Comments

Well, that’s awfully handy. Should I ever be stuck running sendmail, I’ll keep that in mind.

The Qmail system on my rig needed patching so I could add a configuration file detailing which addresses, exactly, were allowed in. The SMTP session throws out anything not on that list, which has lowered the operating overhead on my server considerably. So, basically, we took different approaches to the same basic fix. Ah, I love Internet technology! *wry grin*

• Posted by: GreyDuck on Oct 19, 2006, 5:06 PM

The beauty of Unix — I run my own mail server and we don’t use any of the same packages. I use Postfix, Dovecot, and amavis.

• Posted by: Rafe on Oct 19, 2006, 10:56 PM
Please note that comments automatically close after 60 days; the comment spammers love to use the older, rarely-viewed pages to work their magic. If comments are closed and you want to let me know something, feel free to use the contact page!

slot88

vikingtoto

p>bengkulutoto

สล็อตเว็บตรง

https://www.xde.com.ph/

https://imperialvets.com/imperial-animal-hospital/contact-us/

densustoto

dewaking

slot

slot

slot

cancertoto

cancertoto

situs slot

slot

bengkulutoto

slot

toto slot

situs slot

coloktoto login

bengkulutoto

slot

babeltoto

cancertoto

babeltoto

bengkulutoto

bengkulutoto

slot88

スマスロ

malukutoto

hukumtoto

vikingtoto

viking toto

malukutoto

top1toto

tasiktoto

tasiktoto

dewaking

dewaking

situs toto

cancer toto

cancertoto

https://cashwave.live/payment-partner/

vikingtoto

https://www.mundwiler-juwelen.ch/kontakt/

piktoto

heroslot88

bengkulutoto

vikingtoto

toto

cancertoto

wiltoto

bengkulutoto

bengkulutoto

vikingtoto

https://www.joyd.my/brand/moda/

bengkulutoto

mamatogel

vespa36

vespa36

coktogel

batmantoto login

coktogel

batmantoto

hukum toto

vikingtoto

viking toto

cancertoto

top1toto

cancertoto

batmantoto.de

cancertoto

kudahoki

batmantoto login

tasiktoto

paitocambodia.name

paitochina.blog

bengkulutoto

vikingtoto

depo 5k

viking toto

SITUS SLOT ONLINE

piktoto

toto slot

kartutoto

batman toto

wisdomtoto

toto online

slot toto

situs toto

8kbetplay

slot 5k

8kbetplay

situs slot88

slot 4d

toto togel

situs toto

bandar togel

https://prediksibatmantogel4d.com/

cancertoto

cancertoto

batmantoto

top1toto

top1toto

bydplay

bydplay

citibet88

citibet88

cancertoto

top1toto

situs toto cas89

japanlotto.store

kakaktogel

bengkulutoto

piktoto

toto

cancer toto

bengkulutoto

bengkulutoto

bengkulutoto

piktoto

babeltoto

Rtp Slot Gacor

piktoto

Sbobet

Slot Qris

piktoto

Slot Gacor

Toto

hokijp68

bengkulutoto

cancer toto

piktoto

bengkulutoto

rebahin

Savefrom

slot88

slot jackpot

toto

toto

coloktoto.nl

toto

batmantoto login

https://kidneystonemelbourne.com.au/kidney-stones/

vikingtoto

toto

altartoto

toto

piktoto

jitu26

jitu26

pokemontoto

piktoto

vespa36

vespa36

cancertoto

batmantoto

batmantoto

piktoto

batmantoto

batmantoto

batmantoto

situs togel

togel online

cancer toto

vespa36

vespa36

bengkulutoto

cancertoto

slot toto

toto 4d

cancer toto

top1toto

link toto

toto wuhan

situs toto

toto macau

toto slot gacor

daftar toto

batmantoto

coloktoto login

coloktoto login

toto

malukutoto

vespa36

vespa36

jitu26

jitu26 resmi

piktoto

toto

tasiktoto

babeltoto

babeltoto

babeltoto

babeltoto

babeltoto

pokemontoto

rexonatoto

babeltoto

babeltoto

batmantoto

batmantoto

coloktoto

cancertoto

cancertoto

cancertoto

batmantoto login

toto

vespa36

pokemontoto

situs toto

coktogel login

slot gacor

slot toto

malukutoto

usahatoto

piktoto

situs toto

usahatoto

laetoto login

unsurtoto

unsurtoto

piktoto

malukutoto

top1toto

unsurtoto

malukutoto

unsurtoto

unsurtoto

toto

vespa36

vespa36 resmi

vespa36

vespa36

piktoto

link gacor

cancertoto

piktoto

link gacor

pokemontoto

rajalangit77 official

rajalangit77 togel

https://www.terangtampil.xyz/

malukutoto

top1toto

babeltoto

babeltoto

piktoto

jitu26

jitu26

vespa36

vespa36

viking toto

sesetoto

batmantoto login

bengkulutoto

vespa36

top1toto

vespa36

labirintoto

gelasjitu

balontoto

toto slot

pokemontoto

malukutoto

สล็อตเว็บตรง

https://wiltoto.cz/wap/

https://wiltoto.tw/user/

https://wiltoto.pw/register/

coktogel

coktogel

paito taiwan

coktogel

vespa36

malukutoto

vespa36

pokemontoto

cas89 login

indototo

raja88

tasiktoto

tasiktoto

coktogel

hukumtoto

cancertoto

wisdomtoto

cancertoto

cancertoto

cancertoto

cancertoto

situs toto

cancertoto

toto slot

cancertoto

cancertoto

situs gacor

slot gacor

situs slot

jitu26

jitu26

jitu26

jitu26

situs toto

babeltoto

babeltoto

vespa36

vespa36

jitu26

cancertoto

jitu26

pokemontoto

malukutoto

malukutoto

malukutoto

cancertoto

slot gacor

situs toto

toto macau

vespa36

vespa36

bengkulutoto

bengkulutoto

toto

bengkulutoto

tartoto

tartoto

tartoto

jitu26

jitu26

4DHOKI

kientoto

babeltoto

babeltoto

babeltoto

babeltoto

babeltoto

kicautoto

situs toto

dewaking

babeltoto

rajaking

pangkutoto

pokemontoto

jitu26

kicautoto

slot gacor

jitu26

top1toto

cancertoto

cancertoto

cancertoto

best usa casinos online

majumapan99

babeltoto

bengkulutoto

situs 5k

depo 5k

gacor

medantoto

medantoto

pokemontoto

medantoto

vikingtoto

tasiktoto

slot jp

vespa36

vespa36

depo 5k

situs toto

bengkulutoto

bengkulutoto

rajalangit77

babeltoto

bengkulutoto

bengkulutoto

https://bestroofings.ca/about/

bengkulutoto

tasiktoto

cancertoto

rajaking

situs toto

situs toto

cancertoto

kudahoki

bulantogel

bulantogel

cancertoto

kudahoki

pokemontoto

kudahoki

rajaking

cancertoto

raja king

kari4d

bengkulutoto

kaostogel

kaostogel

kaostogel

kaostogel

pokemontoto

bengkulutoto

babeltoto

babeltoto

KUDAHOKI

bengkulutoto

slot gacor

bengkulutoto

top1toto

bengkulutoto

babeltoto

paito hk

bengkulutoto

cancertoto

coktogel

tasiktoto

rajaking

bengkulutoto

bengkulutoto

tasiktoto

tasiktoto

cancertoto

top1toto

bengkulutoto

bengkulutoto

vikingtoto

rajaking

bengkulutoto

bengkulutoto

bengkulutoto

vikingtoto

toto

slot

depo 5k

pokemontoto

situs toto

phoenixreslabs.com

tasiktoto

tasiktoto

kari4d

pangkutoto

vikingtoto

flokitoto

pokemontoto

gelasjitu

gelasjitu login

gelasjitu daftar

gelasjitu.org

flokitoto

slot

flokitoto

flokitoto

flokitoto

altartoto

flokitoto

flokitoto

flokitoto

bengkulutoto

bengkulutoto

flokitoto

slot

flokitoto

wak89

babeltoto

flokitoto

babeltoto

flokitoto

flokitoto

flokitoto

flokitoto

bengkulutoto

bengkulutoto

tarungtoto

bengkulutoto

bengkulutoto

bengkulutoto

KASKUSTOTO

KASKUSTOTO

flokitoto

tasiktoto

tasiktoto

flokitoto

flokitoto

flokitoto

bengkulutoto

flokitoto

flokitoto

flokitoto

flokitoto

flokitoto

flokitoto

kari4d

kari4d

bengkulutoto

bengkulutoto

bengkulutoto

COKTOGEL

flokitoto

flokitoto

vikingtoto

situs toto

situs toto

situs toto

bengkulutoto

slot qris

flokitoto

flokitoto

flokitoto

kari4d

kari4d

flokitoto

flokitoto

flokitoto

flokitoto

toto hoki

toto jp

kari4d

pascol4d

kari4d

toto

bengkulutoto

tasiktoto

ngawitoto

situs toto

babeltoto

flokitoto

flokitoto

bandar togel

angkringan138

slot gacor

pascol4d

pascol4d

kari4d

kari4d

kicautoto

flokitoto

situs slot

slot gacor mahjong

https://linkneon88.com/

toto

flokitoto

flokitoto

tasiktoto

tasiktoto

bengkulutoto

hoki

slot

toto

hoki

bengkulutoto

bengkulutoto

flokitoto

flokitoto

lgomax99

lgomax99

lgowin99

lgowin99

mpo500

hukumtoto

kicautoto

hukumtoto

hukumtoto

situs toto

situs toto

flokitoto

babeltoto

babeltoto

https://supercok.com/

JEMARI4D

JEMARi4D

JEMARI4D

pas4d

flokitoto

flokitoto

laetoto

laetoto

sekutu4d

flokitoto

vespa36

vespa36

flokitoto

flokitoto

flokitoto

tasiktoto

tasiktoto

kakek111

flokitoto

flokitoto

ternatetoto

flokitoto

mega888

flokitoto

bengkulutoto

tasiktoto

pascol4d

kari4d

pascol4d

situs toto

wisdomtoto

situs toto

toto macau

situs toto

pascol4d

pascol4d

toto

laetoto

jakartaslot88

jakartaslot88

desabet

tasiktoto

situs toto

desabet

situs toto

top1toto

duniatoto

flokitoto

flokitoto

kari4d

bulantogel

bulantogel

tegaltoto

tegaltoto

tegaltoto

desabet

desabet

tegaltoto

FILM PORNO