Procmail reagiert nicht auf Änderungen

sve07bl

New Member
Hallo,

auf Grund der Spamflut nutze ich SpamAssassin. Seit der Neuinstallation meines Servers (Debian 4.0) kann ich allerdings machen was ich will, procmailrc lässt die Spams durch. Sie werden zwar von SpamAssassin gekennzeichnet, allerdings nur im eigentlichen Nachrichtentext (Spam detection software, running on..) - im Betreff steht nix und die Nachrichten werden nicht, wie von mir in der procmailrc festgelegt, in ein anderes Postfach verschoben. Die Mails kommen somit ganz normal bei den Benutzern an!

Hier meine procmailrc:
Code:
# SpamAssassin sample procmailrc
# ==============================

# The following line is only used if you use a system-wide /etc/procmailrc.
# See procmailrc(5) for infos on what it exactly does, the short version:
#  * It ensures that the correct user is passed to spamd if spamc is used
#  * The folders the mail is filed to later on is owned by the user, not
#    root.
DROPPRIVS=yes

# Pipe the mail through spamassassin (replace 'spamassassin' with 'spamc'
# if you use the spamc/spamd combination)
#
# The condition line ensures that only messages smaller than 250 kB
# (250 * 1024 = 256000 bytes) are processed by SpamAssassin. Most spam
# isn't bigger than a few k and working with big messages can bring
# SpamAssassin to its knees.
#
# The lock file ensures that only 1 spamassassin invocation happens
# at 1 time, to keep the load down.
#
:0fw: spamassassin.lock
* < 256000
|spamassassin

# Mails with a score of 15 or higher are almost certainly spam (with 0.05%
# false positives according to rules/STATISTICS.txt). Let's put them in a
# different mbox. (This one is optional.)
:0:
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
/var/mail/web0p10
#almost-certainly-spam

# All mail tagged as spam (eg. with a score higher than the set threshold)
# is moved to "probably-spam".
:0:
* ^X-Spam-Status: Yes
/var/mail/web0p10
#probably-spam

# Work around procmail bug: any output on stderr will cause the "F" in "From"
# to be dropped.  This will re-add it.
# NOTE: This is probably NOT needed in recent versions of procmail
:0
* ^^rom[ ]
{
  LOG="*** Dropped F off From_ header! Fixing up. "
  
  :0 fhw
  | sed -e '1s/^/F/'
}

Wäre froh wenn mir jemand helfen könnte :-)

Vielen Dank!
 
Im Procmailrc kann man die Option LOGFILE=... angeben, so bekommt man dann mit, was überhaupt läuft und welche Regeln in Betracht gezogen werden.
Wenn man es etwas ausführlicher will, kann man dann auch noch VERBOSE=yes setzen (was die Logdatei ziemlich groß werden lässt).
 
Hallo,

habe das nun so reingeschrieben..leider macht er mir keine logdatei.
Die Datei bleibt immer leer, habe Server auch bereits neugestartet.

Gibt es irgendwo die Möglichkeit zu überprüfen ob die Protokollierung erfolgreich war? Evt. lassen sich ja da fehler rausifnden.
 
Wenn die Logdatei leer bleibt, ist die Sache einfach: Deine Config-Datei wird gar nicht erst beachtet.
Als nächstes solltest Du mal in die Postfix-Logdateien schauen, was da steht, wie genau die Mail ausgeliefert wurde. Dort sollte der Procmailaufruf auftauchen. Ansonsten musst Du wohl mal die Postfix-Config genauer anschauen ;)
 
Im log steht immer beim Kommando procmail error while writing to #PFAD# (der vor mir angegebene Pfad). Ich kann die Log-Datei hinschreiben wo ich will
  • /var/log/procmail.log
  • $HOME/Maildir/procmail.log
überall bringt er Fehler!
 
Jetzt habe ich diese beiden Verzeichnisse und LOGFILE=procmail.log genommen (ausprobiert) - immer noch schreibt er "error while writing"

ich guck mir mal die .forward an..
 
So,

nun habe ich es endlich geschafft ein paar Logs rauszubekommen..mit folgendem Ergebnis:

Code:
procmail: Lock failure on "spamassassin.lock"
[1731] warn: config: cannot open "/etc/spamassassin/local.cf": Permission denied
procmail: Lock failure on "/var/mail/web0p10.lock"
procmail: Error while writing to "/var/mail/web0p10"
From xxx@xxx.de  Sun Jul 19 19:24:35 2009
 Subject: Great Popular Soft At Prices You Will Like.
  Folder: /var/mail/web0p8						   4864
procmail: Lock failure on "spamassassin.lock"
[1907] warn: config: cannot open "/etc/spamassassin/local.cf": Permission denied
From xxx2@t-online.de  Sun Jul 19 19:28:49 2009
 Subject: 
  Folder: /var/mail/web0p1
 
