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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to route all the messages to my own mailer

Status
Not open for further replies.

kri

Programmer
Oct 31, 2000
5
US
I am trying to configure sendmail to route all the messages addressed to my domain to a particular program. I am using sendmail 8.9.3... Any help will be appreciated

Thanks
kri
 
i just did this like this:
1. add domain to accepted domains,
/etc/sendmail.cw
2. alias all emails from your domain to a certain user, say 'email-script-user'
/etc/mail/virtusertable:
@mydomain.com email-script-user
3. set up so all emails that go to email-script-user are sent to a perl script,
/etc/aliases:
email-script-user: |/script/path/file.pl

problem you have then is, trying to determine who the owner of the email is from the perl file. i did this by adding a little macro in the /etc/sendmail.cf file that creates a new header:
HX-Intended-Recipient: $u

which makes this kinda header in all incoming email:
X-Intended-Recipient: <alias@yourdomain.com>

so you can parse that out, and know where the email should go. this is needed, cause from the To, Cc headers, you can't tell who is supposed to get the email, and sendmail doesnt have the ENV stuff that qmail does.

i hope this works for ya, took me 3 days of hell to get this far, but it works great.

lemme know if this helps.
i recommend O'Reilly's Sendmail book, it's dry, but helpful,

Blake
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top