Just sharing ideas. I hope this is the correct forum.
As a form of spam-blocking, a friend and i came up with a solution for my box. Basically, there are two rules.
1) Block all external mail from reaching my domain. E.G. anything sent to
*@example.com is rejected.
2) Reroute all mail to subdomains to the local user of the same name:
Bob@Bob.sample.com redirected to
Bob@sample.com
Linode@Bob.sample.com redirected to
Bob@sample.com
Bob@sample.com blocked.
All local mail still routes properly, with no need for the sub-domain. And, this has removed all the spam i used to get, as thankfully, spambots that check random hosts do not seem to check subdomains.
To accomplish this, MX records were added for the sub-domain, and exim-4 was installed. The following two modifications were made:
file: /etc/exim4/conf.d/acl/30_exim4-config_check_rcpt
Added:
deny
domains = example.com
This rules blocked all external incoming mail to the domain.
Then we created the following file:
/etc/exim4/conf.d/ rewrite/99_exim4-config_example_rewriting
And added the rule:
\N^.*@([^.]+)\.example\.com\N
$1@example.com T
This works beautifully.
This now allows me to give any email address to anybody i want. Should i get spammed to a specific address, just blacklist it. If i get random spam, i may need to switch to a whitelist. I sure hope that doesn't happen.
To finish my setup, i'm using cyrus and squirellmail.
I would like to make a modification somewhere, if possible. I want to have to "To:" header to be the incoming address. That is, if John Doe emails me, i may give him the address
john.doe@bob.example.com (which would get gets re-routed to
bob@example.com), i would want the from address (or at least the reply-to) to be
john.doe@bob.example.com.