2

My postfix server is working on a particular domain name through a relay, so it's like that: Client send to abs@subdomain.domain.com -> domain.com production mail server -> internal mail server on subdomain.

All messages for subdomain.domain.com are being forwarded. But the thing is, the application that I'm supporting uses mailing system for some internal stuff and many addresses that are being CC when client is sending e-mail doesn't exist on subdomain mail server, they serve another purpose. When app on subdomain receives e-mail, it parses headers and uses all CC addresses in it's algorithms.

Here comes the problem. When client sends an e-mail, he'll receive as many error responses as there are fake addresses in CC. There is only one real address that is listed in /etc/aliases and it's just piping incoming mails to stdin for some script.

Question. How do I prevent sending error responces to the client and just /dev/null all fake addresses? I need only 1 address, that is listed in aliases.

Thanks in advance.

2

Ok, I figured it out.

This can be achieved through virtual_alias_maps. Add an virtual alias for domain and for address. Redirect domain to /dev/null and address to local alias.

virtual_alias_maps file:

target_addr@subdomain      target@localhost
@subdomain      devnull@localhost

/etc/aliases:

target:  "| /path/to/script"
devnull:  /dev/null

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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