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

I need to save all bounces in a database, so I can query it from my application and not mail to any address that bounced more than X times.

If I recall correctly, Postfix allows to pipe messages to shell commands, so I was thinking that maybe Exim could have something similar, but any other easier/simpler option will do, as long as the data gets stored.

Any ideas?

A detailed explanation would be much appreciated, since I'm not a sysadmin and only dealt with MTAs very briefly in the distant past.

Thanks!

share|improve this question

1 Answer 1

This is a very good idea; I wish all bulk mailers would do that!

Exim does have a way of doing this. However, you really need to read the documentation thoroughly - cargo-culting off of an answer given by a random stranger on the internet is highly likely to give you problems later on...

The basic way to do this is to set up a .forward file for that address. The contents should look something like

# Exim filter

pipe /path/to/program-that-stores-in-database

But there is a lot more that can be done, and if you're the one to manage this server, set aside an hour to read through the documentation at exim.org. It will more than pay off in the long run.

share|improve this answer
    
Thanks Jenny! I was looking for something like that but couldn't find it (no wonder; it was 2:30am :) ). I did look at the documentation but it's been a long time since I touched an MTA's configuration and then I used mostly Postfix, so Exim is a bit alien to me. I'm not the one configuring the server, I'm just trying to help, but I agree about just randomly/blindly following instructions. –  borfast Jun 13 '13 at 9:00
    
Exim is a fairly complex mailserver to setup, with lots of options, so I understand that it's not easy to just jump in and find the right option immediately, even for someone who's been running other MTAs recently. –  Jenny D Jun 13 '13 at 9:03
    
So I came up with this: # Exim filter if error_message then pipe /path/to/program-that-stores-in-database finish endif For some reason, block indenting (start a line with four spaces) doesn't seem to be working here, neither do line breaks (ending a line with two spaces). Sorry about that. –  borfast Jun 13 '13 at 9:18
    
Indentation doesn't work in comment, just in questions/answers. –  Jenny D Jun 13 '13 at 9:19
    
That explains it. Althouth the "Learn more" link in the help does mention indented blocks and line breaks. Oh well. Thanks again, Jenny. –  borfast Jun 13 '13 at 9:37

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.