]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
pop3c: Added pop3c_quick_received_date setting.
authorTimo Sirainen <tss@iki.fi>
Thu, 19 Dec 2013 02:05:52 +0000 (04:05 +0200)
committerTimo Sirainen <tss@iki.fi>
Thu, 19 Dec 2013 02:05:52 +0000 (04:05 +0200)
With this enabled dsync no longer requires calling TOP for each message to
get the metadata.

src/lib-storage/index/pop3c/pop3c-mail.c
src/lib-storage/index/pop3c/pop3c-settings.c
src/lib-storage/index/pop3c/pop3c-settings.h

index 78eb02da1f84a92f5cd579d8ae2db2a7bf52ba01..82cdd8933fdf289386af18e3615801639d9c21ef 100644 (file)
@@ -4,14 +4,22 @@
 #include "ioloop.h"
 #include "istream.h"
 #include "index-mail.h"
+#include "pop3c-settings.h"
 #include "pop3c-client.h"
 #include "pop3c-sync.h"
 #include "pop3c-storage.h"
 
 static int pop3c_mail_get_received_date(struct mail *_mail, time_t *date_r)
 {
+       struct pop3c_mailbox *mbox = (struct pop3c_mailbox *)_mail->box;
        int tz;
 
+       if (mbox->storage->set->pop3c_quick_received_date) {
+               /* we don't care about the date, just return the current date */
+               *date_r = ioloop_time;
+               return 0;
+       }
+
        /* FIXME: we could also parse the first Received: header and get
           the date from there, but since this code is unlikely to be called
           except during migration, I don't think it really matters. */
index 522e66737ba55320e16902b69d5ece984756d9b8..118c04935128306da75706e00e8ee1f73325ad49 100644 (file)
@@ -25,6 +25,7 @@ static const struct setting_define pop3c_setting_defines[] = {
        DEF(SET_BOOL, pop3c_ssl_verify),
 
        DEF(SET_STR, pop3c_rawlog_dir),
+       DEF(SET_BOOL, pop3c_quick_received_date),
 
        SETTING_DEFINE_LIST_END
 };
@@ -40,7 +41,8 @@ static const struct pop3c_settings pop3c_default_settings = {
        .pop3c_ssl = "no:pop3s:starttls",
        .pop3c_ssl_verify = TRUE,
 
-       .pop3c_rawlog_dir = ""
+       .pop3c_rawlog_dir = "",
+       .pop3c_quick_received_date = FALSE
 };
 
 static const struct setting_parser_info pop3c_setting_parser_info = {
index bfd3c6b151ac5608dbe3f06046a366137576ffe7..da95131259a304028cd88268a45cf321fd2d3b13 100644 (file)
@@ -13,6 +13,7 @@ struct pop3c_settings {
        bool pop3c_ssl_verify;
 
        const char *pop3c_rawlog_dir;
+       bool pop3c_quick_received_date;
 };
 
 const struct setting_parser_info *pop3c_get_setting_parser_info(void);