-----Message d'origine-----
De : Bron Gondwana [mailto:br...@fastmail.fm]
Envoyé : vendredi 17 mai 2013 06:19
À : Michel Sébastien; Cyrus Devel
Objet : Re: Message store events notification


On Tue, Sep 20, 2011, at 06:44 PM, Sébastien Michel wrote:
> Hi all,
>
> progress is being made in the rewrite of our code toward the master branch.
> I pushed an update in our github repository, below the changelog :
>
> 1) adding the support of these event types:
> - MessageAppend
> - MessageExpire

> We're looking to use the NEW and APPEND events to send notifications to users 
> including a link which can take them directly to the message.
>
> To do this, we need to know what UID it was given - but looking at the code 
> we have this:
>
> 5f395e9c (Sébastien Michel 2012-08-08 17:33:39 +0200  331) static int 
> mboxevent_expected_param(enum event_type type, enum event_param pa 5f395e9c 
> (Sébastien Michel 2012-08-08 > 17:33:39 +0200  332) { [...]
> 5f395e9c (Sébastien Michel 2012-08-08 17:33:39 +0200  390)     case 
> EVENT_UIDSET:
> 5f395e9c (Sébastien Michel 2012-08-08 17:33:39 +0200  391)      if (type & 
> (EVENT_MESSAGE_NEW|EVENT_MESSAGE_APPEND))
> 5f395e9c (Sébastien Michel 2012-08-08 17:33:39 +0200  392)          return 0;
> 5f395e9c (Sébastien Michel 2012-08-08 17:33:39 +0200  393)      break;
>
> Is there any reason why you don't return the uidset in _NEW or _APPEND?

Yes, it is stated in the RFC 5423 :
> uidset
>      Included with MessageExpires, MessageExpunges, MessageRead,
>      MessageTrash, FlagsSet, and FlagsClear.

>      This includes the set of IMAP UIDs referenced.

Regarding MessageNew (it's the same for MessageAppend) :
>MessageNew
>      A new message was received into a mailbox via a message delivery
>      agent.
>
>     The parameters include a message identifier that, for IMAP-
>      accessible message stores, MUST include UIDVALIDITY and a UID. [...]

> The other place that might make sense is in the URI itself.  What do you 
> think?
You're right, and it is defined as you expect in the RFC :

> uri
>      Included with all notifications.  A reference to the IMAP server,
>      a mailbox, or a message.
>
>      Typically an IMAP URL.  This can include the name of the server
>      used to access the mailbox/message, the mailbox name, the
>      UIDVALIDITY of the mailbox, and the UID of a specific message.

below an example :

{
   "event":"MessageNew",
   "timestamp":"2013-05-14T18:49:48.411+02:00",
  "service":"lmtp",
  "uri":"imap://testsmi@127.0.0.3/INBOX;UIDVALIDITY=1310590327/;UID=84",
  "modseq":140,
  "messages":57,
  "vnd.cmu.unseenMessages":54,
  "uidnext":85,
  "vnd.cmu.midset":["<cmu-lmtpd-30196-1368550188-0@127.0.0.3>"],
  "messageSize":818,
  "bodyStructure":"(\"TEXT\" \"PLAIN\" (\"CHARSET\" \"us-ascii\") NIL NIL 
\"7BIT\" 39 4 NIL NIL NIL NIL)",
  "messageContent": ...
}


Sébastien


Ce message et les pièces jointes sont confidentiels et réservés à l'usage 
exclusif de ses destinataires. Il peut également être protégé par le secret 
professionnel. Si vous recevez ce message par erreur, merci d'en avertir 
immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant 
être assurée sur Internet, la responsabilité d'Atos ne pourra être recherchée 
quant au contenu de ce message. Bien que les meilleurs efforts soient faits 
pour maintenir cette transmission exempte de tout virus, l'expéditeur ne donne 
aucune garantie à cet égard et sa responsabilité ne saurait être recherchée 
pour tout dommage résultant d'un virus transmis.

This e-mail and the documents attached are confidential and intended solely for 
the addressee; it may also be privileged. If you receive this e-mail in error, 
please notify the sender immediately and destroy it. As its integrity cannot be 
secured on the Internet, the Atos liability cannot be triggered for the message 
content. Although the sender endeavours to maintain a computer virus-free 
network, the sender does not warrant that this transmission is virus-free and 
will not be liable for any damages resulting from any virus transmitted.

Reply via email to