A MessageNew event notification is emitted with a uri parameter that contains a shared folder prefix of Shared Folder, unintentionally making Egara believe there is, in fact, such a folder, while the associated folder never contains such artificial prefix.
Description
Details
- Ticket Type
- Task
Status | Assigned | Task | ||
---|---|---|---|---|
Open | • seigo | T45 MessageNew events on shared folders are not logged by egara | ||
Resolved | vanmeeuwen | T92 Superfluous shared namespace prefix in folder uri for shared folder delivery |
Event Timeline
The initial proposal is to change the view as per ticket https://git.cyrus.foundation/T91#1937
The mailboxID parameter is supposed to contain the folder uniqueid, avoiding the need to perform this lookup in Egara.
A new parameter vnd.cmu.mailboxACL available in git master now contains the full ACL for all mailboxes, but the format is going to change from tab-delimited subject\trights\t to json: {'subject':'rights', ...}.
The uri parameter now exclusively holds the administrator view on mailbox hierarchies, such that;
- No more username is prepended to the server part of the uri,
- INBOX becomes user/john.doe@example.org,
- Shared Folders/shared/foo for a user already in @example.org becomes shared/foo@example.org
Failed to test cyrus-imapd-2.5.1-19.1.x86_64. Segfaults with event notifications enabled.
Steps to reproduce and test:
- Enable event notifications for Cyrus (event_notifier: log in /etc/imapd.conf)
- Create a "Shared Mail Folder" in Webadmin enabled for email receiving:
- Folder Name: Collected
- Email Address: collected@example.org
- Recipient(s) Access List: collected@example.org
- IMAP Access Rights: anyone (lrswiptn)
- Log in as regular user john.doe@example.org
- Send a message to collected@example.org
- Trace logs in /var/log/maillog
Expected results:
- Log entry from notifyd with "event":"MessageNew"
- uri paramater of the JSON content starts with imap://<hostname>/shared/Collected%40example.org
The event notification segfaulting on login events should be resolved upstream (by me), so new packages will be forthcoming.
Fix tested and verified in version cyrus-imapd-2.5.2-1.1.x86_64. The following event notification is sent by notifyd:
{ "bodyStructure": "(\"TEXT\" \"PLAIN\" (\"CHARSET\" \"US-ASCII\" \"FORMAT\" \"flowed\") NIL NIL \"7BIT\" 26 1 NIL NIL NIL NIL)", "event": "MessageNew", "mailboxID": "e7c2a56d-6167-477d-b666-1d3a90f7e178", "messageSize": 797, "messages": 1, "modseq": 3, "pid": 20359, "service": "lmtpunix", "timestamp": "2015-05-07T18:24:23.506+02:00", "uidnext": 2, "uri": "imap://kolab34.example.org/shared/Collected%40example.org;UIDVALIDITY=1429518720/;UID=1", "user": "", "vnd.cmu.envelope": "(\"Thu, 07 May 2015 18:24:18 +0200\" \"XXX\" ((\"Doe, John\" NIL \"john.doe\" \"example.org\")) ((\"Doe, John\" NIL \"john.doe\" \"example.org\")) ((\"Doe, John\" NIL \"john.doe\" \"example.org\")) ((NIL NIL \"collected\" \"example.org\")) NIL NIL NIL \"<4329e8f29a3ebb997a90fa355bb0d48c@example.org>\")", "vnd.cmu.midset": [ "<4329e8f29a3ebb997a90fa355bb0d48c@example.org>" ], "vnd.cmu.sessionId": "kolab34.example.org-20359-1431015863-1-8592250803757161183", "vnd.cmu.unseenMessages": 1 }