Page MenuHomePhorge

Superfluous shared namespace prefix in folder uri for shared folder delivery
Closed, ResolvedPublic5 Story Points

Description

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.

Details

Ticket Type
Task

Event Timeline

vanmeeuwen raised the priority of this task from to High.
vanmeeuwen updated the task description. (Show Details)
vanmeeuwen added projects: Restricted Project, Cyrus IMAP.
vanmeeuwen changed Ticket Type from Task to Task.
vanmeeuwen edited a custom field.

Applying this fix would resolve T45.

vanmeeuwen moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Apr 27 2015, 4:25 PM

Differentials 37 and 38 are submitted upstream and resolve this issue in git master head.

@bruederli, @seigo,

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:

  1. Enable event notifications for Cyrus (event_notifier: log in /etc/imapd.conf)
  2. 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)
  3. Log in as regular user john.doe@example.org
  4. Send a message to collected@example.org
  5. 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
bruederli moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.May 8 2015, 9:28 AM
bruederli edited projects, added Sprint Server 201520; removed Restricted Project.May 11 2015, 11:13 AM

The event notification segfaulting on login events should be resolved upstream (by me), so new packages will be forthcoming.

vanmeeuwen claimed this task.
vanmeeuwen moved this task from Backlog to Review on the Sprint Server 201520 board.

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
}