LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-25-2003, 12:28 PM   #1
360
Member
 
Registered: Jun 2001
Distribution: FC4
Posts: 136

Rep: Reputation: 15
Question 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
 
Old 07-25-2003, 04:12 PM   #2
js_530
Member
 
Registered: Jul 2003
Posts: 162

Rep: Reputation: Disabled
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).
 
Old 07-25-2003, 06:43 PM   #3
Looking_Lost
Senior Member
 
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120

Rep: Reputation: 45
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
 
Old 07-25-2003, 11:02 PM   #4
howlingyeti
LQ Newbie
 
Registered: Jul 2003
Posts: 10

Rep: Reputation: 0
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.
 
Old 07-26-2003, 01:46 AM   #5
360
Member
 
Registered: Jun 2001
Distribution: FC4
Posts: 136

Original Poster
Rep: Reputation: 15
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
 
Old 07-26-2003, 03:30 AM   #6
howlingyeti
LQ Newbie
 
Registered: Jul 2003
Posts: 10

Rep: Reputation: 0
/dev/null is basicly a black hole. Redirecting outside email there would be the same as deleting it.
 
Old 07-26-2003, 04:23 AM   #7
Bebo
Member
 
Registered: Jul 2003
Location: Göteborg
Distribution: Arch Linux (current)
Posts: 553

Rep: Reputation: 31
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
* ! ^From:.*\/(allowed.domain.no1|allowed.domain.no2|and.so.on)
/dev/null
If you have only one domain that you like to get mails from and you know that those email addressed have the structure "friend@allowed.domain.foo", then you can change it to

Code:
:0h
* ! ^From:.*@allowed.domain.foo
/dev/null
Be warned however: (1) This will kill the email completely. The general advice seems to save at least the header of every mail somewhere. This is what the change in warn item (2) will do (2) I'm a bit rusty when it comes to procmail scripting, so I'm not entirely sure if this does the right thing. You should test the script by changing the ":0h" to ":0fw:", and change /dev/null to some email folder, e.g. $HOME/Mail/Test if your mail directory is $HOME/Mail.

Also, that's a ZERO not an O on the first line!

Anyone, please correct me if this is wrong
 
Old 07-26-2003, 05:01 AM   #8
360
Member
 
Registered: Jun 2001
Distribution: FC4
Posts: 136

Original Poster
Rep: Reputation: 15
Ok, here is what I did...
In this file /etc/mail/access
I added this line...
*. DISCARD


seemed to work.

Thanks,

360
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix should do more than delete any incoming mail, right? icarus24 Linux - Networking 12 01-05-2004 09:11 PM
incoming email not getting to mailbox bwarn Linux - Software 1 12-04-2003 11:32 PM
How do I open port 25 to allow incoming email? ei2ie Linux - Networking 5 10-18-2003 01:02 AM
Can I get an incoming email to trigger a script file? davee Linux - General 2 10-16-2003 02:45 PM
How to delete incoming email using Kmail? Paul_Lee Linux - Newbie 2 04-23-2002 12:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration