Thank you.

I added the -D flag to master.cf.  Things seem to work but I am
noticing some curious errors:

postfix/pipe[11675]: DB84AC4501: to=<[EMAIL PROTECTED]>, relay=maildrop,
delay=19551, delays=19551/0.01/0/0.04, dsn=4.3.0, status=deferred
(temporary failure. Command output: /usr/local/bin/maildrop: Unable to
open mailbox. )

When opening the message DB84AC4501 I notice it has been tagged as
spam.  This is the same (so far) for all tagged SPAM.  This tells me
that the maildrop redirection (to the spam folder is not working).

This is my complete maildroprc file:

/^Delivered-To:\s*.+/
RECIPIENT=getaddr ${MATCH}

# split the recipient into user and domain parts
USER=""
DOMAIN=""
if ( ${RECIPIENT} =~ /(.*)@([EMAIL PROTECTED])/ )
{
   USER=${MATCH1}
   DOMAIN=${MATCH2}
}
else
{
  #no domain part
  USER=${RECIPIENT}
}

# extract extension from user-part
# we assume '+' is the delimiter. if you use another char, adjust..
EXTENSION=""
if ( ${USER} =~ /([^\+]+)\+(.*)/ )
{
  #extension found
  USER=${MATCH1}
  EXTENSION=${MATCH2}
}

MAILDIR="/var/spool/virtual_mailboxes/example.com/$USER/Maildir"

if (/^X-Spam-Status: Yes/)
{
  to $MAILDIR/.Polluriel/
}



And this is my master.cf maildrop line:


maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient} -w
75



My maildrop log is showing usernames now:

File: example.com/user/Maildir/ 


--- mouss <[EMAIL PROTECTED]> wrote:

> Juan Miscaro wrote:
> > Hi gang,
> >
> > I would like to have maildrop send tagged spam to a designated
> user's
> > folder (.Polluriel) but its not happening.  I am using Postfix with
> > Courier-IMAP on OpenBSD.  This is my maildroprc file:
> >
> > ------------------
> > DEFAULT="/var/spool/virtual_mailboxes/example.com/$1/Maildir"
> >
> > logfile "$HOME/maildrop.log"
> >
> > if (/^X-Spam-Status: Yes/)
> > {
> >   to $DEFAULT/.Polluriel/
> > }
> > ------------------
> >
> > Note: Here $HOME=/var/spool/virtual_mailboxes
> >
> > maildrop doesn't appear to have access to the user variable $1. 
> Here
> > is a line from the maildrop.log:
> >
> > File: /var/spool/virtual_mailboxes/example.com//Maildir
> >
> > Postfix's master.cf shows:
> >
> > maildrop  unix  -       n       n       -       -       pipe
> >   flags=Rhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
> -w
> > 75
> >
> >   
> 
> you are not passing a $1.  you need to add ${recipient} or ${user} to
> 
> the command above (you probably mean ${user}).
> 
> An alternative is to add 'D' to the flags and parse the Delivered-To 
> header. assumin you don't accept "nasty" addresses (addresses with 
> spaces or other chars that cause parsing issues):
> 
> # get the recipient address from the top most Delivered-To header
> # Make sure to configure your MTA to supply one.
> /^Delivered-To:\s*.+/
> RECIPIENT=getaddr ${MATCH}
> 
> # split the recipient into user and domain parts
> USER=""
> DOMAIN=""
> if ( ${RECIPIENT} =~ /(.*)@([EMAIL PROTECTED])/ )
> {
>    USER=${MATCH1}
>    DOMAIN=${MATCH2}
> }
> else
> {
>   #no domain part
>   USER=${RECIPIENT}
> }
> 
> # extract extension from user-part
> # we assume '+' is the delimiter. if you use another char, adjust..
> EXTENSION=""
> if ( ${USER} =~ /([^\+]+)\+(.*)/ )
> {
>   #extension found
>   USER=${MATCH1}
>   EXTENSION=${MATCH2}
> }
> 
> 
> now you can use ${USER}, ${DOMAIN} (and ${EXTENSION} if desired).
> 
> > Is there anything else I can be putting in my maildroprc file?
> >   
> 
> 
>
-------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Courier-imap mailing list
> [email protected]
> Unsubscribe:
> https://lists.sourceforge.net/lists/listinfo/courier-imap
> 



      Make free worldwide PC-to-PC calls. Try the new Yahoo! Canada Messenger 
with Voice at http://ca.messenger.yahoo.com/

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Courier-imap mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap

Reply via email to