Re: PATCH for lmtp was [frontend lmtp connections to mupdate master]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Bron,
We're starting to run into this same issue -- lmtp proxies fail to deliver mail when mupdate master craps -- and so started to investigate this thread. However, it doesn't look like Michael Menge's patch made it in. Your thoughts?
    -nic

On 10/07/2014 08:17 AM, Bron Gondwana wrote:
I'm convinced :)  I'll probably add it with Ken while we're at CMU in a couple of weeks when we can test it together.  This is precisely the kind of thing we love to see!  Thanks.

Bron.

On Tue, Oct 7, 2014, at 10:23 PM, Michael Menge wrote:
Hi,

as we have had an other crash of mupdate master last week, we used the
patch on our production system.

After the patch was added the load on mupdate master was dropping form
about 10 to about 1.

After one week of using it we have not found any problems.
As I have not received any other feedback, I added it to the
bugtracker.

https://bugzilla.cyrusimap.org/show_bug.cgi?id=3866

Pleas consider adding it to 2.5 and 2.4.next

Regards

     Michael


Quoting Michael Menge <michael.menge@xxxxxxxxxxxxxxxxxxxx>:

Hi,


Quoting Michael Menge <michael.menge@xxxxxxxxxxxxxxxxxxxx>:

Quoting Michael Menge <michael.menge@xxxxxxxxxxxxxxxxxxxx>:

By thew way, the reason I was so surprised in the first place was, that
I have been fooled by the documentation:
Quoting https://cyrusimap.org/docs/cyrus-imapd/2.4.17/install-murder.php

Configuring the frontends
[...]
However, because the frontends only talk to the mupdate master
via   a  slave running on the local machine, you will also need
to set  up  a  slave on the same machine, in the SERVICES section
of   cyrus.conf,  like so
And an other misleading DOC !
Quoting
http://www.cyrusimap.org/mediawiki/index.php/Cyrus_Murder_Mail_Delivery
UMich patch

Patch Patches are against 2.2 but are being moved to 2.3
Lmtpproxyd   will now use the local mailboxes.db
Quoting Wesley Craig <wescraig@xxxxxxxxx>:

On 29 Sep 2014, at 10:08, Michael Menge
<michael.menge@xxxxxxxxxxxxxxxxxxxx> wrote:
thanks for your mail. By any chance do you still have the patch?
In fact, I don't.  Dusting off my notes, I recall now that instead
of patching this (bogus) code, we instead decided to configure the
frontends as "unified", while leaving the backends "standard".  The
  only downside of this approach was that a naive admin could
potentially create a user's mailbox on a frontend.

Sorry I said that we ported that code forward: in fact we simply
got  the effect of consulting mailboxes.db without porting forward.

:wes
I have patched my lmtpd to use the local mailbox.db in all cases,
unified Murder, and standalone cyrus already did this.
I tested it with a few testmails on my test system,
but as i don't have a unified setup or a standalone test system
at the moment i didn't test these setups.

I would appreciate a review.


Regards,

    Michael Menge


--------------------------------------------------------------------------------
M.Menge                                Tel.: (49) 7071/29-70316
Universität Tübingen                   Fax.: (49) 7071/29-5912
Zentrum für Datenverarbeitung          mail:
michael.menge@xxxxxxxxxxxxxxxxxxxx
Wächterstraße 76
72074 Tübingen



--------------------------------------------------------------------------------
M.Menge                                Tel.: (49) 7071/29-70316
Universität Tübingen                   Fax.: (49) 7071/29-5912
Zentrum für Datenverarbeitung          mail:
michael.menge@xxxxxxxxxxxxxxxxxxxx
Wächterstraße 76
72074 Tübingen
----
Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus
Email had 1 attachment:
+ smime.p7s
   7k (application/pkcs7-signature)


--
Nic Bernstein                             nic@xxxxxxxxxxx
Onlight, Inc.                             www.onlight.com
6525 W Bluemound Road, Suite 24           v. 414.272.4477
Milwaukee, Wisconsin  53213-4073

