I would like to create a following scenario on my Ubuntu 14.04 server:
- set up mail server (or is it called 'Mail Transfer Agent'?) which should take care of receiving mails only. No need to set up sending mails from that server.
- perform basic filtering of incoming mails (check if mail has a proper attachment - exactly a file with a specific extension)
- save attachment only to some specific folder
- delete processed message(s)
I know almost nothing about mail servers and I have tried to play a little bit with Postfix but if I understood correctly there are some better solutions for mail filtering and processing? I know Python and PHP so I could handle filtering/processing with one of those languages, but still not sure where exactly to start.
I'd prefer to handle incoming mail immediately after receiving if possible, rather than running cron job on some Python script, and delete processed message immediately after saving the attachment.
I don't need to setup any security or spam/virus protection at this particular moment.
Since I'm a bit confused about how to set up this workflow, I'd like to ask for at least a starting point for each step and also links for further reading are more than welcome! I don't ask for complete solution, but some tips about packages which could be helpful in this scenario are really appreciated.