Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirecting mail to some users from a specified address?

Status
Not open for further replies.

gkidd

IS-IT--Management
Jun 22, 2004
2
0
0
US
Hello,

I have a question as to how (if possible) to accomplish the following. I'll try to explain it as clearly as I can.

My company has dozens of departments with multiple email users in each department who recieve email from john@xyx.com.


A department of mine has 5 email users, named: Red, white, blue, orange, and yellow@mycompany.org. All of these users also get email from john@xyz.com .

This SPECIFIC department has a specific email account (brown@mycompany.org) where they want any messages from john@xyz.com that come to red, white, blue, orange, and yellow@mycompany.org to be redirected to brown@mycompany.org and then deleted from the mail server.

Never reaching red, white, blue, orange, or yellow@mycompany.org .

Is this possible, and if so how can I achieve this result.

Thank You
Gkidd
 
This is not really a sendmail issue. Once mail comes ito the server, it gets handed off to the local mailer. This is usually procmail. Procmail uses snippets of code called recipes to filter mail. You can do a google search to find out more about it. Here is a simple recipt to do what you are talking about. Basically, it looks for mail from john@xyz.com and appends the message to brown's mailbox.

Code:
MAILDIR=$HOME/mail
INBOX=/var/spool/mail/brown

:0 :
* ^From: john@xyz.com
$MAILDIR/brown

:0 E:
$INBOX


 
I forgot to mention that this goes in /etc/procmailrc. You do not have to restart sendmail or procmail since this file gets read every time mail comes in.



 
Thanks so much for taking time to respond. I'm on the right path now.

GKidd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top