Re: event notifier problem

"Matteo A. via Info" <[email protected]>
Newsgroups gmane.mail.imap.cyrus
Message-ID <[email protected]>
After digging into the code, we found the problem!
The value of the read buffer in *notifyd.c* that was too small for us, so socket data being truncated at 480 characters.
Some debug sentences reveal the issue:
2023-02-22 16:08:32 xstreamos cyrus/imaps[13890]: [ID 207500 local6.debug] notifyc-225: [bufsiz: 1606]
2023-02-22 16:08:32 xstreamos cyrus/imaps[13890]: [ID 269823 local6.debug] notifyc-255: [buflen: 556][message: {"event":"vnd.cmu.MessageMove","timestamp":"2023-02-22T16:08:32.666+01:00","oldMailboxID":"imap://xstreamos/user/gabriele.bulfon%40xstreamos.org;UIDVALIDITY=1676368622","vnd.cmu.oldUidset":"40","mailboxID":"3f5dfd40-41e2-e952-b9bf-95c1b41be15b","uri":"imap://xstreamos/user/gabriele.bulfon/Junk%40xstreamos.org;UIDVALIDITY=1676469851","uidset":"37","pid":13890,"user":"[email protected]","vnd.cmu.mbtype":"el","serverFQDN":"xstreamos","vnd.cmu.mailboxACL":"[email protected]\tlrswipkxtecdan\tcyrus\tlrswipkxtecda\t <http://gabriele.bulfon/Junk%40xstreamos.org;UIDVALIDITY=1676469851%22,%22uidset%22:%2237%22,%22pid%22:13890,%22user%22:%[email protected]%22,%22vnd.cmu.mbtype%22:%22el%22,%22serverFQDN%22:%22xstreamos%22,%22vnd.cmu.mailboxACL%22:%[email protected]/tlrswipkxtecdan/tcyrus/tlrswipkxtecda/t>"}]
2023-02-22 16:08:32 xstreamos notifyd[13891]: [ID 333877 local6.debug] notifydc-140: [bufsiz: 480][r: 480]
2023-02-22 16:08:32 xstreamos notifyd[13891]: [ID 414469 local6.debug] do_notify using method 'log'
2023-02-22 16:08:32 xstreamos notifyd[13891]: [ID 545175 local6.info] EVENT, , , ,  "{"event":"vnd.cmu.MessageMove","timestamp":"2023-02-22T16:08:32.666+01:00","oldMailboxID":"imap://xstreamos/user/gabriele.bulfon%40xstreamos.org;UIDVALIDITY=1676368622","vnd.cmu.oldUidset":"40","mailboxID":"3f5dfd40-41e2-e952-b9bf-95c1b41be15b","uri":"imap://xstreamos/user/gabriele.bulfon/Junk%40xstreamos.org;UIDVALIDITY=1676469851","uidset":"37","pid":13890,"user":"[email protected]","vnd.cmu.mbtype":"el","serverFQDN":"xstreamos","vnd.cmu.mailboxAC <http://gabriele.bulfon/Junk%40xstreamos.org;UIDVALIDITY=1676469851%22,%22uidset%22:%2237%22,%22pid%22:13890,%22user%22:%[email protected]%22,%22vnd.cmu.mbtype%22:%22el%22,%22serverFQDN%22:%22xstreamos%22,%22vnd.cmu.mailboxAC>"
In *imap/notify.c*, data is written to the socket using a buffer sized at 556; in *nodityd/notifyd.c* the buffer at reading is limited to 480 by the following: bufsiz = MIN(bufsiz / 10 - 32, NOTIFY_MAXSIZE);
(https://github.com/cyrusimap/cyrus-imapd/issues/1674)

Applying a little math, for us seems that the value of SO_RCVBUF read by getsockopt is 5120.
So, after patching the two sources, removing the division by 10, MessageMove events come back to work again.

Matteo
------------------------------------------
Cyrus: Info
Permalink: https://cyrus.topicbox.com/groups/info/T84dc31747d015b6c-M2ddf6165dd69930d0cc40487
Delivery options: https://cyrus.topicbox.com/groups/info/subscription
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.