From 0458ea5acb3e93d1548fe6757ccd2d35be5f8ce1 Mon Sep 17 00:00:00 2001 From: idalin Date: Mon, 16 Jan 2017 15:37:42 +0800 Subject: [PATCH] fixed wrong translations. fixed smtp with ssl has no response. --- cps/helper.py | 28 +++++++++++------- .../zh_Hans_CN/LC_MESSAGES/messages.mo | Bin 10769 -> 10775 bytes .../zh_Hans_CN/LC_MESSAGES/messages.po | 4 +-- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/cps/helper.py b/cps/helper.py index e7731fc9..58722ac7 100755 --- a/cps/helper.py +++ b/cps/helper.py @@ -113,13 +113,16 @@ def send_test_mail(kindle_mail): org_stderr = smtplib.stderr smtplib.stderr = StderrLogger() - mailserver = smtplib.SMTP(settings["mail_server"], settings["mail_port"],timeout) + if int(use_ssl) == 1: + mailserver = smtplib.SMTP_SSL(settings["mail_server"], settings["mail_port"], timeout) + else: + mailserver = smtplib.SMTP(settings["mail_server"], settings["mail_port"], timeout) mailserver.set_debuglevel(1) - if int(use_ssl) == 1: - mailserver.ehlo() - mailserver.starttls() - mailserver.ehlo() + # if int(use_ssl) == 1: + # mailserver.ehlo() + # mailserver.starttls() + # mailserver.ehlo() if settings["mail_password"]: mailserver.login(settings["mail_login"], settings["mail_password"]) @@ -150,7 +153,7 @@ def send_mail(book_id, kindle_mail): msg['To'] = kindle_mail msg['Subject'] = _('Send to Kindle') text = _('This email has been sent via calibre web.') - msg.attach(MIMEText(text)) + msg.attach(MIMEText(text.encode('UTF-8'), 'plain', 'UTF-8')) use_ssl = settings.get('mail_use_ssl', 0) @@ -201,13 +204,16 @@ def send_mail(book_id, kindle_mail): org_stderr = smtplib.stderr smtplib.stderr = StderrLogger() - mailserver = smtplib.SMTP(settings["mail_server"], settings["mail_port"],timeout) + if int(use_ssl) == 1: + mailserver = smtplib.SMTP_SSL(settings["mail_server"], settings["mail_port"],timeout) + else: + mailserver = smtplib.SMTP(settings["mail_server"], settings["mail_port"],timeout) mailserver.set_debuglevel(1) - if int(use_ssl) == 1: - mailserver.ehlo() - mailserver.starttls() - mailserver.ehlo() + # if int(use_ssl) == 1: + # mailserver.ehlo() + # mailserver.starttls() + # mailserver.ehlo() if settings["mail_password"]: mailserver.login(settings["mail_login"], settings["mail_password"]) diff --git a/cps/translations/zh_Hans_CN/LC_MESSAGES/messages.mo b/cps/translations/zh_Hans_CN/LC_MESSAGES/messages.mo index 7adcf65b42f38500e97288355253f265eda1d75e..7198e2bbdff3b39c82e2c1ee5842136738aa50ca 100644 GIT binary patch delta 1236 zcmXZaOGwmF6vy$KqvI%6Rx0)|C!aGtNh&izsf7d?1-dBr+9q5$6uscD6loE{grHUs z6A+r#J%ttU24_I7{dBk-VHz6fli^bPa^}8@1{V*&9qizjd&@dB1%Zi&DCuz8}yb1sWN&e+6x z+(z7nsU4$E9LM!IVDS*<62G!|61CwO)B!%B>VC2L1#=Zu@2?r~O8qOzM*R^+Ev&To zAf^!?MK!ENZKM&^um!d50&c~2)QNjgS3QP>_#Ue+LKUntPnqXX z3tCYNE}{zGu>bEPHQi%W-ZUz27FG8v>Ju-b-pm?i<3Hpep35%xCko9{b3fLSSc3t) zgxcU$|44TmkB!VvLW)J8v`)+KQh{zB!aS8xmTcX_FSb5-V9)Q;QDE>wX& zRKX`UKW@&N^X5-8z{?DhUtkuQW#%5tr@yOWpl@~()#x(T<4udFaX0ZtRNf!dl}97~ zt3Hhx#2u&;UO_d!YsPUW@qjsQenw9Xe>2eINsId5YzOMmRG5LNdnZpSxKw;^?7aKSpYD?rjM!-I+}GBt~Y6kAx~$rUsWD syOGvD};Z);G8^JbWx%9_eU}MPnl+k=1qo0jCd+yZ`_I delta 1203 zcmXZaO-NKx7{>9}Z%53`Qp<20$HwlI6(yBYkOdV5v#Hr@2{xSpJG&tnt$f#)&YM4rKQSd)zAZ*g}gL$eq!4td8> zY$5mK(vDFl&f_vHcz%fW>9#N zpbFme{!w?*opyh^3s}kcdTyv}cH?de8(H7FXy~8qLoIX`_uwVZXUZ_ z(XBp+735Q>6Aq#lyyoUHPA<5k?nex@;2aHIo`0x+)|8GeO#)S@7d5UA^<^@i``y#1 zaTnby7$aXtUEYHC-$q@=`?waLr>$=3lTOjWW8aItwZkim@7s1%#}cVv@I)@1OWZ06 K;>94CEBOx<%y%IG diff --git a/cps/translations/zh_Hans_CN/LC_MESSAGES/messages.po b/cps/translations/zh_Hans_CN/LC_MESSAGES/messages.po index 645469d5..0e1233f5 100644 --- a/cps/translations/zh_Hans_CN/LC_MESSAGES/messages.po +++ b/cps/translations/zh_Hans_CN/LC_MESSAGES/messages.po @@ -41,7 +41,7 @@ msgstr "发送到Kindle" #: cps/helper.py:174 cps/helper.py:189 msgid "Could not find any formats suitable for sending by email" -msgstr "无法适合邮件发送的格式" +msgstr "无法找到适合邮件发送的格式" #: cps/helper.py:183 msgid "Could not convert epub to mobi" @@ -156,7 +156,7 @@ msgstr "此书已被成功发给 %(kindlemail)s" #: cps/web.py:1212 #, python-format msgid "There was an error sending this book: %(res)s" -msgstr "发送 %(res)s 这本书的时候出现错误" +msgstr "发送这本书的时候出现错误: %(res)s" #: cps/web.py:1214 msgid "Please configure your kindle email address first..."