4 messages in net.sourceforge.lists.courier-maildropRe: [maildropl] Filtering Help?
FromSent OnAttachments
Jeff HooverSep 3, 2002 2:24 pm 
Jeff HooverSep 5, 2002 6:50 am 
hzqbbcSep 5, 2002 4:44 pm 
Jeff HooverSep 6, 2002 6:27 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [maildropl] Filtering Help?Actions...
From:Jeff Hoover (jeff@infotechfl.com)
Date:Sep 5, 2002 6:50:41 am
List:net.sourceforge.lists.courier-maildrop

Here is where I'm at now:

I've managed to get maildrop working with qmail-ldap. When testing the filter below I get 2 copies of every email, unless I try and send to another domain, then I get one copy. If I send to multiple recipients (via to or cc) each recipient gets two copies, regardless of what domain they are in.

Here is my /var/qmail/rc:

#!/bin/sh

# Using stdout for logging # Using control/defaultdelivery from qmail-local to deliver messages by default

exec env - PATH="/var/qmail/bin:$PATH" \ qmail-start "|/usr/local/bin/maildrop"

Should I be getting two copies of every message? It seems like the filter works (unless there are multiple recipients) then another copy is delivered regardless.

Thanks, Jeff

I was wondering if anyone could help me. I'm trying to find some way to filter messages in a qmail-courier system so that the from domain has to match the to or cc domain (don't ask why) to be delivered. I was told maildrop would be able to do the trick. I looked at the docs and tried to come up with a filter, but have no way of testing it yet (and I'm not quite sure if I understand everything). Would any filtering experts out there take a look at this and tell me if it would work? If not, could you point me in the right direction?

Thanks in advance, Jeff Hoover DEFAULT="./Maildir" DEFAULT_DEF="/var/qmail/maildirs" # first get the entire from address if ( /^From: *!.*/ ) { ADDR=getaddr($MATCH2) }

# now we just want the domain

if (($ADDR) =~ /@.*/) { FROM_DOMAIN=$MATCH }

# now compare to see if each to|cc domain matches

foreach /^(To|Cc): .*/ { foreach (getaddr $MATCH) =~ /@.*/ { if ($FROM_DOMAIN eq $MATCH) { cc $DEFAULT } else { # log,return message...do nothing? } } }