Cyrus SEEN and uidl patch

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

 



Good morning,

I'm running an ISP environment with Cyrus 2.3.18. I have seen, we have some problems when sync_client tries to do a SEEN from some mailboxes. First of all, say that we had to patch Cyrus IMAP with this proposed patch http://www.irbs.net/internet/info-cyrus/0602/0330.html because else... our customers who used Outlook (with any version!!!, even 2010!!!) and pop3 mail retrieval protocol and the option of left message copy on the server, where constantly downloading the same messages one time and another (and always they checked for new mail in this MUA... and obviously you know... our customer's annoyance). After applying this patch, although the first problem has been corrected, (the Outlook and UIDL one...) I have observed (and reproduced) that sync_client's forked proccess gets stuck with some mailboxes when SEEN actions that had to move big strings like this one :

cyr_dbtool /expert/correo/imap/domain/e/egoitz.com/user/e/egoitz.seen skiplist show 04409b4d4f77894d 1 1333240179 13393 1333240678 11,25,57,63,88,96:97,104,120,130,147,152,158:160,198,204,218,256,263,273,333,335,355,382:383,420,441,458,467,509,514,530,545,548,594,601,616,641,661,665:666,681,703,743,812,819,824,838,847,859,865,878,889,891,894,899,934,953,984,997,1002,1009,1024,1033,1068,1070,1123,1126,1165,1170,1175:1176,1179,1195,1197,1211,1221,1230,1261,1263,1275,1282,1299,1314,1334,1345,1364,1377,1417,1419,1421,1439,1443,1451,1454,1462,1476,1478,1515,1526,1529,1540,1564:1566,1573,1593,1608,1626,1628,1674,1697,1702,1713,1719,1736,1738,1748,1769,1775,1781,1830,1834,1842,1865,1870,1888,1910,1923,1930,1932,1935,1940,1973:1974,2005,2009,2011,2027,2044,2069,2079,2095,2101:2102,2119,2122,2134,2137,2141,2143,2154,2209,2223,2247,2267,2271,2287,2313,2331,2333:2334,2336,2338,2356,2370,2387,2431,2451,2478,2493,2517,2520,2550,2556,2572,2575,2594,2596,2600,2607,2658:2659,2708,2715,2732,2744,2766,2778,2817,2830,2885,2889,2904,2911,2917,2920,2930,2940,2955,2962,2970:2971,2985,3011,3031,3039:3040,3061,3091,3096,3147,31
54,3164,
3171,3180,3183,3191:3192,3199,3219,3221,3225,3227,3230,3235,3254,3264,3273,3280,3304,3343,3361,3371,3375,3406,3414,3419,3425,3445,3463,3489,3492,3499,3525,3556,3564,3604,3636,3643,3665,3667,3670,3691:3692,3747,3797,3801,3803,3811,3852,3872,3883,3886,3907,3930,3993,4020,4036,4043,4105,4113,4142,4149,4159,4172,4187,4218,4220,4257,4309,4363,4365,4369,4371,4393:4394,4400,4434,4463,4481,4515,4551,4554,4581,4585,4591,4600,4641,4663,4710,4713,4721,4767,4792,4818,4872,4898,4928,4961,4977,4979:4981,4983,5009,5014,5037,5064,5076,5105,5156,5165,5177,5193,5208,5241,5261,5275,5281,5296,5298,5311,5313,5321,5328,5334,5343,5363,5392,5395,5401,5404,5408,5427,5440,5453,5466,5483,5520,5527,5537,5549,5597,5603,5608,5613,5652,5683,5688,5692,5719,5730,5747,5753,5764,5804,5845,5848,5860,5880,5883,5887,5910,5919:5920,5937,5950,5963,5974,5980,6014,6017,6032,6043,6052,6054,6070,6143,6180,6194,6273,6307,6342,6378,6384,6389,6407,6418,6421,6435,6443,6452,6480,6488,6534,6544,6556,6566,6576,6588,6603,6616,
6691,673
3,6736,6749,6772,6820,6844,6860,6864,6878,6907,6913,6921,6932,6977,6988,6990,6996,7014,7030,7034,7042,7052,7084,7087,7095,7142,7151,7157,7162,7176:7177,7187,7194,7199,7215,7247,7275,7282,7331,7340:7341,7346,7349,7376,7383:7384,7403,7425,7479,7566,7571,7603,7611,7623,7648,7688:7689,7728,7758,7766,7795,7806,7815,7819,7851,7854,7863,7887,7915,7919,7929:7930,7932,7941,7981,7985,8147,8200,8257,8282,8287,8304,8309,8317,8321,8324,8326,8328,8330,8335,8359,8366:8367,8372,8432,8455,8460,8476,8499,8504,8513,8519,8531,8542,8567,8569,8575,8647,8660:8661,8669,8687:8688,8724,8750,8754,8773,8778,8792,8816,8834,8838,8876,8912,8927,8934,8937:8938,8969,8980:8981,9005,9008,9018,9029,9035:9036,9040,9044,9052,9066,9069,9076:9077,9084,9087:9088,9110,9131,9143,9152,9181,9191,9200,9207,9233,9255,9317,9340,9350,9359,9375,9402,9405,9412,9416:9417,9420:9421,9427,9433,9441,9445,9448,9451,9466,9473,9478,9505,9532,9569,9572,9598,9600,9609,9636,9645,9657,9671,9690,9702,9709,9711:9712,9714,9717,9729,9735,973
7,9740:9
741,9750,9752,9755,9776,9782,9787,9799:9800,9817,9825,9833,9836,9889,9894:9895,9901,9903,9907:9908,9916,9919:9920,9923,9932,9938,9957,9972,10000,10027,10062,10065,10095,10109,10147,10159,10183,10186,10193,10239,10307,10347,10374,10423,10426,10434,10437,10479:10480,10495,10502,10513,10515,10523:10524,10538,10552,10566,10574,10595,10611,10615,10620,10624,10647:10648,10650,10660,10672,10674,10683:10684,10704,10715,10757:10758,10780,10784,10786,10788,10826,10830,10841,10863,10865,10868,10873,10884,10892,10905,10915,10927,10953:10954,10962,10975,11027,11042,11044,11053,11056,11061,11076,11103,11169,11196,11205,11218,11285,11295,11315,11317,11331,11333:11334,11338,11351,11354,11361,11377:11378,11381,11405,11407,11412,11414,11440,11452,11484,11486,11489,11493,11498,11541,11552,11562,11579,11601,11608,11610,11618,11657,11684,11688:11689,11697,11713,11717,11730,11739,11750,11754,11775,11788,11794,11840,11862,11864,11869,11871:11872,11901:11902,11922,11926,11954,11957,11967,11979,11991
,11994,1
1996,12007:12008,12014:12015,12019,12022,12030,12039,12046,12048:12049
17ee87c64f778f64	1 1333240441 20 1333240546 1:15,20
60fce00e4f778f59	1 1333240443 36 1333240403 1:31,33:35
6dd5e44d4f778f49	1 1333240233 71 1333240678 1:71

