Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 10-05-2003, 03:57 PM   #1
Registered: May 2003
Distribution: RedHat 9
Posts: 32

Rep: Reputation: 15
sendmail: Routing dead mail to a shell command?

Is there a way that I can run a shell command when an email is returned from a server because the account doesn't exist? People sign up on my site using fake email addresses sometimes and then I get a bunch of dead mail bouncing back to me. I'd like to be able to run a shell command that would call up a script to remove their email address from the database any time an account comes back dead. Thanks.
Old 10-05-2003, 04:13 PM   #2
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
In /etc/aliases you can add a line like:
xyz :|/path/to/script

This will send all mail sent to user "xyz" to that program/script. You may want to consider using a scoreboard and only delete mail once it has been rejected say 3 times in a row - this should account for any network issues.

After editing /etc/aliases you need to run:


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Mail command (much) faster than sendmail bmorel Linux - Software 7 04-02-2005 05:57 PM
How can I use the Mail command with Sendmail Options Kalar Linux - Newbie 1 07-16-2004 10:35 PM
Sendmail mail goes to dead.letter rutman Linux - General 1 06-18-2004 12:14 AM
Domain Routing to Postfix from Sendmail = Wrong IP information in Mail Logs! dholingw Linux - Networking 2 05-20-2004 10:06 AM
Routing outgoing mail on a dual external interface system with sendmail Dewar Linux - Networking 5 11-19-2003 03:42 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:48 AM.

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