SOLVED Dovecot Invalid quoted-printable input trailer

Lyttek

Well-Known Member
Jan 2, 2004
772
4
168
Ran across this issue today, posting for future reference.

User having issues with some emails throwing an error and not loading in webmail clients.

Error as seen by the user when attempting to open an email: 'Could not load message from server'

Error as seen in the logs: Invalid quoted-printable input trailer: '=' not followed by two hex digits

googling only gave me this from a PLESK support forum:
Cause
Email message does not correspond to RFC 2045, section 6.7 "Quoted-Printable Content-Transfer-Encoding".

Resolution
In this situation Dovecot acts in accordance to RFC. Therefore, this is expected behavior.

However, it is possible to cancel the conversion of the sections of the emails into a binary representation on the IMAP server side. To do this use the following instruction:

  1. Connect to the server via SSH.

  2. Add the following line in /etc/dovecot/dovecot.conf: (see note below)

    imap_capability = "IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS MOVE"

  3. Reload Dovecot configuration:

    # service dovecot reload
The original dovecot.conf simply had that line as +NAMESPACE and replacing that with the above line fixed it.
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463

Lyttek

Well-Known Member
Jan 2, 2004
772
4
168
Hello @Lyttek,

Keep in mind you should use the instructions under "Add Dovecot Options" ....
The referenced instructions say:

Add Dovecot options
You can also add options that do not exist in the Configure Dovecot interface to configure the Dovecot mail server. To do this, select the tab that corresponds to the Dovecot template that you wish to modify.

The tabs do not exist on my install??
 

Lyttek

Well-Known Member
Jan 2, 2004
772
4
168
I also attempted to follow those instructions to add the afrementioned text to the main.local file. It did not appear to work, however I may have not added it to the correct location within that file.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
Hi @Lyttek,

You can also add options that do not exist in the Configure Dovecot interface to configure the Dovecot mail server.
This is an error in our documentation. It should instruct you to use the MailServer Configuration interface in Web Host Manager. Documentation case DOC-12241 is open to correct this.

To do this, select the tab that corresponds to the Dovecot template that you wish to modify.

The tabs do not exist on my install??
The document is referring to the tabs below that section of the document, on the document itself (e.g. dovecot.conf, sni.conf).

I also attempted to follow those instructions to add the afrementioned text to the main.local file. It did not appear to work, however I may have not added it to the correct location within that file.
Can you let me know the full steps you took and the exact changes you made?

Thank you.
 

Lyttek

Well-Known Member
Jan 2, 2004
772
4
168
Hi @Lyttek,

Can you let me know the full steps you took and the exact changes you made?
I've edited the main.local file and attempted to place the new imap_capability string (mentioned above) into several different areas, for example:

protocol imap {
imap_capability = "IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS MOVE"
# If nothing happens for this...


or

# Override the IMAP CAPABILITY response. If the value begins with '+',
# add the given capabilities on top of the defaults (e.g. +XFOO XBAR).
[%- IF protocol_imap.imap_capability.defined %]
imap_capability = [% protocol_imap.imap_capability %]
[%- ELSE %]
imap_capability = "IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS MOVE"
[%- END %]


After each edit, I've done the following:

/usr/local/cpanel/scripts/builddovecotconf
service dovecot reload
/scripts/restartsrv_dovecot

Doing all that has no effect.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
Hello @Lyttek,

Could you open a support ticket so we can take a closer look? You can post the ticket number here and we'll link this thread to it.

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
Hello,

To update, here's the answer from one of our Technical Analysts:

First I copied the default template to main.local:

========================================
# cp -v /var/cpanel/templates/dovecot2.3/main.default /var/cpanel/templates/dovecot2.3/main.local
/var/cpanel/templates/dovecot2.3/main.default -> /var/cpanel/templates/dovecot2.3/main.local
========================================

I then changed the entry for line 797, which by default looks like this:

========================================
# grep -n imap_capability /var/cpanel/templates/dovecot2.3/main.local
796:[%- IF protocol_imap.imap_capability.defined %]
797: imap_capability = [% protocol_imap.imap_capability %]
799: #imap_capability =
========================================

After changing it that section of the file looked like this:

========================================
794 # Override the IMAP CAPABILITY response. If the value begins with '+',
795 # add the given capabilities on top of the defaults (e.g. +XFOO XBAR).
796 [%- IF protocol_imap.imap_capability.defined %]
797 imap_capability = "IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS MOVE"
798 [%- ELSE %]
799 #imap_capability =
800 [%- END %]
========================================

I then rebuilt the Dovecot configuration and restarted the service, and I confirmed the new imap_capability was updated in the main Dovecot configuration file.
Thank you.