--- cyrus-imapd-2.4.17/imap/lmtpd.c	2012-12-01 20:57:54.000000000 +0100
+++ cyrus-imapd-2.4.17.lmtp_patch/imap/lmtpd.c	2014-09-29 15:27:55.000000000 +0200
@@ -186,56 +186,44 @@
 
     global_sasl_init(1, 1, mysasl_cb);
 
-    if (config_mupdate_server &&
-	(config_mupdate_config == IMAP_ENUM_MUPDATE_CONFIG_STANDARD) &&
-	!config_getstring(IMAPOPT_PROXYSERVERS)) {
-	/* proxy only -- talk directly to mupdate master */
-	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);
-	}
-    }
-    else {
-	dupelim = config_getswitch(IMAPOPT_DUPLICATESUPPRESSION);
+    dupelim = config_getswitch(IMAPOPT_DUPLICATESUPPRESSION);
 
 #ifdef USE_SIEVE
-	mylmtp.addheaders = xzmalloc(2 * sizeof(struct addheader));
-	mylmtp.addheaders[0].name = "X-Sieve";
-	mylmtp.addheaders[0].body = SIEVE_VERSION;
+    mylmtp.addheaders = xzmalloc(2 * sizeof(struct addheader));
+    mylmtp.addheaders[0].name = "X-Sieve";
+    mylmtp.addheaders[0].body = SIEVE_VERSION;
 
-	/* setup sieve support */
-	sieve_interp = setup_sieve();
+    /* setup sieve support */
+    sieve_interp = setup_sieve();
 #else
-	if (dupelim)
+    if (dupelim)
 #endif
-	{
-	    /* initialize duplicate delivery database */
-	    if (duplicate_init(NULL, 0) != 0) {
-		fatal("lmtpd: unable to init duplicate delivery database",
-		      EC_SOFTWARE);
-	    }
+    {
+        /* initialize duplicate delivery database */
+	if (duplicate_init(NULL, 0) != 0) {
+	        fatal("lmtpd: unable to init duplicate delivery database",
+	               EC_SOFTWARE);
 	}
+    }
 
-	/* so we can do mboxlist operations */
-	mboxlist_init(0);
-	mboxlist_open(NULL);
-
-	/* so we can do quota operations */
-	quotadb_init(0);
-	quotadb_open(NULL);
-
-	/* Initialize the annotatemore db (for sieve on shared mailboxes) */
-	annotatemore_init(0, NULL, NULL);
-	annotatemore_open(NULL);
+    /* so we can do mboxlist operations */
+    mboxlist_init(0);
+    mboxlist_open(NULL);
 
-	/* setup for statuscache invalidation */
-	statuscache_open(NULL);
+    /* so we can do quota operations */
+    quotadb_init(0);
+    quotadb_open(NULL);
 
-	/* setup for sending IMAP IDLE notifications */
-	idle_enabled();
-    }
+    /* Initialize the annotatemore db (for sieve on shared mailboxes) */
+    annotatemore_init(0, NULL, NULL);
+    annotatemore_open(NULL);
+
+    /* setup for statuscache invalidation */
+    statuscache_open(NULL);
+
+    /* setup for sending IMAP IDLE notifications */
+    idle_enabled();
+    
 
     /* Set namespace */
     if ((r = mboxname_init_namespace(&lmtpd_namespace, 0)) != 0) {
@@ -288,32 +276,8 @@
     snmp_increment(TOTAL_CONNECTIONS, 1);
     snmp_increment(ACTIVE_CONNECTIONS, 1);
 
-    /* get a connection to the mupdate server */
     r = 0;
-    if (mhandle) {
-	/* we have one already, test it */
-	r = mupdate_noop(mhandle, mupdate_ignore_cb, NULL);
-	if (r) {
-	    /* will NULL mhandle for us */
-	    mupdate_disconnect(&mhandle);
-
-	    /* connect to the mupdate server */
-	    r = mupdate_connect(config_mupdate_server, NULL, &mhandle, NULL);
-	}
-    }
-    if (!r) {
-	lmtpmode(&mylmtp, deliver_in, deliver_out, 0);
-    } else {
-	syslog(LOG_ERR, "couldn't connect to %s: %s", config_mupdate_server,
-	       error_message(r));
-	prot_printf(deliver_out, "451");
-	if (config_serverinfo) prot_printf(deliver_out, " %s", config_servername);
-	if (config_serverinfo == IMAP_ENUM_SERVERINFO_ON) {
-	    prot_printf(deliver_out, " Cyrus LMTP%s %s",
-			config_mupdate_server ? " Murder" : "", cyrus_version());
-	}
-	prot_printf(deliver_out, " %s\r\n", error_message(r));
-    }
+    lmtpmode(&mylmtp, deliver_in, deliver_out, 0);
 
     /* free session state */
     if (deliver_in) prot_free(deliver_in);
@@ -430,52 +394,27 @@
 
     if (server) *server = NULL;
 
-    if (mhandle) {
-	/* proxy only, so check the mupdate master */
-	struct mupdate_mailboxdata *mailboxdata;
-
-	/* find what server we're sending this to */
-	r = mupdate_find(mhandle, name, &mailboxdata);
-
-	if (r == MUPDATE_MAILBOX_UNKNOWN) {
-	    return IMAP_MAILBOX_NONEXISTENT;
-	} else if (r) {
-	    /* xxx -- yuck: our error handling for now will be to exit;
-	       this txn will be retried later -- to do otherwise means
-	       that we may have to restart this transaction from scratch */
-	    fatal("error communicating with MUPDATE server", EC_TEMPFAIL);
-	}
-
-	if (mailboxdata->t == RESERVE) return IMAP_MAILBOX_RESERVED;
-
-	if (aclp) *aclp = (char *) mailboxdata->acl;
-	if (server) *server = (char *) mailboxdata->server;
-	c = strchr(*server, '!');
-	if (c) *c = '\0';
-    }
-    else {
-	struct mboxlist_entry mbentry;
-	/* do a local lookup and kick the slave if necessary */
-	r = mboxlist_lookup(name, &mbentry, tid);
-	if (r == IMAP_MAILBOX_NONEXISTENT && config_mupdate_server) {
-	    kick_mupdate();
-	    r = mboxlist_lookup(name, &mbentry, tid);
-	}
-	if (r) return r;
-	if (mbentry.mbtype & MBTYPE_MOVING)  return IMAP_MAILBOX_MOVED;
-	if (mbentry.mbtype & MBTYPE_DELETED) return IMAP_MAILBOX_NONEXISTENT;
-
-	if (aclp) *aclp = mbentry.acl;
-	if (server) {
-	    if (mbentry.mbtype & MBTYPE_REMOTE) {
-		/* xxx hide the fact that we are storing partitions */
-		*server = mbentry.partition;
-		c = strchr(*server, '!');
-		if (c) *c = '\0';
-	    }
+    struct mboxlist_entry mbentry;
+    /* do a local lookup and kick the slave if necessary */
+    r = mboxlist_lookup(name, &mbentry, tid);
+    if (r == IMAP_MAILBOX_NONEXISTENT && config_mupdate_server) {
+        kick_mupdate();
+        r = mboxlist_lookup(name, &mbentry, tid);
+    }
+    if (r) return r;
+    if (mbentry.mbtype & MBTYPE_MOVING)  return IMAP_MAILBOX_MOVED;
+    if (mbentry.mbtype & MBTYPE_DELETED) return IMAP_MAILBOX_NONEXISTENT;
+
+    if (aclp) *aclp = mbentry.acl;
+    if (server) {
+        if (mbentry.mbtype & MBTYPE_REMOTE) {
+    	    /* xxx hide the fact that we are storing partitions */
+	    *server = mbentry.partition;
+	    c = strchr(*server, '!');
+	    if (c) *c = '\0';
 	}
     }
-
+    
     return r;
 }
 
begin:vcard
fn:Nic Bernstein
n:Bernstein;Nic
org:Onlight, Inc.
adr:Suite 24;;6525 W Bluemound Road;Milwaukee;WI;53213-4073;USA
email;internet:nic@xxxxxxxxxxx
title:VP Operations
tel;work:414-272-4477 x204
tel;cell:414-807-1734
url:http://www.onlight.com/
version:2.1
end:vcard

----
Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

[Index of Archives]     [Cyrus SASL]     [Squirrel Mail]     [Asterisk PBX]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [KDE]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux