Procmail Frage

Postfix, QMail, Sendmail, Dovecot, Cyrus, Courier, Anti-Spam
Anonymous
 

Procmail Frage

Post by Anonymous »

Hallo!

Ich habe ein Procmailscript welches für zwei Postfächer benutzt wird. Teilweise habe ich das Problem das Emails, die nicht in der Whitelist stehen nicht korrekt im invalid Ordner abgelegt werden

Code: Select all

VERBOSE=no
#LOGABSTRACT=all
PMDIR=$HOME/.procmail
LOGFILE=$PMDIR/`date +%y%m%d`.log
DEFAULT=$HOME/mail
MAILDIR=$HOME/mail
SHELL=/bin/sh
WHITELIST1=$PMDIR/whitelist_1.txt
WHITELIST2=$PMDIR/whitelist_2.txt
TIME=`date +%y%m%d`
ZEIT=`date +%H%M%S`
LOG="
--------- $TIME $ZEIT ---------
"

FROM=`formail -xFrom: | sed -e 's/ *(.*)//; s/>.*//; s/.*[:<] *//' | head -n 1 | tr -d [" ]`

#Dieser Eintrag kopiert alle eingehenden Emails
:0c:
/mail/save/

:0
* ^(From|Cc|To).*(postfach1@server.com)
* ? fgrep -qxis $FROM $WHITELIST1
|/processmail 1 -

:0
* ^(From|Cc|To).*(postfach2@server.com)
* ? fgrep -qxis $FROM $WHITELIST2
|processmail 2 -

:0:
/mail/invalid/
Der Logfile Output sieht im Fehlerfall dann so aus

Code: Select all

procmail: Assigning "LOGABSTRACT=all"
procmail: Assigning "DEFAULT=/mail"
procmail: Assigning "MAILDIR=/mail"
procmail: Assigning "SHELL=/bin/sh"
procmail: Assigning "WHITELIST1=/whitelist_1.txt"
procmail: Assigning "WHITELIST2=/whitelist_2.txt"
procmail: Executing "formail -xFrom: | sed -e 's/ *(.*)//; s/>.*//; s/.*[:<] *//' | head -n 1 | tr -d [" ]"
procmail: Assigning "FROM=sender@server.com"
procmail: Assigning "LASTFOLDER=/mail/save/new/1232613047.1462288_0.u962006r"
 Subject: TEST 
  Folder: /mail/save/new/1232613047.1462288_0.u962006r            6588
procmail: Match on "^(From|Cc|To).*(postfach1@server.com)"
procmail: Executing "fgrep,-qxis,postfach1@server.com,/whitelist_1.txt"
procmail: Non-zero exitcode (1) from "fgrep"
procmail: No match on "fgrep -qxis postfach1@server.com, /whitelist_1.txt"
procmail: No match on "^(From|Cc|To).*(postfach2@server.com)"
procmail: Error while writing to "/mail/invalid/tmp/1232613047.1462288_1.d/.procmail/whitelist_1.txtu962006r"
procmail: Couldn't create or rename temp file "/mail/invalid/tmp/1232613047.1462288_1.d/.procmail/whitelist_1.txt
u962006r"
procmail: Assigning "LASTFOLDER=/mail/msg.ShP"
procmail: Opening "/mail/msg.ShP"
procmail: Acquiring kernel-lock
procmail: Notified comsat: "user@0:/mail/msg.ShP"
THX 4 your help...