Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automate saving received mails into file?

Status
Not open for further replies.

zaxxon

MIS
Dec 12, 2001
226
DE
Hi,

I am currently getting mails with fetchmail from a pop3 server. I also found a tool called "munpack" to extract the attached files of these mails, once they are written into the mbox for example.

What might be a good way to automate the writing of the received mails into a file? Ie. is there a way I can tell my MUA (mail? mutt? pine?) to be triggered from a shell script, read the message so that it will be written into mbox for example?
Or is there an easier or other way that is usually used to do that, maybe with procmail or... ?? :)

laters
zaxxon
 
I think you'd be better off finding a scripting language with a library that understands spool files and mime attachments. I'm pretty sure python has tools for this.
 
Hi,

found an easy solution after searching and testing some time:

I just forward the incomming mail with a .forward file in the users $HOME and in there it is being piped to procmail which checks the mail by rules written in .procmailrc. For separating attachments and message from a mail I use "munpack", a nice tool I found on the web (sources).

laters
zaxxon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top