Kuro5hin.org: technology and culture, from the trenches
create account | help/FAQ | contact | links | search | IRC | site news
[ Everything | Diaries | Technology | Science | Culture | Politics | Media | News | Internet | Op-Ed | Fiction | Meta | MLP ]
We need your support: buy an ad | premium membership

Email based on deny-all policy

By akehurst in Internet
Fri Oct 20, 2000 at 10:21:03 AM EST
Tags: Internet (all tags)

I have this idea for an email system, where people have to actually ask you to put them on the list of known emailers. I'm thinking a system like this could cut down on the spam quite extensively. Read on for how I would implement such a system.

A person sends you an email. Your filtering software takes the from address and compares it against an acceptance list and a denial list. All addresses in the acceptance list are automatically accepted. All addresses in the denial list are automatically denied.

If the address is not in either of these lists, the mail bounces, with instructions on emailing a special address with a special subject, requesting that you put them on your acceptance list. When they do email in the request, you can review them one by one, and either toss the person into the always accept or always deny list (or even an accept once list).

It could get more complex than this. You could accept mail that is 'to' a certain mailing list, for instance, or other such rules based on mail headers.

I do believe this could eliminate a spam problem, since the spammer would have to ask you to put them on the acceptance list before you could get any spam at all. Have an annoying (boy|girl)friend? Stick them in the always deny list, and their mail goes to /dev/null and they get a nice bounce message.

I suppose you could compare this to what IPChains does with its rules system, only with email. Let me know what you think (i.e. am I smoking crack in la-la-land here?)


-Justin Akehurst


Voxel dot net
o Managed Hosting
o VoxCAST Content Delivery
o Raw Infrastructure


Related Links
o Also by akehurst

