Avoiding spam with procmail, aliases, and virtual user tableThursday, August 31. 2006Comments
Display comments as
(Linear | Threaded)
Hi, searching for a way to block spams via virtusertable and procmail I stumbled across your site. I looks like you have a solution for my needs. One comment and one question:
1. Comment: You wondered about why a lot of spam comes through which seems to be adressed to "accounting@yourdomain.org" but isn't catched neither by your virtual user table nor by your procmailrc. I think, there could two things going on: (a) The Spammers use a forged To-Header while directing the mail via Bcc: to your "dom_reg"-account and probably additionally (b) the spammers use a specific To-Header to surpass simple procmail recipes. At my site I have a recipe like :0 *^To: sales@mydomain.de /dev/null It catches all mails with a To-Header like: To: sales@mydomain.de What it doesn't catch are mails with To: So I think you have to filter not only for "accounting@yourdomain.com" but also for "". But maybe there is another problem at your site ... 2. Question: You wrote you are using "a catch-all trap" in your virtual user table. Can you describe how you do that exactly? Do you list all adresses that are spammed like , and direct them to a single alias "spam" und use a .procmailrc for this account, which just writes to /dev/null? Or is there a way to send those mails to /dev/null directly from within your virtual user table? Best regards, Christian Comments (3)
Sorry, my second example of a To-Header didn't go through. I meant
To: < sales@mydomain.de > But without the spaces after < and before >. Christian Comments (3)
Hi Christian,
1. Yes, I suspect that the spammer forged the To header and use bcc. I checked my procmail recipe again and I have wildcard (*) at the beginning or the To but not the end, so you're probably right that I also need to filter for the "". 2. For the catch all, in my virtual user table I have something like: @domain.org spam This means everything else for domain.org that is not explicitly stated on the virtual user table will go to that catch-all trap. Take a look at this also: http://www.sendmail.org/tips/virtual-hosting.html Then, in /etc/aliases, something like: spam : /dev/null I don't think you can redirect directly to a file from virtusertable (I am using sendmail). It has to map to local user or alias. Hope that helps. RDB Comment (1)
Hi Reuben,
thanks for the explanation! What I didn't know was how to use /etc/aliases to solve this problem. I'll change my settings accordingly! Thanks again. Christian Comments (3)
I would agree that the likely source of your reception is via bcc.
a suggestion on the use of aliases though: append some additional text to the address, like so: dom_reg.local-budiardja |/usr/local/bin/procmail -m /path/to/your/rccfile and be sure to specify that entire LHS string as the RHS of your virtualusertable entry. The reasoning for this is that the aliases file will otherwise automatically expand the valid addresses at your domain, and if you host more than one domain, the aliases will appear to be valid addresses as each one. lets's say you have two domains and there's a webmaster alias -- unless something overrides the alias, that same alias will be used for both domains. Of course, even the obtuse alias is globally valid on your system, but it's much less likely to be stumbled upon. I have a very different approach to individual signups. As I manage my own DNS, I can create temporary subdomains - MX records which I can purge after say 9 months. I'll actively use them for 6 months, then replace them, but only delete the host entry after about 9 (allowing my mail use to overlap a bit). The reasoning for this is actually quite simple: if you use your base domain for everything, you cannot escape the barrage of email attempts at the host. You may fend them off with DNSBLs or post-reception content filtering, but you're still dealing with the connections. If however, after some time, the very hostname the compromised email address utilizes NO LONGER RESOLVES, then the spammer isn't even connecting to your system to make the attempted delivery (there's still a nominal hit somewhere along the line for the DNS lookup, but that's trivial - AND the result is cached). 09A.domain.tld MX 10 yourmailhost 09B.domain.tld MX 10 yourmailhost You needn't try to disguise the hostname relation to the year, and if at some point you get premptive spam at a newly created host, at THAT point, you can decide to use arbitrary words biannually ("freak -> noob -> expand -> whatever"). Thus far, spammers are an opportunistic lot - they harvest addresses and try dictionary attacks, but they're not spending their time trying to figure out how any one individual site deals with spam. Comment (1)
|
CategoriesBookmarkShow tagged entriesQuicksearchBlog Administration |
Often time I have a group of people that I constantly exchanging emails with. This group is sometimes informal enough, fluid enough (a changing memberships or only temporary), or small enough to make it not worth the trouble to create a mailing-list for, Comment (1)
Tracked: Sep 06, 01:14