Dont use commas in filenames when sending to pbsync and kindle email addresses

This commit is contained in:
Kovid Goyal 2022-05-28 13:24:35 +05:30
parent 514e61ef13
commit 6a30220c8f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -154,10 +154,10 @@ def send_mails(jobnames, callback, attachments, to_s, subjects,
attachments, to_s, subjects, texts, attachment_names): attachments, to_s, subjects, texts, attachment_names):
description = _('Email %(name)s to %(to)s') % dict(name=name, to=to) description = _('Email %(name)s to %(to)s') % dict(name=name, to=to)
if isinstance(to, str) and ('@pbsync.com' in to or '@kindle.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 # The pbsync service chokes on non-ascii filenames and commas
# Dont know if amazon's service chokes or not, but since filenames # Dont know if amazon's service chokes or not, but since filenames
# arent visible on Kindles anyway, might as well be safe # arent visible on Kindles anyway, might as well be safe
aname = ascii_filename(aname) aname = ascii_filename(aname).replace(',', ' ')
job = ThreadedJob('email', description, gui_sendmail, (attachment, aname, to, job = ThreadedJob('email', description, gui_sendmail, (attachment, aname, to,
subject, text), {}, callback) subject, text), {}, callback)
job_manager.run_threaded_job(job) job_manager.run_threaded_job(job)