[patch] Improved duplicate suppression
kristof.katus at intra2net.com
Thu Jul 21 04:10:12 EDT 2011
We do not think that it is worth the effort to fiddle around with the actual
format of the date. If the Date field is already filled in by the client, it can
be in any format, if the client is misbehaving and not using the standard
format. If it is missing, cyrus will fill it in as far as I can see
-- look for the variable char datestr and the rfc822date_gen function call
in imap/lmtpengine.c:savemsg. Btw, there is another function for converting
dates (cyrus_ctime), but it does not seem to play any role in this context.
Regarding the format of the Date field, the following are against to actually
bother about it:
o Date parsing can be expensive
o It is easier to debug after dumping the delivery database, if the dates in
there are already human readable
o You can md5 the dates before storing them, but it is again hard to debug,
and they are originally should not be that long (my assumption: somewhere
between 30 and 80 char length based solely on the cyrus code base)
Note: if date parsing fails, you would have to store something then as well,
e.g. the generated current date.
Anyway, I will fill an issue in the bug tracker.
On Wednesday, July 20, 2011 11:05:01 AM you wrote:
> You are two to compete for this patch :)
> Your code seems to be good. You can fill an issue in the bug tracker:
> However I have an open question : does the Date field should be stored
> in seconds since epoc to be more compact ?
> 2011/7/20 Kristóf Katus <kristof.katus at intra2net.com>:
> > Hi all,
> > Currently the duplicate suppression mechanism of cyrus-imapd is only
> > based on the Message-Id and the To field of the email header. Some email
> > clients reuse the Message-Id if you resend the same email later on, so
> > the resent email is going to be suppressed by cyrus.
> > The solution for this is to not only store the message-id/mailbox pair in
> > the duplicate delivery database, but also the Date field of the given
> > email (so the message-id/mailbox/date triple is going to be stored). You
> > can find a patch attached, which applies to cyrus-imapd-2.4.10 and
> > solves the problem. This is my first open source contribution, please
> > review my code and tell how I should proceed.
> > I would like to also add, that the altered code paths are all tested (all
> > the modified functions are called at least once during the tests), and a
> > patched cyrus-imapd is currently running on a productive mail server.
> > Best regards,
> > Kristóf Katus
More information about the Cyrus-devel