Re: event notifier problem

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

 



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":"gabriele.bulfon@xxxxxxxxxxxxx","vnd.cmu.mbtype":"el","serverFQDN":"xstreamos","vnd.cmu.mailboxACL":"gabriele.bulfon@xxxxxxxxxxxxx\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":"gabriele.bulfon@xxxxxxxxxxxxx","vnd.cmu.mbtype":"el","serverFQDN":"xstreamos","vnd.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

[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