Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does anyone know of FOSS solutions (or general information) on setting up a Linux-bases SMTP mail relay that can do the following:

  • Detect if a message has an attachment
  • if so, save the attachment to a web-based storage solution
  • remove the attachment from the message and insert a link to the file


share|improve this question
up vote 1 down vote accepted

The Python Milter package comes bundled with a sample script which removes attachments deemed as dangerous and inserts a message - should be simlpe to adapt.

share|improve this answer

I've used Ruby to do something similar. In my case I was trying to process MMS/SMS. There are some solutions out there for this.

Here's a good starting point, which is useful in general up to at least the point where they describe implementing a filter in postfix, which is probably the best method for actually handling mail programatically on linux without writing your own SMTP server.

share|improve this answer

Your Answer


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.