=== modified file 'lisp/gnus/nnimap.el' --- lisp/gnus/nnimap.el 2013-01-01 09:11:05 +0000 +++ lisp/gnus/nnimap.el 2013-07-18 03:18:12 +0000 @@ -66,6 +66,11 @@ If nnimap-stream is `ssl', this will default to `imaps'. If not, it will default to `imap'.") +(defvoo nnimap-ext nil + "Defines which extensions are supported by the + server. Currently `x-gm-ext-1' is offered for gmail imap + server. Defaults to nil.") + (defvoo nnimap-stream 'undecided "How nnimap talks to the IMAP server. The value should be either `undecided', `ssl' or `tls', @@ -1060,6 +1065,7 @@ (when (nnimap-possibly-change-group nil server) (nnmail-check-syntax) (let ((message-id (message-field-value "message-id")) + (dt (message-field-value "date")) sequence message) (nnimap-add-cr) (setq message (buffer-substring-no-properties (point-min) (point-max))) @@ -1072,7 +1078,8 @@ (nnimap-unselect-group)) (erase-buffer) (setq sequence (nnimap-send-command - "APPEND %S {%d}" (utf7-encode group t) + "APPEND %S %S {%d}" (utf7-encode group t) + (nnimap-rfc822-date-to-imap4date dt) (length message))) (unless nnimap-streaming (nnimap-wait-for-connection "^[+]")) @@ -1907,6 +1914,8 @@ (nnimap-fetch-inbox new-articles) (nnimap-transform-split-mail) (nnheader-ms-strip-cr) + (when (eq nnimap-ext 'x-gm-ext-1) + (nnimap-wait-for-response (nnimap-send-command "UID STORE %s -X-GM-LABELS (\\Inbox)" (nnimap-article-ranges new-articles)))) (nnmail-cache-open) (nnmail-split-incoming (current-buffer) #'nnimap-save-mail-spec @@ -2044,6 +2053,8 @@ "(OR (OR HEADER Message-Id %S HEADER REFERENCES %S) %s)" refid refid value))))) +(defun nnimap-rfc822-date-to-imap4date (datetime) + (format-time-string "%d-%b-%Y %H:%M:%S %z" (date-to-time datetime))) (provide 'nnimap)