On Tue, Nov 25, 2003 at 10:39:34AM +1100, Joshua Goodall wrote:
You might be able to achieve this with the virtual(8) delivery agent, since it can target arbitrary directories and UIDs.
Also consider the "+" separator, as in user+foo@domain, which is integrated with the virtual(5) lookup in a reasonably intelligent way and may suit you.
Of course, what we could really do is implement SIEVE (RFC3028) in a LMTP delivery agent for Dovecot. It'd attract a lot of the people currently depending on Cyrus.
OK, since we are way off topic..
Funny, I am writing and am using a local delivery agent that includes a mix of C and sieve constructs. I'm working on making it a little more ready for prime time before seeing if anybody else wants to try it.
Here's a snippet of my own local delivery script
#include
sieve { require [ "fileinto", "copy", "reject" ]; require [ "editheader", "dnsbl" ]; require [ "relational", "comparator-i;ascii-numeric" ]; }
/* Pre-tag the mail with any DNSBLs that "hit" for this message */ int i; char dnsblF; dnsblF = 0; string bl_list; bl_list = (string)"";
/* Interim hack while array initialization is not yet implemented */ #define DNSBLC 6
string *dnsbls[DNSBLC]; dnsbls[0] = "spamcop"; dnsbls[1] = "spamhaus"; dnsbls[2] = "abuseat.cbl"; dnsbls[3] = "dsbl.list"; dnsbls[4] = "sorbs"; dnsbls[5] = "ahbs";
for ( i = 0; i < DNSBLC; ++i ) { if ( sieve { dnsbl [*dnsbls[i]] "std" } ) { if ( dnsblF ) bl_list += " "; dnsblF = 1; bl_list += (*dnsbls[i]); } } if ( dnsblF ) sieve { addheader "X-DNSBLs" [bl_list]; }
sieve { /* Just so we can use elsif everywhere */ if false { keep; }
.
.
lots of whitelisting and other stuff... . .
elsif anyof (
header :contains "List-Post" [
"bsdi-users@mailinglists.org",
"bugtraq@securityfocus.com",
"cisco-nsp@puck.nether.net",
"cisco-bba@puck.nether.net",
"asrg@ietf.org",
"dovecot.procontrol.fi" ],
header :contains "List-id" "asrg.ietf.org",
header :is "Sender" [
"owner-nanog@merit.edu",
"owner-bss-l@iisc.com" ],
address :is "Return-Path" "owner-discuss-list@opensrs.org",
address :is :domain "Return-Path" "lists.isp-lists.com" ) {
keep;
}
/* sobig macro from the mv.h library */
elsif _MV_SOBIG$F {
addheader "X-Spam-Reason" "sobig.f profile";
fileinto "Spam/maybe";
}
etc
}