How do I delete all incoming email?
Hi,
Running RH 7.2 How can I get sendmail to quietly delete or discard all email coming from the internet yet still run local email? or better yet... I process all email for a domain and all it's sub domains. I need to quietly delete or discard all email comming in to this domain and all it's subdomains. Thanks, 360 |
You can use a residential gateway, configure it to block whatever port your using for email so only local computers behind the residential gateway can access the mail server. If you don't feel like getting a residential gateway, you can use the linux firewall to block everything except 192.168.x.x (if you're using a NAT router).
|
Try adding appropriate entries to hosts.allow and hosts.deny for sendmail
Works on RH 8 & 9 but may be off the mark for 7 |
I don't know the exact commands but I bet one or two iptable lines could reject all incoming packets except ones from the range of your network. Try the command man iptables for more information.
|
Ok... thanks for all the great ideas...
Here is some more details about what I'm trying to do: I want to accept the message but disrcard it after accepting it. I know that /etc/access can do this with incoming messages based on the senders domain name, but I need to discard the message based on the recipients domain name. In the /etc/aliases file I have put this but haven't tested it yet... domain_of_recipent.com: /dev/null Anybody know how /dev/null works? I don't know. Thanks, 360 |
/dev/null is basicly a black hole. Redirecting outside email there would be the same as deleting it.
|
I'm filtering spams with procmail. It will read scripts that you have in or call from .procmailrc in your home directory. The syntax can be pretty horrible, but I got it to work. Read more about it at the Procmail Documentation Project web site.
To kill mails that don't come from domains that you like, the $HOME/.procmailrc file should contain these lines: Code:
:0h Code:
:0h Also, that's a ZERO not an O on the first line! Anyone, please correct me if this is wrong :) |
Ok, here is what I did...
In this file /etc/mail/access I added this line... *. DISCARD seemed to work. Thanks, 360 |
All times are GMT -5. The time now is 06:56 PM. |