Murder + Sieve + multiple backends problem

Juergen Wolf juergen.wolf at idmt.fraunhofer.de
Tue Dec 2 10:54:43 EST 2008


On Mon, 1 Dec 2008 14:22:54 -0500
Wesley Craig <wes at umich.edu> 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 at idmt.fraunhofer.de
gilb:  Fraunhofer-Institut fuer Digitale Medientechnologie IDMT
       98693 Ilmenau, Ehrenbergstr. 31
Tel.:  +49 3677 467-234			Fax:   +49 3677 467-467
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1965 bytes
Desc: not available
Url : http://lists.andrew.cmu.edu/pipermail/info-cyrus/attachments/20081202/17006eb1/attachment-0001.bin 


More information about the Info-cyrus mailing list