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
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,
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.