After doing some tests, and as said before, reproduced the problem... have noticed that sync_client is not being able to handle this big string with the function prot_printf as left in the proposed patch in the previous written URL (http://www.irbs.net/internet/info-cyrus/0602/0330.html). With other smaller strings has no problem with SEEN, but with this one, as said gets stuck there. So... like Outlook is a very used MUA (very known in fact....) and replication is essential IMHO to work smoothly.... I wanted to propose you this modified version of the patch I have attached to this mail. If you were so kind, I would be very thanked if you told me if you see some problem applying this to Cyrus-IMAPd 2.3.18 (you know... you would have to apply them with -p0 because have not take care with file locations.... sorry :) ). I have checked that when applying my modified version of the patch, the problem of SEEN mailboxes gets fixed and although have not tested directly the Outlook problem has to be corrected too... because of the own naure of the changes. If you see it ok?, wouldn't it be fine if you commit it to the official cvs of this nice server project?. I mean this is a very common problem that could happen, and the replication IMHO makes Cyrus (apart from other features of course) to be the better software of this kind.

So to summarize... do you see any problem with this patch?... and to be applied to now patched servers (with previous version of the patch of the proposed patch of the URL) ?. Could it be committed to cvs?

Thanks a lot for you're time,
Best regards
--- /pop3d.c	2012-03-31 23:01:50.000000000 +0200
+++ imap/pop3d.c	2012-04-01 01:34:58.000000000 +0200
@@ -1069,13 +1069,13 @@
 		    prot_printf(popd_out, "-ERR No such message\r\n");
 		}
 		else if (mboxstruct.options & OPT_POP3_NEW_UIDL) {
-			    prot_printf(popd_out, "+OK %u %lu.%u\r\n", msg, 
+			    prot2_printf(popd_out, "+OK %u %lu.%.10u\r\n", msg, 
 					mboxstruct.uidvalidity,
 					popd_msg[msg].uid);
 		}
 		else {
 		    /* old uidl format */
-		    prot_printf(popd_out, "+OK %u %u\r\n", 
+		    prot2_printf(popd_out, "+OK %u %.10u\r\n", 
 				msg, popd_msg[msg].uid);
 		}
 	    }
@@ -1084,11 +1084,11 @@
 		for (msg = 1; msg <= popd_exists; msg++) {
 		    if (!popd_msg[msg].deleted) {
 			if (mboxstruct.options & OPT_POP3_NEW_UIDL) {
-			    prot_printf(popd_out, "%u %lu.%u\r\n", msg, 
+			    prot2_printf(popd_out, "%u %lu.%.10u\r\n", msg, 
 					mboxstruct.uidvalidity,
 					popd_msg[msg].uid);
 			} else {
-			    prot_printf(popd_out, "%u %u\r\n", msg, 
+			    prot2_printf(popd_out, "%u %.10u\r\n", msg, 
 					popd_msg[msg].uid);
 			}
 		    }
--- /prot.c	2012-03-31 23:04:30.000000000 +0200
+++ lib/prot.c	2012-04-01 01:40:40.000000000 +0200
@@ -1247,6 +1247,23 @@
     return 0;
 }
 
+int prot2_printf(struct protstream *s, const char *fmt, ...)
+{
+    va_list pvar;
+    char buf[2048];
+
+    assert(s->write);
+
+    va_start(pvar, fmt);
+    vsnprintf(buf, sizeof(buf), fmt, pvar);
+    va_end(pvar);
+   
+    prot_write(s, buf, strlen(buf));
+
+    if (s->error || s->eof) return EOF;
+    return 0;
+}
+
 /*
  * Read from the protections stream 's' up to 'size' bytes into the buffer
  * 'buf'.  Returns the number of bytes read, or 0 for some error.
----
Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/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