Display: Sort:
Email based on deny-all policy | 34 comments (32 topical, 2 editorial, 0 hidden)
procmail (3.62 / 8) (#1)
by Signal 11 on Thu Oct 19, 2000 at 08:16:23 PM EST

It's called procmail....

:0 H
${FROM} signal11@mediaone.net

:0 H
${FROM} afriend@not.aol.com

:0 H
# the rest goes in the bitbucket.

Society needs therapy. It's having
trouble accepting itself.
Yah, I was thinking of that (3.00 / 1) (#3)
by akehurst on Thu Oct 19, 2000 at 08:20:22 PM EST

I figured that procmail would be worked in somewhere along the line. Perhaps what I was thinking of would be a nice console interface to it all... -Justin

[ Parent ]
Some of us are already doing this (2.80 / 5) (#2)
by SIGFPE on Thu Oct 19, 2000 at 08:19:07 PM EST

I have my own domain and give out different email addresses to different people or groups of people. Mail sent to anyone else at my domain is simply not accepted by my mail server. If I receive spam on an email address I terminate it. This also has the advantage that I can track who sends me mail on what email address so, for example, I can find out who has given my email address to a bulk emailer. I don't need filtering - I just use sendmail with an aliases file.
bunch of these (2.62 / 8) (#4)
by rusty on Thu Oct 19, 2000 at 08:21:42 PM EST

There's a bunch of these "hoop-jumping" services already. I hate them with a deep and abiding passion, and never ever make a second effort to send mail through them. So, basically, if you're willing to throw some babies out with your bathwater, go for it.

Not the real rusty
Procmail is your friend (4.42 / 7) (#5)
by michaela on Thu Oct 19, 2000 at 08:24:15 PM EST

I can't help but think that implementing procmail would be less work for you and less difficult for those from whom you wish to receive mail.

In my case, I have a set of bypasses for mailing lists (many of them use a dummy To: header and Bcc: the message). If you're not on the bypass list, you need to have put my correct email address on either the To: or Cc: line, the message needs to have a properly formatted Message-id: header, and the From: address can't be one of several blacklisted domains. The end result is that less than 1 spam per 100+ spam attempts will slip through.

The added benefit of setting up my spam filter was learning procmail. I can also use it to sort messages into folders, send priority messages to my pager and other fun stuff.

It's not much different than your core idea, just a different method which, IMHO, is easier to maintain.
That is all

Nice (3.00 / 1) (#7)
by Arkady on Thu Oct 19, 2000 at 08:45:02 PM EST

That's a nice set of filters. Would you mind posting a generalized version of that (somewhere, here might not be appropriate) for me to use? Or just email it to me. I've never fiddled with procmail, so it'd be useful to have a sample to build from and I really should put something like this on my email. I get way too much spam.

Turning and turning in the widening gyre
The falcon cannot hear the falconer;
Things fall apart; the centre cannot hold;
Mere Anarchy is loosed upon the world.

[ Parent ]
procmail has the syntax from hell. (4.00 / 2) (#10)
by SIGFPE on Thu Oct 19, 2000 at 09:17:19 PM EST

And don't even look at the source code. Try 'mailfilter' (look on http://www.freshmeat.net) for a clean alternative.
[ Parent ]
What can I say (3.00 / 1) (#25)
by michaela on Fri Oct 20, 2000 at 10:19:14 AM EST

I like Perl, so the vaguely regex nature of procmail appeals to me. For you, it appears, 'mailfilter' is your friend. The general gist is the same though, is it not?
That is all
[ Parent ]
Spamcop does this and more. (2.25 / 4) (#6)
by nogin on Thu Oct 19, 2000 at 08:24:55 PM EST

Take a look at SpamCop - it not only has black and white lists, but it also has nice filtering for everything in between (for example, you may require senders to confirm that they are sending mail from a valid address) as well as semi-automated quick spam reporting...

Spamming Thru the Request Channel (3.16 / 6) (#8)
by acidos on Thu Oct 19, 2000 at 08:51:49 PM EST

If you bounce the mail back with instructions on how they can e-mail you to request to be on your list then they could just send the spam to the request address, and since you have to look thru it anyways you are seeing their spam.

Not likely (4.00 / 1) (#12)
by jeffmonks on Thu Oct 19, 2000 at 11:14:26 PM EST

Most spammers don't use valid return addresses in the From: or Reply-To: headers, so when the filter caught it and sent out the "how to get accepted" message, they would never receive it, and therefore not be able to spam the request channel.

A few honest spammers (oxymoron?) who actually use real return addresses might get through, but if they're honest enough to use a valid return address, they're likely to be honest enough to exempt you from their spamming if you ask to be removed.

This system would work, but as others have said, some people won't jump through the hoops to get on the list, and it becomes a pain in the ass for friends who change e-mail addresses, or have multiple addresses, etc...

[ Parent ]

fake headers (3.71 / 7) (#9)
by enterfornone on Thu Oct 19, 2000 at 09:01:40 PM EST

the proble is it is too easy to fake a from address. your ex girlfriend wants to harass you? just use your current girlfriends address...

a better was would be to force people to pgp sign messages and have a procmail rule that can filter on that (can procmail do this out of the box? it would be useful)

or force people to encrypt with your public key so you know the message is directed at you and not thousands of random addresses

efn 26/m/syd
Will sponsor new accounts for porn.
Spoofed headers, bulk mail (none / 0) (#14)
by kmself on Fri Oct 20, 2000 at 01:56:34 AM EST

Done en mass, these are relatively easy to detect. For the lone individual bent on harassing and stalking, there's not much you can do by general rules, but you may be able to find special cases which make their life difficult -- by requiring additional authentication from the white hat, by stomping on the black hat, or by dealing with the attacks on an idividual basis.

Karsten M. Self
SCO -- backgrounder on Caldera/SCO vs IBM
Support the EFF!!
There is no K5 cabal.
[ Parent ]

Been there done that (3.66 / 3) (#11)
by MeanGene on Thu Oct 19, 2000 at 10:26:52 PM EST

This suggestion was first mentioned something like 6-7 years ago - in the days of early AOL (who would've known that those creeps will become one of THE hi-tech stocks!?) and the Spamford-Green Card wars.

The easier solution turned out to be to exploit the user+ feature of sendmail and scan for valid To: or Cc: header.

Black/white/grey (4.33 / 3) (#13)
by kmself on Fri Oct 20, 2000 at 01:50:53 AM EST

Lars Wirzenius's procmail filters on steriods, with attitude, known as spamfilter, basically enforce this sort of policy, though in a slightly more friendly manner.

A white, black, and grey list are set up. Textfiles with email addresses or domains listed. You are responsible for adding to your black and white list. The grey list is automatically generated from addresses you send mail to.

Blacklisted mail is, at your option, dumped, denied, or filed as spam. Whitelisted mail goes on to your personal mailbox or additional filters. Everything else gets dumped to a "nopasswd" box. You can decide what you want to do with it there. I've created a set of shell scripts which extract mail headers, check for previously white- or black-listed addresses, and/or add the address to the appropriate list.

The distinction is that "grey" mail isn't rejected, it's just accepted at lower priority. The recipient is responsible for categorizing senders, not the sender.

Word of caution. spamfilter has an extremely fascistic attitude toward spam, and tends to assume hostile until proven otherwise. It also has a rather aggressive anti-spam autoresponse message. Mailing lists must be filtered correctly or they are treated as spam. I've more or less been forced into resigning one mailing list subscription due to poorly configured filters (and a touchy list admin...well, OK, he's also the primary author of the software discussed on the list, and it was his post I'd rejected <g>).

I have to say that the system works pretty well, I get about 300-500 emails daily, and see virtually no spam. The filters are a bit mysterious in their workings and I'm still trying to tune them appropriately. procmail is not the friendliest interface.

Recommended for geeks, newbies might prefer a more forgiving alternative.

Karsten M. Self
SCO -- backgrounder on Caldera/SCO vs IBM
Support the EFF!!
There is no K5 cabal.

Tons of mail still comin' in (2.00 / 3) (#15)
by skim123 on Fri Oct 20, 2000 at 03:40:44 AM EST

Actual spam messages -> 0
Number of messages asking if you'd like to accept spam -> levels of previous spam
Net spamage change: zero


Money is in some respects like fire; it is a very excellent servant but a terrible master.
PT Barnum

Automated (4.00 / 1) (#17)
by caine on Fri Oct 20, 2000 at 06:03:21 AM EST

Spamm is almost always automated. They don't have time to go through all the bounced mail they get to see what adress they should direct their request to.


[ Parent ]

Automation is versatile (2.00 / 1) (#18)
by B'Trey on Fri Oct 20, 2000 at 06:12:16 AM EST

And how much trouble would it be to write a Perl script that went through the bounced email and automatically submitted the "add request?"

[ Parent ]
But spammers are sleazy... (4.00 / 1) (#32)
by MrSmithers on Sat Oct 28, 2000 at 02:39:50 PM EST

...and usually forge their From: address. So your bounce message would never make it back to them :)

[ Parent ]
Filtering on subject, and Exim (3.00 / 2) (#20)
by Aquarius on Fri Oct 20, 2000 at 07:01:22 AM EST

I've seen a fair few people with sigs saying something along the lines of "Include the word 'Aquarius' in the subject line of any mail to me, or it will be rejected."

You could do this in an Exim .forward file with:
if $h_subject: does not contain "Aquarius" then
(off the top of my head).


"The grand plan that is Aquarius proceeds apace" -- Ronin, Frank Miller
The advisability of deny-all email (4.00 / 2) (#21)
by Aquarius on Fri Oct 20, 2000 at 07:27:25 AM EST

Trivially, a deny-all based ruleset for email is only useful if you have specific set of people from whom you receive mail. However, if you're happy to limit yourself to this, then it can be a useful idea. You might want to think about saving all non-qualifying mail somewhere and reviewing it occasionally.
As others have pointed out above, I don't think that the "mail people back to get them to ask for permission" trick will be useful; it will stop spammers, but it will thoroughly irritate legitimate people who want to mail you. Note that, as people have also said, spam often has a non-deliverable address listed, which means that you'll get bounce messages. Bear in mind here, also, the strong possibility of mail loops -- it is not just as simple as writing something to remail the sender!

A simpler solution might be to request that the body or subject of all mails sent to you contains a certain word; you could even include this word in postings made to Usenet and outgoing mails, which would mean that replies to you would be likely to carry it. As of yet, I've not seen spam that is presented as a reply to a Usenet posting, so this might be a satisfactory alternative.


"The grand plan that is Aquarius proceeds apace" -- Ronin, Frank Miller
you can do that right now (4.75 / 4) (#22)
by hany on Fri Oct 20, 2000 at 07:36:02 AM EST

as owner of your mailbox and the one who chooses with which software you process and read your e-mails you can alredy do that (i'm thinking about procmail for example).

when you set-up such policy for your own mailbox, it is fine - you are not forcing anybody into doing what he does not like (in cunjunction with his mailboxe).
when you think about it as "everybody have to (or should) do such thing" than you are in (little) trouble - some people may not like such idea.
BUT spam is not problem for spammers. it is problem for recipients so the best solution is to leave the defense to every single recipient.

so, when your article ask us "should i set-up this for my mailbox" i say "go for it".
if it is asking "should we tell everyone to make such set-up?" i'm answering "forget it".


Not new (3.50 / 2) (#23)
by arafel on Fri Oct 20, 2000 at 08:25:28 AM EST

A quick search on Deja through news.admin.net-abuse.email (and on Google, for that matter) will show that there already exist systems for running this, and the idea's been around for a long time.

The implementations I've seen mail the sender an acceptance key if the address isn't recognised; the key changes every time. Again, you can add someone to the 'bozo bin' or whatever.

I forget exactly where I saw scripts to do it, rather than just talk, but I think it was on the main perl site some time back, as a series of articles they were doing.

Wouldn't that cause problems? (3.75 / 4) (#24)
by MoonJihad on Fri Oct 20, 2000 at 08:48:34 AM EST

If both ends have this system implemented, wouldn't bounced mail bounce back and forth? And wouldn't you get spammed with requests for authorization from spammers?

Problems? (3.00 / 1) (#27)
by PresJPolk on Fri Oct 20, 2000 at 12:55:41 PM EST

We assume that if Alice sends Bob an email, then Alice has already put Bob on her list.

[ Parent ]
Yup (4.00 / 1) (#30)
by ocelot on Fri Oct 20, 2000 at 05:37:26 PM EST

Oh yuck. I've run into this.

AOL apparently has some sort of filter like the one suggested (one of the parental filters, perhaps?). From time to time, someone will email asking for information about the site I run. I try to respond back, but it bounces saying that they aren't allowing me to send mail to them.

Even automatically adding the address of anyone you send an email to wouldn't help in this particular case, as I typically respond from a different address than they send the question to.

[ Parent ]

lets say (3.00 / 1) (#29)
by deadsea on Fri Oct 20, 2000 at 02:43:22 PM EST

It's pretty easy to identify the reply to an email. I would just not bounce something back, that you have seen once. Thats a pretty common practice with email and it would eliminate the round trip problem.

As far as requests from spammers, you could have your auto-reply have some multiple choice question that needs to be answered. That would make it so that only a human could really respond. Mass volume spammers wouldn't have time to do this with all messages.

[ Parent ]

Um. Yes. (none / 0) (#34)
by kmself on Sun Nov 19, 2000 at 08:52:24 PM EST

Well, I can authoritatively say that this is indeed possible. I managed to lose my ISP access for about 24 hours as a result of such a war. Me and an abuse@ autoresponder traded 355 messages over the course of a day. Theirs was an automatic trigger, mine was tripped by some common spam keywords in their message body.

I've added a rule excepting 'abuse@' from possible spam, need to think about the wisdom of using a spam autoresponse or not....

Karsten M. Self
SCO -- backgrounder on Caldera/SCO vs IBM
Support the EFF!!
There is no K5 cabal.
[ Parent ]

I know nothing about e-mail (3.00 / 1) (#26)
by Denor on Fri Oct 20, 2000 at 10:54:37 AM EST

But here's an idea I had.

Frequently, I'll get spam, and the return address will be forged. So far as I know, this is SOP. My question is, is it possible to forge the "recieved by" headers?

If not, wouldn't it be, if not easy then at least possible, to set up a program such that it would check the "from" address, and then to a lookup on the "received by" headers to see if it comes from the same domain?

There are probably problems with this. I'd like to hear what they are, because otherwise, I've got some coding to do :)


won't work (4.00 / 1) (#28)
by deadsea on Fri Oct 20, 2000 at 02:39:18 PM EST

Spammers often forge a reply to address of the open relay they use just to be able to use the relay. Also I own my own domain name but have no smtp server running on it. I can check email from it, but I can't send mail through it, so I send through other smtps with a return-to address of my domain. Quite a common practice.

[ Parent ]
Forged "Received By" headers (none / 0) (#33)
by iceT on Fri Nov 03, 2000 at 01:46:26 PM EST

Since the "Received By" headers end up as being part of the body of the message at each hop, the only header they can't forged is the one your server put on the note (the last or top one, depending on your perspective). All the other ones are on 'faith'.

[ Parent ]
What about a "postal" model? (3.00 / 2) (#31)
by isdnip on Sat Oct 21, 2000 at 10:35:54 PM EST

First off, I use Spamcop all the time to REPORT spam -- it's free, and I enjoy having spammers' accounts taken away, or at least having them put on ORBS. But as a filtering service, they're beaucoup expensive! They charge by the megabyte, and if you get a lot of mail, it alone can cost more than, say, ordinary ISP service.

The reason there's spam is because e-mail is "free" to the sender. Postal mail at least costs a bulk-mail fee. I wonder if a pay-to-send-mail alternative would work. Something along these line: I have a whitelist of anybody I am willing to receive mail from. They have no idea that I'm doing anything special. But for unknown mailers, I only accept the mail if there is some secure method of indicating that they've paid somebody money -- maybe only a nickel, but nonzero -- for the privilege. Now the money wouldn't go to the Post Office as in the mythical "bill 602P" that some nitwits still talk about. It would go to me, shared perhaps with the third-party stamp/escrow agent. So anybody who really wanted to reach me would happily fork over the nickel, but a spammer wouldn't. And after I received nickel mail from somebody, I'd almost certainly whitelist them anyway; the nickel is a one-time fee.

Make sense to anyone? (reply to fred at ematic this-is-despaminated dot com)

Email based on deny-all policy | 34 comments (32 topical, 2 editorial, 0 hidden)
Display: Sort:


All trademarks and copyrights on this page are owned by their respective companies. The Rest 2000 - Present Kuro5hin.org Inc.
See our legalese page for copyright policies. Please also read our Privacy Policy.
Kuro5hin.org is powered by Free Software, including Apache, Perl, and Linux, The Scoop Engine that runs this site is freely available, under the terms of the GPL.
Need some help? Email help@kuro5hin.org.
My heart's the long stairs.

Powered by Scoop create account | help/FAQ | mission | links | search | IRC | YOU choose the stories!