2

I am looking for an open-source / free SMTP server that will enable me to automatically change the content of outbound messages via a simple search & replace (or regular expression). It should be able to be configured to do this only for emails being sent to addresses that match certain domains.

Specifically, I have an application that sends emails containing URLs. I need to be able to be able to perform a search & replace on those URLs before the email is delivered. I cannot change the application itself, but can point it at an SMTP server of my choice.

3 Answers 3

1

A simple solution would be to have your email server deliver the email to a shell script via Procmail. Procmail can run the mail through an arbitrary script (by using a .forward file); the script could then remail the result in whatever form you choose.

A bit hackish (but then any solution would be), but should be easy to implement & test. I've done something similar for automatically processing Return Receipts.

This might actually be cleaner than using an SMTP server, because you are really generating a new mail, rather than messing with an existing mail (which is not really supported by established email handling standars).

1
  • I've decided against attempting to do this now, but I think the procmail route would be the one I'd use if I did. Thanks.
    – msanders
    Jan 6, 2010 at 10:12
1

Spamassassin could probably be modified fairly easily to do this.

Failing that Anomy Sanitizer might be able to do it.

1

if you use windows platform, I suggest you try hmail server. It is free, opensource and has a COM API which allow you to modify the content of emails.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .