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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Analyzing e-mails with Procmail

Status
Not open for further replies.

Pedemonti

MIS
Aug 25, 2003
14
AR
Hi, all

I have a newbie question: I'm trying to analyse the bonced e-mails that come to my server. I 've been playing around for a while and I was able only to store in a text file with the following script that is called by mailertable:

#! /bin/sh
DIREC=/opt/prueba_rebotes_log
:0
$DIREC/prueba_attachments

The thing is that I'm interested in the original mail that comes attached in the bounced e-mail. I only managed to get the different fields for the bounced mail (body, subject, etc.) but there's no sign of the original e-mail anywhere. I could get the fields of the bounced e-mail with:

#! /bin/sh
DIREC=/opt/prueba_log
HD=`formail -X ""`
CC=`formail -xCc:`
CT=`formail -xContent-Type:`
SUBJECT=`formail -xSubject:` # Obtengo Subject
FROM=`formail -r -xTo:` # Obtengo From
TO=`formail -xTo:` # Obtengo To
BODY=`formail -I ""` # Obtengo Body
DATE=`formail -x Date` # Obtengo Date
:0c
| echo "********************">> $DIREC/log
:0c
| echo "DE: $FROM">> $DIREC/log
:0c
| echo "PARA: $TO">> $DIREC/log
:0c
| echo "FECHA: $DATE">> $DIREC/log
:0c
| echo "ASUNTO: $SUBJECT">> $DIREC/log
$DIREC/log
:0c
|echo "$BODY" >> $DIREC/log

but no sign of the attached file

Anybody has any idea?

Thanks in advanced.

Pedemonti
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top