Register
It is currently Sat Nov 22, 2014 10:34 am

Extract body from mail (/var/spool/mail/${USER})


All times are UTC - 6 hours


Post new topic Reply to topic  [ 2 posts ] 
Author Message
 PostPosted: Sun Sep 02, 2007 6:06 am   

Joined: Sun Sep 02, 2007 5:49 am
Posts: 1
Hello,

Well i used the search function but didn't find anyth similar.
I hope i'm not just repeating any previously request

I'd like to extract the body and the subject of some mail from spool's mail (I use fetchmail to get them) is a bash script,
but I don't know how to do this :oops:

I have already trie google but it didn't give me any things:-$

If someone has a good idea?

Any help would be appreciated! 8)

sorry for my bad english I speak french;-)


Top
 Profile  
 PostPosted: Mon Feb 11, 2008 4:25 am   

Joined: Tue Feb 05, 2008 8:24 am
Posts: 14
baby-tux wrote:
I'd like to extract the body and the subject of some mail from spool's mail (I use fetchmail to get them) is a bash script,


I suppose this is a difficult thing to do right in a small bash script. Your script should be aware of such things as MIME, transfer encoding, character sets etc… There is a lot of technical details to take care of.

In practice, I think, almost any automatic processing of messages may be done in mail delivery agent (mail filter) software, like procmail or maildrop. They also allow running custom scripts.

The other way to go is using scripting languages (python, perl, ruby) where the powerful libraries take care of the details. After little googling I have found a simple script in python which prints message bodies. You may find the script here.


Top
 Profile WWW  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP