From 4d4f55a95d1910446dd9f51e791aa5d6b790e725 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 8 Nov 2021 20:33:41 +0530 Subject: [PATCH] Also use ascii filenames for @kindle.com addresses Does no harm since filenames are not visible on Kindles anyway. Hopefully, fixes #1949604 --- src/calibre/gui2/email.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/email.py b/src/calibre/gui2/email.py index d987022edf..f5b81a45f5 100644 --- a/src/calibre/gui2/email.py +++ b/src/calibre/gui2/email.py @@ -149,8 +149,10 @@ def send_mails(jobnames, callback, attachments, to_s, subjects, for name, attachment, to, subject, text, aname in zip(jobnames, attachments, to_s, subjects, texts, attachment_names): description = _('Email %(name)s to %(to)s') % dict(name=name, to=to) - if isinstance(to, str) and '@pbsync.com' in to: + if isinstance(to, str) and ('@pbsync.com' in to or '@kindle.com' in to): # The pbsync service chokes on non-ascii filenames + # Dont know if amazon's service chokes or not, but since filenames + # arent visible on Kindles anyway, might as well be safe aname = ascii_filename(aname) job = ThreadedJob('email', description, gui_sendmail, (attachment, aname, to, subject, text), {}, callback)