Greg Johnstone writes:


> The .mailfilter file contains the following (taken from the mailbot man
> pages):
> > cc "./Maildir"
> cc "| mailbot -t autoresponse -d dupdb -D 1 -s 'User is on leave' -A
> 'From: [EMAIL PROTECTED]'"
> EXITCODE = 0
> exit
> > Should I be able to use a .mailfilter file as well as maildroprc?

Yes, provided that nothing in maildroprc terminates mail filtering (such as an exit, or a to command).

Well, there's no 'exit', 'to' or anything that terminates maildrop that I can see. But it's even more mysterious than that.

I put log statements in maildroprc and the .mailfilter to see where things
got to. The maildroprc seems to get to the end, however, with the
.mailfilter in place the mail never gets delivered. As soon as I take the
.mailfilter away all the mail (including the 'missing' mail eventually)
gets delivered.

This indicates that either a parsing error, or a temporary runtime error occured when processing .mailfilter; both end up deferring mail.


Here's the maildroprc:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
VERBOSE=9
import SENDER
import RECIPIENT
import HOME
logfile "spamlog"
log "Maildrop started"
log "$HOME"
PATH=/bin:/usr/bin:/usr/local/bin:/usr/lib/courier/bin/
INBOX="Maildir/"
DEFAULT="$INBOX"
SPAMFLD="$INBOX.Trash/"
SHELL=/bin/ash
log "$INBOX"

# create needed directory
`test -d "$SPAMFLD"`
if( $RETURNCODE == 1 )
{
      `maildirmake "$SPAMFLD"`
}

# filter message
log "About to filter"
xfilter "/usr/bin/spamc"
log "Return from filter"
if (/^X-Spam-Flag: *YES/)
{
      DEFAULT="$SPAMFLD"
}
log "Finished"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

And here's the .mailfilter (I have tried this both with and without the 'cc' statement):

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
VERBOSE=9
logfile "filter.log"
log "mailfilter started"
cc "./Maildir"

Is there an existing $HOME/filter.log, and, if so, do the permission/ownership of the file allow the log file to be appended to?

What exactly is logged to your syslog, for a delivery attempt when the .mailfilter is installed.

Remember, .mailfilter must have 0600 permissions.


Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to