[Dovecot] deliver mail with postfix to dovecot for mailinglists
This is a bit off topic on that list. But the question is required because of a limitation of dovecot. It cannot have shared mailboxes into which one would collect mailing list mails. I assume one has already solved that problem and therefore ask this question on that list.
I try to do the following: I would like to setup an alias dovecot@kzone.ch and subscribe this alias to the dovecot mailing list. Then I would like to create an alias to run maildrop with the correct parameter to put it into the directory ~ski/Maildir/.dovecot/. Of course, there is no user dovecot on my system and if there would be one she couldn't write to a directory owned by me.
Is there a trick to do the following:
ski -> ~ski/Maildir dovecot -> ~ski/Maildir/.dovecot postfix -> ~ski/Maildir/.postfix
Any other idea?
Any good documentation on that?
Sven
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.
Joshua.
On Mon, Nov 24, 2003 at 10:43:52PM +0100, Sven Kirmess wrote:
This is a bit off topic on that list. But the question is required because of a limitation of dovecot. It cannot have shared mailboxes into which one would collect mailing list mails. I assume one has already solved that problem and therefore ask this question on that list.
I try to do the following: I would like to setup an alias dovecot@kzone.ch and subscribe this alias to the dovecot mailing list. Then I would like to create an alias to run maildrop with the correct parameter to put it into the directory ~ski/Maildir/.dovecot/. Of course, there is no user dovecot on my system and if there would be one she couldn't write to a directory owned by me.
Is there a trick to do the following:
ski -> ~ski/Maildir dovecot -> ~ski/Maildir/.dovecot postfix -> ~ski/Maildir/.postfix
Any other idea?
Any good documentation on that?
Sven
-- Joshua Goodall "tea makes itself" joshua@roughtrade.net - Ana Susanj
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
}
I found an interesting document, describing how to use majordomo with postfix which I used to do what I want. (Actually, I didn't find anything to my problem. So I tried to set up majordomo... ;-)
http://www.csh.rit.edu/~jon/projects/majordomo/#postfix
That's what I did (ski is my login):
Create the mailbox where you would like to receive the mailing list into. I used my IMAP client and create a group called ml.test1
# mkdir /etc/postfix/mailing_list # mkdir /etc/postfix/mailing_list/ski # chown ski:ski /etc/postfix/mailing_list/ski
su - ski
cd /etc/postfix/mailing_list/ski vi aliases test1: /var/spool/imap/ski/.ml.test1/
/opt/postfix/sbin/postalias /etc/postfix/mailing_list/ski/aliases ^D
# vi /etc/postfix/main.cf alias_maps = dbm:/etc/aliases, dbm:/etc/postfix/mailing_list/ski/aliases
# /opt/postfix/sbin/postfix reload
Now, whenever a mail to user test1 arrives, the alias is read from the file /etc/postfix/mailing_list/ski/aliases. Because there is no user test1 the delivery is done as the owner of the alias file, ski in this case. ski can write to ski's Maildir, of course...
Sven
participants (3)
-
Joshua Goodall
-
Mark E. Mallett
-
Sven Kirmess