Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We receive service requests via a particular email. The request is then forwarded to other addresses, using an entry in virtual_alias_maps. Upon seeing the word "EMERGENCY" in the subject line of a request to this email, I would also like to forward this to another address (an alias of our administrator's SMS email addresses).

I think I can accomplish this with header checks and the REDIRECT command. However, REDIRECT only sends it to the redirected address, not the forwarded addresses. In the case of "EMERGENCY" I would like it to go to the redirect address and the original forwarded addresses.

I am fairly new to Postfix and I feel like I am missing something here. Any suggestions?

share|improve this question
    
I'm more of a QMAIL sort of guy but this sounds like a job for procmail. –  Warner Apr 8 '10 at 15:46

2 Answers 2

up vote 0 down vote accepted

Typically, Postfix won't act upon the message contents without outside help, it acts on the envelope information. Things like the Subject belong to the message contents.

I think the easiest way to manage such things is to include an extra email address to the ones already receiving, which is actually a forward to a script (you can do that in /etc/aliases by prefixing the destination with a pipe symbol, read man aliases) that performs your requested tests on its standard input (the message contents) and acts accordingly.

share|improve this answer

this can be done by:

a.) add a new smtpd listener to master.cf setting the -o always_bcc option to the address you want and have this new smtpd process listen on some port like 10027; create a second smtpd listener on 10028 - set options in this smtpd instance for delivery to final destinations as you would a standard smtpd instance. See http://www.postfix.org/SMTPD_PROXY_README.html for more info

b.) in your header check, use the filter action and send any matching subject to filter inet:127.0.0.1:10027

alternately, you could install an additional postfix instance and route messages to that via step a as well ... many different ways to do this.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.