einige Sachen habe ich hinbekommen..nur das Schreiben in dast Spam-Postfach funktiniert nicht:

Code:
procmail: Assigning "LOGABSTRACT=yes"
procmail: Assigning "DROPPRIVS=yes"
procmail: Assuming identity of the recipient, VERBOSE=off
procmail: Lock failure on "/var/mail/web0p10/.lock"
procmail: Unable to treat as directory "/var/mail/web0p10"
procmail: Error while writing to "/var/mail/web0p10"
procmail: Lock failure on "/var/mail/web0p10/.lock"
procmail: Unable to treat as directory "/var/mail/web0p10"
procmail: Error while writing to "/var/mail/web0p10"
From xxx2@t-online.de  Mon Jul 20 18:17:21 2009
 Subject: *****SPAM*****
 
Wie sieht denn das Verzeichnis aus ("ls -la /var/mail/web0p10")?

Bei /etc/spamassassin/local.cf könnte wohl ein "chmod 644" nötig sein.
 
die local.cf habe ich schon alleine hinbekommen, es war aber auch die 644 chmod Methode, die geholfen hat.

Das Kommando bei web0p10 hat folgendes Ergebnis gebracht:
Code:
-rw-rw---- 1 web0p10 mail 81805 2009-07-20 18:12 /var/mail/web0p10

Eigentlich sollte mail dann doch auch drauf schreiben können!?
 
Du hast hier ein Mischmasch von zwei verschiedenen Speichermethoden. procmail geht (aus irgendeinem Grund -- den ich in der obigen Config nicht entdecken kann) davon aus, dass Du das Maildir-Format verwendest. In diesem Fall müsste /var/mail/web0p10 ein Verzeichnis sein. Es ist aber eine Datei (wie es auch in der Config im ersten Beitrag spezifiziert wird), da das mbox-Format verwendet wird.

Finde raus, warum procmail unbedingt das Maildir-Format haben will. Wahrscheinlich befindet sich irgendwo in der Config ein '/' am Ende der mailbox-Datei... Oder umgekehrt: Stelle vollständig auf Maildir um (wenn das die restlichen Programme (IMAP, etc.) unterstützen).
 
Auch das habe ich jetzt umgestellt. Ich komme immer nch nicht ans Ziel :(

Code:
rocmail: Assuming identity of the recipient, VERBOSE=off
procmail: Lock failure on "/home/email/web0p10/Maildir/.lock"
procmail: Unable to treat as directory "/home/email/web0p10/Maildir/new"
procmail: Skipped "/home/email/web0p10/Maildir"
procmail: Lock failure on "/home/email/web0p10/Maildir/.lock"
procmail: Unable to treat as directory "/home/email/web0p10/Maildir/new"
procmail: Skipped "/home/email/web0p10/Maildir"

wenn ich den alten Weg gehe und in "/var/mail/web0p10" versuche zu schreiben und stelle diese (testweise natürlich) auf chmod 777 - funktioniert es einwandfrei. :(
 
Code:
/home/email/web0p10/Maildir:
insgesamt 20
drwx------ 5 web0p10 poponly 4096 2009-07-12 01:58 .
drwxr-x--- 4 web0p10 poponly 4096 2009-07-20 18:08 ..
drwx------ 2 web0p10 poponly 4096 2009-07-12 01:58 cur
drwx------ 2 web0p10 poponly 4096 2009-07-12 01:58 new
drwx------ 2 web0p10 poponly 4096 2009-07-12 01:58 tmp

/home/email/web0p10/Maildir/cur:
insgesamt 8
drwx------ 2 web0p10 poponly 4096 2009-07-12 01:58 .
drwx------ 5 web0p10 poponly 4096 2009-07-12 01:58 ..

/home/email/web0p10/Maildir/new:
insgesamt 8
drwx------ 2 web0p10 poponly 4096 2009-07-12 01:58 .
drwx------ 5 web0p10 poponly 4096 2009-07-12 01:58 ..

/home/email/web0p10/Maildir/tmp:
insgesamt 8
drwx------ 2 web0p10 poponly 4096 2009-07-12 01:58 .
drwx------ 5 web0p10 poponly 4096 2009-07-12 01:58 ..

/home/email/web0p10/.spamassassin:
insgesamt 24
drwx------ 2 web0p10 poponly  4096 2009-07-20 18:11 .
drwxr-x--- 4 web0p10 poponly  4096 2009-07-20 18:08 ..
-rw------- 1 web0p10 poponly 12288 2009-07-20 18:11 auto-whitelist
-rw------- 1 web0p10 poponly  1487 2009-07-20 18:08 user_prefs
 
Back
Top