mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
88a83daad8
commit
90f9bbbd3c
@ -159,10 +159,12 @@ def send_mails(jobnames, callback, attachments, to_s, subjects,
|
|||||||
# arent visible on Kindles anyway, might as well be safe
|
# arent visible on Kindles anyway, might as well be safe
|
||||||
aname = ascii_filename(aname).replace(',', ' ')
|
aname = ascii_filename(aname).replace(',', ' ')
|
||||||
if '@pbsync.com' in to:
|
if '@pbsync.com' in to:
|
||||||
# pbsync chokes on filenames longer than 64 chars apparently
|
# pbsync chokes on filenames that need to be encoded on
|
||||||
if len(aname) > 64:
|
# multiple lines in the SMTP header
|
||||||
|
limit = 58
|
||||||
|
if len(aname) > limit:
|
||||||
b, ext = os.path.splitext(aname)
|
b, ext = os.path.splitext(aname)
|
||||||
aname = b[:64 - len(aname) - 1] + ext
|
aname = b[:limit - len(aname) - 1] + ext
|
||||||
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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user