Re: [exim] Dump message to stdout

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Christian Gregoire
Dátum:  
Címzett: exim-users
Tárgy: Re: [exim] Dump message to stdout
>----- Original Message ----
>From: Christian Gregoire <cgregoir99@???>
>To: Michael Sprague <mfs@???>; exim-users@???
>Sent: Thursday, August 16, 2007 3:28:22 PM
>Subject: Re: [exim] Dump message to stdout



>>----- Original Message ----
>>From: Michael Sprague <mfs@???>
>>To: exim-users@???
>>Sent: Thursday, August 16, 2007 3:05:19 PM
>>Subject: Re: [exim] Dump message to stdout


>>On Thu, Aug 16, 2007 at 05:45:19AM -0700, Christian Gregoire wrote:
>>> Hello,
>>>
>>> Is there a way, with the Exim command line, to dump a message (header + body) to stdout, given its message ID ? I would use something like:
>>> exim -Mvh <ID> > outfile
>>> exim -Mvb <ID> >> outfile
>>> but the header file would have first to be parsed to remove all the 'admin' lines and flags, which is not very handy.
>>Are you refering to messages in the queue? If so, the attached script
>>does just that. It'll spit out the body section, header section or the
>>message section based on the args you give it. Just change the "spool"
>>variable to match your spool and it should work; assuming you're using
>>the split spool.



>Thanks Michael, but actually, your script simply dumps the files with no processing, when I want all the unwanted lines and >flags be removed from the header file, which looks like :


If it may help someone, here is the script that does the processing :

awk -v RS= 'NR==2' header-file | sed 's/\(^[0-9A-Z]*\)[ ]*\(.*\)/\2/'


Christian



____________________________________________________________________________________
Be a better Heartthrob. Get better relationship answers from someone who knows. Yahoo! Answers - Check it out.
http://answers.yahoo.com/dir/?link=list&sid=396545433