3

I'm looking for a solution to save automatically attachments of an e-mail for a specific mailbox on an network drive. Mails are stored on cyrus imap server.

Does anyone know a script or something like this. Maybe there is a way to do this with sieve?!?

I searched on the web, but didn't find anything.

Thanks in advance!

tarantel
  • 31
  • 1
  • 2

2 Answers2

3

AFAIK Sieve (the scripting language Cyrus loves) does not support attachment extraction. What you can do though is that you create a Sieve script which identified the e-mails having attachments (from sender, message size, whatever criteria you'd like to use), and automatically file those messages to some specific IMAP folder, say TemporaryAttachmentsFolder.

Then you can put in cron a shell script, which periodically polls that TemporaryAttachmentsFolder directory, and extracts the attachments with a tool like ripmime and saves them elsewhere. Or, if you are truly l337, you can replace the traditional cron with incron and make the extraction happen in real-time.

Janne Pikkarainen
  • 31,454
  • 4
  • 56
  • 78
0

Take a look at the following script: https://github.com/auino/mail-attachments-archiver, allowing you to store received mails attachments into a specific directory.

auino
  • 143
  • 7