procmail
[Top] [All Lists]

Re: Procmail filter does not send the spam email to correct folder

2009-09-29 17:42:20
Professional Software Engineering wrote:
At 14:42 2009-09-29 -0500, junk(_at_)lexoncom(_dot_)com wrote:
sorry i meant spam not smap,
procmail is called by LDA?

Local Delivery Agent.  Your MTA (Mail Transfer Agent) can/should be
configured to invoke procmail for all local deliveries.  However, if
it isn't, procmail can be invoked via a ~/.forward file by individual
users.  It will act slightly differently if invoked via .forward

invoked by mta
my problem is still with understanding which users calls procmail, and
under which user procmail is running the rule?
Is is root or mail or other?

If invoked as the LDA, procmail should initially be running with
elevated privledges, but those are shed by the time it is running a
users ~/.procmailrc

no procmailrc in users directory
below are the permissions, so both root and mail have access,
if the procmail uses user account to write this is why it fails i guess

Is the procmail recipe in the user home directory, or is it a global
procmailrc?  If a global (/etc/procmailrc), is there a DROPPRIVS=YES
line somewhere BEFORE the attempt to make this delivery?

global only
cat /etc/procmail.rc
# 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
LOGFILE=/var/log/procmail
VERBOSE=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: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
junk

# All mail tagged as spam (eg. with a score higher than the set threshold)
# is moved to "probably-spam".
#:0:
#* ^X-Spam-Status: Yes
#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/'
}


Default rcfile:         $HOME/.procmailrc
        It may be writable by your primary group
Your system mailbox:    /var/mail/root

FTR, if you're having issues with delivery for user 'junk', it'd be
wise to run your diagnostics as that user, not as a different user.

Also, as a rule, it's a good idea to have root mail processed under a
different account - you're less likely to do something terribly
insecure if you need't log in as root to read email.

[kersnip - original post, which was already sent to the list]

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer:
<http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the
list.

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail