On Mon, 1 Dec 2008 14:22:54 -0500 Wesley Craig <wes@xxxxxxxxx> wrote: > On 01 Dec 2008, at 12:18, Duncan Gibb wrote: > > Cross-store SIEVE is theoretically the sort of thing that ought to > > favour the unified murder design over a conventional layered one... > > Absolutely, the backend with the INBOX and SIEVE scripts would need > to know have to have a listing in mailboxes.db for the remote > mailbox. As far as the code goes, sieve_fileinto() would probably > work as-is. deliver_mailbox() on the other hand would have to do an > mlookup() and behave more like cmd_append() does if the mailbox was > remote. Not a large undertaking, tho. Thanks for the replies. I have taken a look into the code. The mlookup thing is indeed very simple and already working. The cmd_append() part is a bit tricky tho, as the LMTPD does not have any imap connection to the backend as far as I see. I guess LMTP will be the wrong way to transport the mail to the right backend server. As I am completly new to the cyrus code, does anybody has any hints what would be a good start to get this done ? --- imap/lmtpd.c.orig Tue Apr 22 15:11:18 2008 +++ imap/lmtpd.c Tue Dec 2 16:52:00 2008 @@ -487,12 +487,39 @@ int quotaoverride, int acloverride) { - int r; + int r, type; struct appendstate as; time_t now = time(NULL); unsigned long uid; const char *notifier; + + struct mupdate_mailboxdata *mailboxdata; + char *server; + r = mboxlist_detail(mailboxname, &type, NULL, NULL, &server, NULL, NULL); + + /* Mailbox not existent, and murder setup ? */ + if (r == IMAP_MAILBOX_NONEXISTENT && config_mupdate_server) { + /* check the mupdate master */ + if (!mhandle) { + r = mupdate_connect(config_mupdate_server, NULL, &mhandle, NULL); + if (r) { + syslog(LOG_ERR, "couldn't connect to MUPDATE server %s: %s", + config_mupdate_server, error_message(r)); + fatal("error connecting with MUPDATE server", EC_TEMPFAIL); + } + /* find what server we're sending this to */ + r = mupdate_find(mhandle, mailboxname, &mailboxdata); + mupdate_disconnect(&mhandle); + } else { + /* find what server we're sending this to */ + r = mupdate_find(mhandle, mailboxname, &mailboxdata); + } + + /* do something to get the mail to the remote mailbox */ + syslog(LOG_INFO, "sieve moving message %s to server: %s",id, (char *) mailboxdata->server); + } + r = append_setup(&as, mailboxname, MAILBOX_FORMAT_NORMAL, authuser, authstate, acloverride ? 0 : ACL_POST, quotaoverride ? (long) -1 : Regards, Jürgen Wolf -- email: Juergen.Wolf@xxxxxxxxxxxxxxxxxx gilb: Fraunhofer-Institut fuer Digitale Medientechnologie IDMT 98693 Ilmenau, Ehrenbergstr. 31 Tel.: +49 3677 467-234 Fax: +49 3677 467-467
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
---- Cyrus Home Page: http://cyrusimap.web.cmu.edu/ Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html