[Dovecot] Problem with BODYSTRUCTURE (wrong charset)

Craig Craig craig at haquarter.de
Mon May 4 17:18:17 EEST 2009


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





More information about the dovecot mailing list