Hi, I've changed a program that fetches mail via IMAP from an Exchange Server to use our Dovecot machine. But now I'm experiencing strange problems with seem to be caused by a wrong BODYSTRUCTURE answer that causes wrong charset handling. When fetchting the BODYSTRUCTURE I see this: Dovecot: 88 UID fetch 32 (BODYSTRUCTURE) * 1 FETCH (UID 32 BODYSTRUCTURE ("text" "plain" ("charset" "us-ascii") NIL NIL "7bit" 725664 9385 NIL NIL NIL NIL)) 88 OK Fetch completed. Exchange: 90 UID fetch 10 (BODYSTRUCTURE) * 2 FETCH (BODYSTRUCTURE (("TEXT" "PLAIN" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 2784 47 NIL NIL NIL)("IMAGE" "JPEG" ("name" "197254.jpg") NIL NIL "BASE64" 498806 NIL ("attachment" ("filename" "197254.jpg")) NIL)("IMAGE" "JPEG" ("name" "197254_1.jpg") NIL NIL "BASE64" 188424 NIL ("attachment" ("filename" "197254_1.jpg")) NIL)("IMAGE" "JPEG" ("name" "197254_2.jpg") NIL NIL "BASE64" 31878 NIL ("attachment" ("filename" "197254_2.jpg")) NIL)("TEXT" "PLAIN" ("name" "pix.xml") NIL NIL "QUOTED-PRINTABLE" 2934 49 NIL ("attachment" ("filename" "pix.xml")) NIL)("TEXT" "PLAIN" ("CHARSET" "US-ASCII") NIL NIL "7BIT" 0 1 NIL ("attachment" NIL) NIL) "mixed" ("Message-ID:" "<d2788bc14788ff16e67e63941937c1e1 at foo.de>" "boundary" "000XMAIL000") NIL NIL) UID 10) 90 OK FETCH completed. Mail contents were: [...] To: blah at foo.de Subject: Pictures From: blah2 at foo.de CC: Errors-To: blah2 at foo.de Sender: foobar at foo.de MIME-Version: 1.0 Content-Type: multipart/mixed; Message-ID:=<d2788bc14788ff16e67e63941937c1e1 at foo.de>; boundary="000XMAIL000" Message-Id: <20090504120233.58AFC346FC at foo.de> Date: Mon, 4 May 2009 14:02:33 +0200 (CEST) --000XMAIL000 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: Quoted-Printable <?xml version=3D"1.0" encoding=3D"ISO-8859-1" ?> <foo> [...] --000XMAIL000 Content-Type: image/jpeg; name="197254.jpg" Content-Transfer-Encoding: Base64 Content-Disposition: attachment; filename="197254.jpg" [...] --000XMAIL000 Content-Type: text/plain; name="pix.xml" Content-Transfer-Encoding: Quoted-Printable Content-Disposition: attachment; filename="pix.xml" <?xml version=3D"1.0" encoding=3D"ISO-8859-1" ?>=0D <blah>=0D [...] Here is my dovecot -n output: # 1.1.14: /etc/dovecot/dovecot.conf # OS: Linux 2.6.21-gentoo-r1 i686 Gentoo Base System release 1.12.11.1 ext3 log_path: /var/log/dovecot protocols: imap imaps pop3 pop3s listen: [::] ssl_cert_file: /etc/ssl/dovecot/server.pem ssl_key_file: /etc/ssl/dovecot/server.key disable_plaintext_auth: no login_dir: /var/run/dovecot/login login_executable(default): /usr/libexec/dovecot/imap-login login_executable(imap): /usr/libexec/dovecot/imap-login login_executable(pop3): /usr/libexec/dovecot/pop3-login mail_privileged_group: vmail mail_location: maildir:/var/mail/%d/%n mail_executable(default): /usr/libexec/dovecot/imap mail_executable(imap): /usr/libexec/dovecot/imap mail_executable(pop3): /usr/libexec/dovecot/pop3 mail_plugin_dir(default): /usr/lib/dovecot/imap mail_plugin_dir(imap): /usr/lib/dovecot/imap mail_plugin_dir(pop3): /usr/lib/dovecot/pop3 auth default: mechanisms: plain login digest-md5 cram-md5 rpa apop username_translation: AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz verbose: yes debug: yes debug_passwords: yes passdb: driver: passwd-file args: /etc/passwd.dovecot userdb: driver: passwd-file args: /etc/passwd.dovecot socket: type: listen client: path: /var/spool/postfix/private/auth mode: 432 user: postfix group: postfix master: path: /var/run/dovecot/auth-master mode: 432 user: root group: vmail So is this a parsing error in dovecot or was the Exchange Server just parsing incorrect MIME-Headers?! Any hint would be appreciated... Thanks in advance, Craig
On Mon, 2009-05-04 at 16:18 +0200, Craig Craig wrote:> Content-Type: multipart/mixed; > Message-ID:=<d2788bc14788ff16e67e63941937c1e1 at foo.de>; > boundary="000XMAIL000"The problem is the Message-ID parameter. It's not legal to have ':' before '='. I added a workaround to v1.2+, but v1.1's code is different and I'd rather not change it much anymore. http://hg.dovecot.org/dovecot-1.2/rev/05a98aaf0aaf -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20090504/70689a40/attachment-0002.bin>
From: Timo Sirainen<tss at iki.fi>> On Mon, 2009-05-04 at 16:18 +0200, Craig Craig wrote: > > Content-Type: multipart/mixed; > > Message-ID:=<d2788bc14788ff16e67e63941937c1e1 at foo.de>; > > boundary="000XMAIL000" > > The problem is the Message-ID parameter. It's not legal to have ':' > before '='. I added a workaround to v1.2+, but v1.1's code is different > and I'd rather not change it much anymore. > > http://hg.dovecot.org/dovecot-1.2/rev/05a98aaf0aaf >Thanks, I had already figured out that it somehow depended on the headers and that helped a lot! :) For the archive: another problem was, that the Message-ID was not unique...and putting it between "Content-Type" and "boundary" does not seem to be a good idea at all... Thanks, Craig