[Dovecot] deliver mail with postfix to dovecot for mailinglists

Mark E. Mallett mem at mv.mv.com
Tue Nov 25 06:41:01 EET 2003


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 at 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 <globals.h>

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 at mailinglists.org",
			 "bugtraq at securityfocus.com",
			 "cisco-nsp at puck.nether.net",
			 "cisco-bba at puck.nether.net",
			 "asrg at ietf.org",
			 "dovecot.procontrol.fi" ],
      header :contains "List-id" "asrg.ietf.org",
      header :is "Sender" [
			"owner-nanog at merit.edu",
			"owner-bss-l at iisc.com" ],
      address :is "Return-Path" "owner-discuss-list at 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
}


More information about the dovecot mailing list