calibre-smtp fails to attach file with UTF-8 characters

Bug #1098478 reported by Maciej Sitarz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Fix Released
Undecided
Unassigned

Bug Description

Version: 0.9.13 (from bzr)
Operating System: GNU/Linux (Archlinux)

When sending books containing UTF8 characters the attachment name is not properly passed to server.
This causes:
 - Amazon does not recognize the book format and rejects it
 - Thunderbird shows some temporary name of the attachment, instead of the original one

I compared the email got from calibre-smtp with an email created in Thunderbird. Thunderbird encoded the file name differently.
So looks like the problem is caused by attachment name not being properly encoded in the headers.

Original header:
--===============6393381867086729764==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

original no headers
--===============6393381867086729764==
Content-Type: application/x-mobipocket-ebook
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: =?utf-8?q?attachment=3B_filename=3D=22Superjazda=2E_Je?=
 =?utf-8?b?xbpkemnEhyB6IHByenlqZW1ub8WbY2nEhV8gQ3p5IGphemRhIHNhbW9jaG9kZW0g?=
 =?utf-8?q?jest_niebezpieczna=5F=2Emobi=22?=

Attachment name was: "Superjazda. Jeździć z przyjemnością_ Czy jazda samochodem jest niebezpieczna_.mobi"

description: updated
Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1098478

This is not worth the effort for me personally. If some one else wants to implement it, I will be happy to supply any needed guidance. If so, re-open the ticket and we can discuss it.

 status wontfix

Changed in calibre:
status: New → Won't Fix
Revision history for this message
Maciej Sitarz (macieksitarz) wrote :

I added a related branch, it has a fix for this bug (although I'm not sure how to request a pull to trunk).

Fixed mail header:
--===============7685674442027015972==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

two headers
--===============7685674442027015972==
Content-Type: application/x-mobipocket-ebook;
 name="=?utf-8?b?U3VwZXJqYXpkYS4gSmXFumR6acSHIHogcHJ6eWplbW5vxZtjacSFXyBDenkg?=
 =?utf-8?q?jazda_samochodem_jest_niebezpieczna=5F=2Emobi?="
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="=?utf-8?b?U3VwZXJqYXpkYS4gSmXFumR6acSHIHogcHJ6eWplbW5vxZtjacSFXyBDenkg?=
 =?utf-8?q?jazda_samochodem_jest_niebezpieczna=5F=2Emobi?="

description: updated
Revision history for this message
Kovid Goyal (kovid) wrote : Fixed in lp:calibre

Fixed in branch lp:calibre. The fix will be in the next release. calibre is usually released every Friday.

 status fixreleased

Changed in calibre:
status: Won't Fix → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.