Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

Where I work we're trying to create a mailbox where our employees sends messages to it and the mail server processess them. Much like the Support of some companies where you send an email a ticket is automatically opened, but instead we need to save the messages to the filesystem depending upon an identified ID in the message.

We're considering two options:

1) Identify by to: header

Messages are sent to or, where 12345 is out customer identifier, and the mail server processess messages and saves them to:

/data/os/12345/Customer contact.eml

2) Identify by subject: header

Messages are sent to and the customer identifier is specified in the subject [12345] Customer contact.

We need to do some other verifications as the user (from: header) is authorized to archive messages to that customer, but this is another story.

I tried searching for something along the line of AMaViS and ClamAV filters but had no success.

Do you have any clues on how to do this?

Thank you in advance.

Edit: sorry, I forgot to mention that our mail server is postfix.

share|improve this question
what mail server? – Ward Jul 2 '11 at 4:59
@Ward sorry, I forgot to mention... edited. – Luiz Damim Jul 2 '11 at 15:31
People, please care to explain why the downvotes... – Luiz Damim Jul 3 '11 at 1:57
up vote 2 down vote accepted

I'm not sure exactly what you're asking. A mail filtering tool like procmail could be made to do what you're asking, but it would be just as easy to write a small application in your favorite language that would parse an incoming message and execute whatever actions you deemed appropriate.

Postfix -- and most other Unix mailer software -- makes it very easy to forward email to a certain address to a program of your choice. A combination of a service entry in and a tranport map transport will probably get you what you want.

You could also just install some ticket handling software, for which there are many open source options.

share|improve this answer
Thank you @larsks, I'll look into it. – Luiz Damim Jul 4 '11 at 12:09

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.