HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Programming/Scripts (http://www.howtoforge.com/forums/forumdisplay.php?f=7)
-   -   Need help with a script (http://www.howtoforge.com/forums/showthread.php?t=40372)

Manuel 24th October 2009 01:04

Need help with a script
 
Hi,

I’ve been following the Virtual Users and Domains with Postfix, Courier and MySQL (Debian Etch) tutorial by Falko Timme and I’m very happy with the results. Our system performs very well but we have a problem related to
a script we use.

Mail considered as spam in our system is sent to a quarantine directory. Then a script processes all the mail in the quarantine and send those under a certain score to the users maildirs at /home/vmail/domain/maildirs for user’s examination. The problem is that the script we use strips the original separation or line feeds between header and body (and the rest of the lines too) and so the mail is counted as only header and has zero bytes. Consequently mail messages are not readable and you only get pieces of them by cliking for example in “View full header” in a mail client.

Here are the lines:

#Process by recipient
IFS=','
# When there are a lot of recipients, the line X-Envelope-To: has one or several CRs.
# To prevent this, we cut until the next tag X-…type X-Quarantain…etc appears.
# We give the possibility of a maximum of 2048 additional lines in case of extensive list of To:
Envelope_To=`grep -A 2048 -m 1 ^X-Envelope-To: $tmpfile | xargs echo 2>/dev/null | cut -f2 -d:|sed -e 's/X-.*//g'`
deb "Mail recipients (X-Envelope-To): $Envelope_To"

Where are we doing wrong? Come somebody tell?

Thanks in advance
Manuel


All times are GMT +2. The time now is 17:21.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.