From cb2d3cb8d529c36fa1819b31313fffe9335d69c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Votruba?= Date: Mon, 2 Mar 2015 16:15:23 +0100 Subject: [PATCH 1/9] travis: PHP 7.0 nightly added + syntax fix to 2 spaces --- .travis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c49dd218..e6c6d34e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,6 @@ language: php php: + - 7.0 - 5.6 - 5.5 - 5.4 @@ -7,8 +8,9 @@ php: - hhvm matrix: - allow_failures: - - php: hhvm + allow_failures: + - php: 7.0 + - php: hhvm before_install: - sudo apt-get update -qq From 19c06512cef079b4b448ed3b59354fab610feb6f Mon Sep 17 00:00:00 2001 From: Synchro Date: Wed, 4 Mar 2015 09:01:01 +0100 Subject: [PATCH 2/9] Scrutinizer fix --- .scrutinizer.yml | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index be706aee..30232809 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -1,8 +1,11 @@ +build: + environment: + php: '5.6.0' + before_commands: - "composer install --prefer-source" tools: - # Code Coverage external_code_coverage: enabled: true timeout: 300 @@ -14,10 +17,8 @@ tools: - 'test/*' - 'vendor/*' - php_code_coverage: enabled: false - test_command: phpunit filter: excluded_paths: - 'docs/*' @@ -26,11 +27,8 @@ tools: - 'test/*' - 'vendor/*' - - # Code Sniffer php_code_sniffer: enabled: true - command: phpcs config: standard: PSR2 sniffs: @@ -45,11 +43,9 @@ tools: - 'test/*' - 'vendor/*' - # Copy/Paste Detector php_cpd: enabled: true - command: phpcpd excluded_dirs: - docs - examples @@ -57,11 +53,9 @@ tools: - test - vendor - # PHP CS Fixer (http://http://cs.sensiolabs.org/). php_cs_fixer: enabled: true - command: php-cs-fixer config: level: psr2 filter: @@ -72,11 +66,9 @@ tools: - 'test/*' - 'vendor/*' - # Analyzes the size and structure of a PHP project. php_loc: enabled: true - command: phploc excluded_dirs: - docs - examples @@ -84,11 +76,9 @@ tools: - test - vendor - # PHP Mess Detector (http://phpmd.org). php_mess_detector: enabled: true - command: phpmd config: rulesets: - codesize @@ -108,7 +98,6 @@ tools: # Analyzes the size and structure of a PHP project. php_pdepend: enabled: true - command: pdepend excluded_dirs: - docs - examples From 541cfec405b450ec8043393b4de768067b007eaf Mon Sep 17 00:00:00 2001 From: Synchro Date: Wed, 4 Mar 2015 10:29:46 +0100 Subject: [PATCH 3/9] More efficient, more readable loops in wrapText Add multibyte wordwrap test phpDoc cleanup in tests --- class.phpmailer.php | 27 ++++++++++------ test/phpmailerTest.php | 73 ++++++++++++++++++++++++++++-------------- 2 files changed, 66 insertions(+), 34 deletions(-) diff --git a/class.phpmailer.php b/class.phpmailer.php index 7c73d3f9..69f5ff1d 100644 --- a/class.phpmailer.php +++ b/class.phpmailer.php @@ -1504,20 +1504,23 @@ class PHPMailer $crlflen = strlen(self::CRLF); $message = $this->fixEOL($message); + //Remove a trailing line break if (substr($message, -$lelen) == $this->LE) { $message = substr($message, 0, -$lelen); } - $line = explode($this->LE, $message); // Magic. We know fixEOL uses $LE + //Split message into lines + $lines = explode($this->LE, $message); + //Message will be rebuilt in here $message = ''; - for ($i = 0; $i < count($line); $i++) { - $line_part = explode(' ', $line[$i]); + foreach ($lines as $line) { + $words = explode(' ', $line); $buf = ''; - for ($e = 0; $e < count($line_part); $e++) { - $word = $line_part[$e]; + $firstword = true; + foreach ($words as $word) { if ($qp_mode and (strlen($word) > $length)) { $space_left = $length - strlen($buf) - $crlflen; - if ($e != 0) { + if (!$firstword) { if ($space_left > 20) { $len = $space_left; if ($is_utf8) { @@ -1559,13 +1562,17 @@ class PHPMailer } } else { $buf_o = $buf; - $buf .= ($e == 0) ? $word : (' ' . $word); + if (!$firstword) { + $buf .= ' '; + } + $buf .= $word; if (strlen($buf) > $length and $buf_o != '') { $message .= $buf_o . $soft_break; $buf = $word; } } + $firstword = false; } $message .= $buf . self::CRLF; } @@ -1726,10 +1733,10 @@ class PHPMailer } // Add custom headers - for ($index = 0; $index < count($this->CustomHeader); $index++) { + foreach ($this->CustomHeader as $header) { $result .= $this->headerLine( - trim($this->CustomHeader[$index][0]), - $this->encodeHeader(trim($this->CustomHeader[$index][1])) + trim($header[0]), + $this->encodeHeader(trim($header[1])) ); } if (!$this->sign_key_file) { diff --git a/test/phpmailerTest.php b/test/phpmailerTest.php index 6486fc11..2fd66e6e 100644 --- a/test/phpmailerTest.php +++ b/test/phpmailerTest.php @@ -304,7 +304,7 @@ class PHPMailerTest extends PHPUnit_Framework_TestCase } /** - * Test CRAM-MD5 authentication + * Test CRAM-MD5 authentication. * Needs a connection to a server that supports this auth mechanism, so commented out by default */ public function testAuthCRAMMD5() @@ -326,7 +326,7 @@ class PHPMailerTest extends PHPUnit_Framework_TestCase } /** - * Test email address validation + * Test email address validation. * Test addresses obtained from http://isemail.info * Some failing cases commented out that are apparently up for debate! */ @@ -646,7 +646,7 @@ class PHPMailerTest extends PHPUnit_Framework_TestCase } /** - * Try a plain message. + * Word-wrap an ASCII message. */ public function testWordWrap() { @@ -668,7 +668,29 @@ class PHPMailerTest extends PHPUnit_Framework_TestCase } /** - * Try a plain message. + * Word-wrap a multibyte message. + */ + public function testWordWrapMultibyte() + { + $this->Mail->WordWrap = 40; + $my_body = str_repeat( + '飛兒樂 團光茫 飛兒樂 團光茫 飛兒樂 團光茫 飛兒樂 團光茫 ' . + '飛飛兒樂 團光茫兒樂 團光茫飛兒樂 團光飛兒樂 團光茫飛兒樂 團光茫兒樂 團光茫 ' . + '飛兒樂 團光茫飛兒樂 團飛兒樂 團光茫光茫飛兒樂 團光茫. ', + 10 + ); + $nBodyLen = strlen($my_body); + $my_body .= "\n\nThis is the above body length: " . $nBodyLen; + + $this->Mail->Body = $my_body; + $this->Mail->Subject .= ': Wordwrap multibyte'; + + $this->buildBody(); + $this->assertTrue($this->Mail->send(), $this->Mail->ErrorInfo); + } + + /** + * Test low priority. */ public function testLowPriority() { @@ -749,7 +771,7 @@ class PHPMailerTest extends PHPUnit_Framework_TestCase } /** - * Try a plain message. + * Send an HTML message. */ public function testHtml() { @@ -925,7 +947,7 @@ EOT; } /** - * iCal event test + * iCal event test. */ public function testIcal() { @@ -993,7 +1015,7 @@ EOT; } /** - * Test sending multiple messages with separate connections + * Test sending multiple messages with separate connections. */ public function testMultipleSend() { @@ -1010,7 +1032,7 @@ EOT; } /** - * Test sending using SendMail + * Test sending using SendMail. */ public function testSendmailSend() { @@ -1024,7 +1046,7 @@ EOT; } /** - * Test sending using Qmail + * Test sending using Qmail. */ public function testQmailSend() { @@ -1043,7 +1065,7 @@ EOT; } /** - * Test sending using PHP mail() function + * Test sending using PHP mail() function. */ public function testMailSend() { @@ -1060,7 +1082,7 @@ EOT; } /** - * Test sending an empty body + * Test sending an empty body. */ public function testEmptyBody() { @@ -1075,7 +1097,7 @@ EOT; } /** - * Test keepalive (sending multiple messages in a single connection) + * Test keepalive (sending multiple messages in a single connection). */ public function testSmtpKeepAlive() { @@ -1119,7 +1141,7 @@ EOT; } /** - * Test error handling + * Test error handling. */ public function testError() { @@ -1135,7 +1157,7 @@ EOT; } /** - * Test addressing + * Test addressing. */ public function testAddressing() { @@ -1166,7 +1188,7 @@ EOT; } /** - * Test address escaping + * Test address escaping. */ public function testAddressEscaping() { @@ -1181,7 +1203,7 @@ EOT; } /** - * Test BCC-only addressing + * Test BCC-only addressing. */ public function testBCCAddressing() { @@ -1193,7 +1215,7 @@ EOT; } /** - * Encoding and charset tests + * Encoding and charset tests. */ public function testEncodings() { @@ -1227,6 +1249,9 @@ EOT; ); } + /** + * Test base-64 encoding. + */ public function testBase64() { $this->Mail->Subject .= ': Base-64 encoding'; @@ -1235,7 +1260,7 @@ EOT; $this->assertTrue($this->Mail->send(), 'Base64 encoding failed'); } /** - * S/MIME Signing tests + * S/MIME Signing tests. */ public function testSigning() { @@ -1280,7 +1305,7 @@ EOT; } /** - * DKIM Signing tests + * DKIM Signing tests. */ public function testDKIM() { @@ -1307,7 +1332,7 @@ EOT; } /** - * Test line break reformatting + * Test line break reformatting. */ public function testLineBreaks() { @@ -1323,7 +1348,7 @@ EOT; } /** - * Test setting and retrieving message ID + * Test setting and retrieving message ID. */ public function testMessageID() { @@ -1337,7 +1362,7 @@ EOT; } /** - * Miscellaneous calls to improve test coverage and some small tests + * Miscellaneous calls to improve test coverage and some small tests. */ public function testMiscellaneous() { @@ -1379,7 +1404,7 @@ EOT; } /** - * Use a fake POP3 server to test POP-before-SMTP auth + * Use a fake POP3 server to test POP-before-SMTP auth. * With a known-good login */ public function testPopBeforeSmtpGood() @@ -1400,7 +1425,7 @@ EOT; } /** - * Use a fake POP3 server to test POP-before-SMTP auth + * Use a fake POP3 server to test POP-before-SMTP auth. * With a known-bad login */ public function testPopBeforeSmtpBad() From 073bf148fb1561b2612d81a71d89f4e220f73485 Mon Sep 17 00:00:00 2001 From: Synchro Date: Wed, 4 Mar 2015 10:30:21 +0100 Subject: [PATCH 4/9] changelog --- changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.md b/changelog.md index 85fbda03..af90aa18 100644 --- a/changelog.md +++ b/changelog.md @@ -17,6 +17,7 @@ * Add Bulgarian translation (Thanks to @mialy) * Add Armenian translation (Thanks to Hrayr Grigoryan) * Add Slovenian translation (Thanks to Klemen Tušar) +* More efficient word wrapping ## Version 5.2.9 (Sept 25th 2014) * **Important: The autoloader is no longer autoloaded by the PHPMailer class** From de664ae9ae4581e1b6d83aec185d2a7ddc0d8269 Mon Sep 17 00:00:00 2001 From: Synchro Date: Wed, 4 Mar 2015 10:32:00 +0100 Subject: [PATCH 5/9] changelog --- changelog.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index af90aa18..a119b0ba 100644 --- a/changelog.md +++ b/changelog.md @@ -8,7 +8,8 @@ * Avoid `error_log` Debugoutput naming clash * Add ability to parse server capabilities in response to EHLO (useful for SendGrid etc) * Amended default values for WordWrap to match RFC -* Remove html2text converter class, provide new mechanism for injecting converters +* Remove html2text converter class (has incompatible license) +* Provide new mechanism for injecting html to text converters * Improve pointers to docs and support in README * Add example file upload script * Refactor and major cleanup of EasyPeasyICS, now a lot more usable From ec9148b67331b91923b3cfa9268345ba98ffe24d Mon Sep 17 00:00:00 2001 From: Synchro Date: Wed, 4 Mar 2015 11:18:01 +0100 Subject: [PATCH 6/9] Clean up indenting --- language/phpmailer.lang-bg.php | 36 +++++++++++++++---------------- language/phpmailer.lang-ch.php | 24 ++++++++++----------- language/phpmailer.lang-de.php | 2 +- language/phpmailer.lang-el.php | 2 +- language/phpmailer.lang-et.php | 2 +- language/phpmailer.lang-fi.php | 2 +- language/phpmailer.lang-fo.php | 2 +- language/phpmailer.lang-it.php | 2 +- language/phpmailer.lang-ja.php | 24 ++++++++++----------- language/phpmailer.lang-ka.php | 36 +++++++++++++++---------------- language/phpmailer.lang-ru.php | 2 +- language/phpmailer.lang-se.php | 2 +- language/phpmailer.lang-sk.php | 2 +- language/phpmailer.lang-vi.php | 34 ++++++++++++++--------------- language/phpmailer.lang-zh.php | 26 +++++++++++----------- language/phpmailer.lang-zh_cn.php | 24 ++++++++++----------- 16 files changed, 111 insertions(+), 111 deletions(-) diff --git a/language/phpmailer.lang-bg.php b/language/phpmailer.lang-bg.php index 57ffe197..76fce706 100644 --- a/language/phpmailer.lang-bg.php +++ b/language/phpmailer.lang-bg.php @@ -5,21 +5,21 @@ * @author Mikhail Kyosev */ -$PHPMAILER_LANG['authenticate'] = 'SMTP грешка: Не може да се удостовери пред сървъра.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP грешка: Не може да се свърже с SMTP хоста.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP грешка: данните не са приети.'; -$PHPMAILER_LANG['empty_message'] = 'Съдържанието на съобщението е празно'; -$PHPMAILER_LANG['encoding'] = 'Неизвестно кодиране: '; -$PHPMAILER_LANG['execute'] = 'Не може да се изпълни: '; -$PHPMAILER_LANG['file_access'] = 'Няма достъп до файл: '; -$PHPMAILER_LANG['file_open'] = 'Файлова грешка: Не може да се отвори файл: '; -$PHPMAILER_LANG['from_failed'] = 'Следните адреси за подател са невалидни: '; -$PHPMAILER_LANG['instantiate'] = 'Не може да се инстанцира функцията mail.'; -$PHPMAILER_LANG['invalid_address'] = 'Невалиден адрес'; -$PHPMAILER_LANG['mailer_not_supported'] = ' - пощенски сървър не се поддържа.'; -$PHPMAILER_LANG['provide_address'] = 'Трябва да предоставите поне един email адрес за получател.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP грешка: Следните адреси за Получател са невалидни: '; -$PHPMAILER_LANG['signing'] = 'Грешка при подписване: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP провален connect().'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP сървърна грешка: '; -$PHPMAILER_LANG['variable_set'] = 'Не може да се установи или възстанови променлива: '; +$PHPMAILER_LANG['authenticate'] = 'SMTP грешка: Не може да се удостовери пред сървъра.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP грешка: Не може да се свърже с SMTP хоста.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP грешка: данните не са приети.'; +$PHPMAILER_LANG['empty_message'] = 'Съдържанието на съобщението е празно'; +$PHPMAILER_LANG['encoding'] = 'Неизвестно кодиране: '; +$PHPMAILER_LANG['execute'] = 'Не може да се изпълни: '; +$PHPMAILER_LANG['file_access'] = 'Няма достъп до файл: '; +$PHPMAILER_LANG['file_open'] = 'Файлова грешка: Не може да се отвори файл: '; +$PHPMAILER_LANG['from_failed'] = 'Следните адреси за подател са невалидни: '; +$PHPMAILER_LANG['instantiate'] = 'Не може да се инстанцира функцията mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Невалиден адрес'; +$PHPMAILER_LANG['mailer_not_supported'] = ' - пощенски сървър не се поддържа.'; +$PHPMAILER_LANG['provide_address'] = 'Трябва да предоставите поне един email адрес за получател.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP грешка: Следните адреси за Получател са невалидни: '; +$PHPMAILER_LANG['signing'] = 'Грешка при подписване: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP провален connect().'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP сървърна грешка: '; +$PHPMAILER_LANG['variable_set'] = 'Не може да се установи или възстанови променлива: '; diff --git a/language/phpmailer.lang-ch.php b/language/phpmailer.lang-ch.php index 70d7a63a..1b5c6d17 100644 --- a/language/phpmailer.lang-ch.php +++ b/language/phpmailer.lang-ch.php @@ -5,20 +5,20 @@ * @author LiuXin */ -$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:身份验证失败。'; -$PHPMAILER_LANG['connect_host'] = 'SMTP 错误: 不能连接SMTP主机。'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误: 数据不可接受。'; +$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:身份验证失败。'; +$PHPMAILER_LANG['connect_host'] = 'SMTP 错误: 不能连接SMTP主机。'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误: 数据不可接受。'; //$PHPMAILER_LANG['empty_message'] = 'Message body empty'; -$PHPMAILER_LANG['encoding'] = '未知编码:'; -$PHPMAILER_LANG['execute'] = '不能执行: '; -$PHPMAILER_LANG['file_access'] = '不能访问文件:'; -$PHPMAILER_LANG['file_open'] = '文件错误:不能打开文件:'; -$PHPMAILER_LANG['from_failed'] = '下面的发送地址邮件发送失败了: '; -$PHPMAILER_LANG['instantiate'] = '不能实现mail方法。'; -//$PHPMAILER_LANG['invalid_address'] = 'Not sending, email address is invalid: '; +$PHPMAILER_LANG['encoding'] = '未知编码:'; +$PHPMAILER_LANG['execute'] = '不能执行: '; +$PHPMAILER_LANG['file_access'] = '不能访问文件:'; +$PHPMAILER_LANG['file_open'] = '文件错误:不能打开文件:'; +$PHPMAILER_LANG['from_failed'] = '下面的发送地址邮件发送失败了: '; +$PHPMAILER_LANG['instantiate'] = '不能实现mail方法。'; +//$PHPMAILER_LANG['invalid_address'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['mailer_not_supported'] = ' 您所选择的发送邮件的方法并不支持。'; -$PHPMAILER_LANG['provide_address'] = '您必须提供至少一个 收信人的email地址。'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误: 下面的 收件人失败了: '; +$PHPMAILER_LANG['provide_address'] = '您必须提供至少一个 收信人的email地址。'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误: 下面的 收件人失败了: '; //$PHPMAILER_LANG['signing'] = 'Signing Error: '; //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; //$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; diff --git a/language/phpmailer.lang-de.php b/language/phpmailer.lang-de.php index 1386208d..174f178f 100644 --- a/language/phpmailer.lang-de.php +++ b/language/phpmailer.lang-de.php @@ -14,7 +14,7 @@ $PHPMAILER_LANG['file_access'] = 'Zugriff auf folgende Datei fehlgeschl $PHPMAILER_LANG['file_open'] = 'Datei Fehler: konnte folgende Datei nicht öffnen: '; $PHPMAILER_LANG['from_failed'] = 'Die folgende Absenderadresse ist nicht korrekt: '; $PHPMAILER_LANG['instantiate'] = 'Mail Funktion konnte nicht initialisiert werden.'; -$PHPMAILER_LANG['invalid_address'] = 'E-Mail wird nicht gesendet, die Adresse ist ungültig.'; +$PHPMAILER_LANG['invalid_address'] = 'E-Mail wird nicht gesendet, die Adresse ist ungültig.'; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer wird nicht unterstützt.'; $PHPMAILER_LANG['provide_address'] = 'Bitte geben Sie mindestens eine Empfänger E-Mailadresse an.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP Fehler: Die folgenden Empfänger sind nicht korrekt: '; diff --git a/language/phpmailer.lang-el.php b/language/phpmailer.lang-el.php index abd2cb92..a85e10ca 100644 --- a/language/phpmailer.lang-el.php +++ b/language/phpmailer.lang-el.php @@ -14,7 +14,7 @@ $PHPMAILER_LANG['file_access'] = 'Αδυναμία προσπέλαση $PHPMAILER_LANG['file_open'] = 'Σφάλμα Αρχείου: Δεν είναί δυνατό το άνοιγμα του ακόλουθου αρχείου: '; $PHPMAILER_LANG['from_failed'] = 'Η παρακάτω διεύθυνση αποστολέα δεν είναι σωστή: '; $PHPMAILER_LANG['instantiate'] = 'Αδυναμία εκκίνησης Mail function.'; -$PHPMAILER_LANG['invalid_address'] = 'Το μήνυμα δεν αποστέλθηκε, η διεύθυνση δεν είναι έγκυρη.'; +$PHPMAILER_LANG['invalid_address'] = 'Το μήνυμα δεν αποστέλθηκε, η διεύθυνση δεν είναι έγκυρη.'; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer δεν υποστηρίζεται.'; $PHPMAILER_LANG['provide_address'] = 'Παρακαλούμε δώστε τουλάχιστον μια e-mail διεύθυνση παραλήπτη.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP Σφάλμα: Οι παρακάτων διευθύνσεις παραλήπτη δεν είναι έγκυρες: '; diff --git a/language/phpmailer.lang-et.php b/language/phpmailer.lang-et.php index ceb1aab1..4bb51862 100644 --- a/language/phpmailer.lang-et.php +++ b/language/phpmailer.lang-et.php @@ -16,7 +16,7 @@ $PHPMAILER_LANG['file_access'] = 'Pole piisavalt õiguseid järgneva fa $PHPMAILER_LANG['file_open'] = 'Faili Viga: Faili avamine ebaõnnestus: '; $PHPMAILER_LANG['from_failed'] = 'Järgnev saatja e-posti aadress on vigane: '; $PHPMAILER_LANG['instantiate'] = 'mail funktiooni käivitamine ebaõnnestus.'; -$PHPMAILER_LANG['invalid_address'] = 'Saatmine peatatud, e-posti address vigane: '; +$PHPMAILER_LANG['invalid_address'] = 'Saatmine peatatud, e-posti address vigane: '; $PHPMAILER_LANG['provide_address'] = 'Te peate määrama vähemalt ühe saaja e-posti aadressi.'; $PHPMAILER_LANG['mailer_not_supported'] = ' maileri tugi puudub.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP Viga: Järgnevate saajate e-posti aadressid on vigased: '; diff --git a/language/phpmailer.lang-fi.php b/language/phpmailer.lang-fi.php index 6533110f..d09241ff 100644 --- a/language/phpmailer.lang-fi.php +++ b/language/phpmailer.lang-fi.php @@ -15,7 +15,7 @@ $PHPMAILER_LANG['file_access'] = 'Seuraavaan tiedostoon ei ole oikeuksi $PHPMAILER_LANG['file_open'] = 'Tiedostovirhe: Ei voida avata tiedostoa: '; $PHPMAILER_LANG['from_failed'] = 'Seuraava lähettäjän osoite on virheellinen: '; $PHPMAILER_LANG['instantiate'] = 'mail-funktion luonti epäonnistui.'; -//$PHPMAILER_LANG['invalid_address'] = 'Not sending, email address is invalid: '; +//$PHPMAILER_LANG['invalid_address'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['mailer_not_supported'] = 'postivälitintyyppiä ei tueta.'; $PHPMAILER_LANG['provide_address'] = 'Aseta vähintään yksi vastaanottajan sähköpostiosoite.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP-virhe: seuraava vastaanottaja osoite on virheellinen.'; diff --git a/language/phpmailer.lang-fo.php b/language/phpmailer.lang-fo.php index 97e2a007..6240b407 100644 --- a/language/phpmailer.lang-fo.php +++ b/language/phpmailer.lang-fo.php @@ -15,7 +15,7 @@ $PHPMAILER_LANG['file_access'] = 'Kundi ikki tilganga fílu: '; $PHPMAILER_LANG['file_open'] = 'Fílu feilur: Kundi ikki opna fílu: '; $PHPMAILER_LANG['from_failed'] = 'fylgjandi Frá/From adressa miseydnaðist: '; $PHPMAILER_LANG['instantiate'] = 'Kuni ikki instantiera mail funktión.'; -//$PHPMAILER_LANG['invalid_address'] = 'Not sending, email address is invalid: '; +//$PHPMAILER_LANG['invalid_address'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['mailer_not_supported'] = ' er ikki supporterað.'; $PHPMAILER_LANG['provide_address'] = 'Tú skal uppgeva minst móttakara-emailadressu(r).'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP Feilur: Fylgjandi móttakarar miseydnaðust: '; diff --git a/language/phpmailer.lang-it.php b/language/phpmailer.lang-it.php index 59649d53..40f0b1bc 100644 --- a/language/phpmailer.lang-it.php +++ b/language/phpmailer.lang-it.php @@ -16,7 +16,7 @@ $PHPMAILER_LANG['file_access'] = 'Impossibile accedere al file: '; $PHPMAILER_LANG['file_open'] = 'File Error: Impossibile aprire il file: '; $PHPMAILER_LANG['from_failed'] = 'I seguenti indirizzi mittenti hanno generato errore: '; $PHPMAILER_LANG['instantiate'] = 'Impossibile istanziare la funzione mail'; -$PHPMAILER_LANG['invalid_address'] = 'Impossibile inviare, l\'indirizzo email non è valido: '; +$PHPMAILER_LANG['invalid_address'] = 'Impossibile inviare, l\'indirizzo email non è valido: '; $PHPMAILER_LANG['provide_address'] = 'Deve essere fornito almeno un indirizzo ricevente'; $PHPMAILER_LANG['mailer_not_supported'] = 'Mailer non supportato'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: I seguenti indirizzi destinatari hanno generato un errore: '; diff --git a/language/phpmailer.lang-ja.php b/language/phpmailer.lang-ja.php index d5423da4..a7aa193e 100644 --- a/language/phpmailer.lang-ja.php +++ b/language/phpmailer.lang-ja.php @@ -6,20 +6,20 @@ * @author Yoshi Sakai */ -$PHPMAILER_LANG['authenticate'] = 'SMTPエラー: 認証できませんでした。'; -$PHPMAILER_LANG['connect_host'] = 'SMTPエラー: SMTPホストに接続できませんでした。'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTPエラー: データが受け付けられませんでした。'; +$PHPMAILER_LANG['authenticate'] = 'SMTPエラー: 認証できませんでした。'; +$PHPMAILER_LANG['connect_host'] = 'SMTPエラー: SMTPホストに接続できませんでした。'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTPエラー: データが受け付けられませんでした。'; //$PHPMAILER_LANG['empty_message'] = 'Message body empty'; -$PHPMAILER_LANG['encoding'] = '不明なエンコーディング: '; -$PHPMAILER_LANG['execute'] = '実行できませんでした: '; -$PHPMAILER_LANG['file_access'] = 'ファイルにアクセスできません: '; -$PHPMAILER_LANG['file_open'] = 'ファイルエラー: ファイルを開けません: '; -$PHPMAILER_LANG['from_failed'] = 'Fromアドレスを登録する際にエラーが発生しました: '; -$PHPMAILER_LANG['instantiate'] = 'メール関数が正常に動作しませんでした。'; -//$PHPMAILER_LANG['invalid_address'] = 'Not sending, email address is invalid: '; -$PHPMAILER_LANG['provide_address'] = '少なくとも1つメールアドレスを 指定する必要があります。'; +$PHPMAILER_LANG['encoding'] = '不明なエンコーディング: '; +$PHPMAILER_LANG['execute'] = '実行できませんでした: '; +$PHPMAILER_LANG['file_access'] = 'ファイルにアクセスできません: '; +$PHPMAILER_LANG['file_open'] = 'ファイルエラー: ファイルを開けません: '; +$PHPMAILER_LANG['from_failed'] = 'Fromアドレスを登録する際にエラーが発生しました: '; +$PHPMAILER_LANG['instantiate'] = 'メール関数が正常に動作しませんでした。'; +//$PHPMAILER_LANG['invalid_address'] = 'Not sending, email address is invalid: '; +$PHPMAILER_LANG['provide_address'] = '少なくとも1つメールアドレスを 指定する必要があります。'; $PHPMAILER_LANG['mailer_not_supported'] = ' メーラーがサポートされていません。'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTPエラー: 次の受信者アドレスに 間違いがあります: '; +$PHPMAILER_LANG['recipients_failed'] = 'SMTPエラー: 次の受信者アドレスに 間違いがあります: '; //$PHPMAILER_LANG['signing'] = 'Signing Error: '; //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; //$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; diff --git a/language/phpmailer.lang-ka.php b/language/phpmailer.lang-ka.php index e5b6b57b..6dec7ceb 100644 --- a/language/phpmailer.lang-ka.php +++ b/language/phpmailer.lang-ka.php @@ -5,21 +5,21 @@ * @author Avtandil Kikabidze aka LONGMAN */ -$PHPMAILER_LANG['authenticate'] = 'SMTP შეცდომა: ავტორიზაცია შეუძლებელია.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP შეცდომა: SMTP სერვერთან დაკავშირება შეუძლებელია.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP შეცდომა: მონაცემები არ იქნა მიღებული.'; -$PHPMAILER_LANG['encoding'] = 'კოდირების უცნობი ტიპი: '; -$PHPMAILER_LANG['execute'] = 'შეუძლებელია შემდეგი ბრძანების შესრულება: '; -$PHPMAILER_LANG['file_access'] = 'შეუძლებელია წვდომა ფაილთან: '; -$PHPMAILER_LANG['file_open'] = 'ფაილური სისტემის შეცდომა: არ იხსნება ფაილი: '; -$PHPMAILER_LANG['from_failed'] = 'გამგზავნის არასწორი მისამართი: '; -$PHPMAILER_LANG['instantiate'] = 'mail ფუნქციის გაშვება ვერ ხერხდება.'; -$PHPMAILER_LANG['provide_address'] = 'გთხოვთ მიუთითოთ ერთი ადრესატის e-mail მისამართი მაინც.'; -$PHPMAILER_LANG['mailer_not_supported'] = ' - საფოსტო სერვერის მხარდაჭერა არ არის.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP შეცდომა: შემდეგ მისამართებზე გაგზავნა ვერ მოხერხდა: '; -$PHPMAILER_LANG['empty_message'] = 'შეტყობინება ცარიელია'; -$PHPMAILER_LANG['invalid_address'] = 'არ გაიგზავნა, e-mail მისამართის არასწორი ფორმატი: '; -$PHPMAILER_LANG['signing'] = 'ხელმოწერის შეცდომა: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'შეცდომა SMTP სერვერთან დაკავშირებისას'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP სერვერის შეცდომა: '; -$PHPMAILER_LANG['variable_set'] = 'შეუძლებელია შემდეგი ცვლადის შექმნა ან შეცვლა: '; +$PHPMAILER_LANG['authenticate'] = 'SMTP შეცდომა: ავტორიზაცია შეუძლებელია.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP შეცდომა: SMTP სერვერთან დაკავშირება შეუძლებელია.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP შეცდომა: მონაცემები არ იქნა მიღებული.'; +$PHPMAILER_LANG['encoding'] = 'კოდირების უცნობი ტიპი: '; +$PHPMAILER_LANG['execute'] = 'შეუძლებელია შემდეგი ბრძანების შესრულება: '; +$PHPMAILER_LANG['file_access'] = 'შეუძლებელია წვდომა ფაილთან: '; +$PHPMAILER_LANG['file_open'] = 'ფაილური სისტემის შეცდომა: არ იხსნება ფაილი: '; +$PHPMAILER_LANG['from_failed'] = 'გამგზავნის არასწორი მისამართი: '; +$PHPMAILER_LANG['instantiate'] = 'mail ფუნქციის გაშვება ვერ ხერხდება.'; +$PHPMAILER_LANG['provide_address'] = 'გთხოვთ მიუთითოთ ერთი ადრესატის e-mail მისამართი მაინც.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' - საფოსტო სერვერის მხარდაჭერა არ არის.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP შეცდომა: შემდეგ მისამართებზე გაგზავნა ვერ მოხერხდა: '; +$PHPMAILER_LANG['empty_message'] = 'შეტყობინება ცარიელია'; +$PHPMAILER_LANG['invalid_address'] = 'არ გაიგზავნა, e-mail მისამართის არასწორი ფორმატი: '; +$PHPMAILER_LANG['signing'] = 'ხელმოწერის შეცდომა: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'შეცდომა SMTP სერვერთან დაკავშირებისას'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP სერვერის შეცდომა: '; +$PHPMAILER_LANG['variable_set'] = 'შეუძლებელია შემდეგი ცვლადის შექმნა ან შეცვლა: '; diff --git a/language/phpmailer.lang-ru.php b/language/phpmailer.lang-ru.php index 83abda48..b4e40a8f 100644 --- a/language/phpmailer.lang-ru.php +++ b/language/phpmailer.lang-ru.php @@ -18,7 +18,7 @@ $PHPMAILER_LANG['provide_address'] = 'Пожалуйста, введите $PHPMAILER_LANG['mailer_not_supported'] = ' - почтовый сервер не поддерживается.'; $PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: отправка по следующим адресам получателей не удалась: '; $PHPMAILER_LANG['empty_message'] = 'Пустое тело сообщения'; -$PHPMAILER_LANG['invalid_address'] = 'Не отослано, неправильный формат email адреса: '; +$PHPMAILER_LANG['invalid_address'] = 'Не отослано, неправильный формат email адреса: '; $PHPMAILER_LANG['signing'] = 'Ошибка подписывания: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'Ошибка соединения с SMTP-сервером'; $PHPMAILER_LANG['smtp_error'] = 'Ошибка SMTP-сервера: '; diff --git a/language/phpmailer.lang-se.php b/language/phpmailer.lang-se.php index 2f1c05ac..299f76f9 100644 --- a/language/phpmailer.lang-se.php +++ b/language/phpmailer.lang-se.php @@ -15,7 +15,7 @@ $PHPMAILER_LANG['file_access'] = 'Ingen åtkomst till fil: '; $PHPMAILER_LANG['file_open'] = 'Fil fel: Kunde inte öppna fil: '; $PHPMAILER_LANG['from_failed'] = 'Följande avsändaradress är felaktig: '; $PHPMAILER_LANG['instantiate'] = 'Kunde inte initiera e-postfunktion.'; -//$PHPMAILER_LANG['invalid_address'] = 'Not sending, email address is invalid: '; +//$PHPMAILER_LANG['invalid_address'] = 'Not sending, email address is invalid: '; $PHPMAILER_LANG['provide_address'] = 'Du måste ange minst en mottagares e-postadress.'; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer stöds inte.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP fel: Följande mottagare är felaktig: '; diff --git a/language/phpmailer.lang-sk.php b/language/phpmailer.lang-sk.php index 5c3c12e1..ad8e857e 100644 --- a/language/phpmailer.lang-sk.php +++ b/language/phpmailer.lang-sk.php @@ -15,7 +15,7 @@ $PHPMAILER_LANG['file_access'] = 'Súbor nebol nájdený: '; $PHPMAILER_LANG['file_open'] = 'File Error: Súbor sa otvoriť pre čítanie: '; $PHPMAILER_LANG['from_failed'] = 'Následujúca adresa From je nesprávna: '; $PHPMAILER_LANG['instantiate'] = 'Nedá sa vytvoriť inštancia emailovej funkcie.'; -$PHPMAILER_LANG['invalid_address'] = 'Neodoslané, emailová adresa je nesprávna: '; +$PHPMAILER_LANG['invalid_address'] = 'Neodoslané, emailová adresa je nesprávna: '; $PHPMAILER_LANG['mailer_not_supported'] = ' emailový klient nieje podporovaný.'; $PHPMAILER_LANG['provide_address'] = 'Musíte zadať aspoň jednu emailovú adresu príjemcu.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Adresy príjemcov niesu správne '; diff --git a/language/phpmailer.lang-vi.php b/language/phpmailer.lang-vi.php index 00f741f3..66c51175 100644 --- a/language/phpmailer.lang-vi.php +++ b/language/phpmailer.lang-vi.php @@ -5,21 +5,21 @@ * @author VINADES.,JSC */ -$PHPMAILER_LANG['authenticate'] = 'Lỗi SMTP: Không thể xác thực.'; -$PHPMAILER_LANG['connect_host'] = 'Lỗi SMTP: Không thể kết nối máy chủ SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Lỗi SMTP: Dữ liệu không được chấp nhận.'; -$PHPMAILER_LANG['empty_message'] = 'Không có nội dung'; -$PHPMAILER_LANG['encoding'] = 'Mã hóa không xác định: '; -$PHPMAILER_LANG['execute'] = 'Không thực hiện được: '; -$PHPMAILER_LANG['file_access'] = 'Không thể truy cập tệp tin '; -$PHPMAILER_LANG['file_open'] = 'Lỗi Tập tin: Không thể mở tệp tin: '; -$PHPMAILER_LANG['from_failed'] = 'Lỗi địa chỉ gửi đi: '; -$PHPMAILER_LANG['instantiate'] = 'Không dùng được các hàm gửi thư.'; -$PHPMAILER_LANG['invalid_address'] = 'Đại chỉ emai không đúng'; +$PHPMAILER_LANG['authenticate'] = 'Lỗi SMTP: Không thể xác thực.'; +$PHPMAILER_LANG['connect_host'] = 'Lỗi SMTP: Không thể kết nối máy chủ SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Lỗi SMTP: Dữ liệu không được chấp nhận.'; +$PHPMAILER_LANG['empty_message'] = 'Không có nội dung'; +$PHPMAILER_LANG['encoding'] = 'Mã hóa không xác định: '; +$PHPMAILER_LANG['execute'] = 'Không thực hiện được: '; +$PHPMAILER_LANG['file_access'] = 'Không thể truy cập tệp tin '; +$PHPMAILER_LANG['file_open'] = 'Lỗi Tập tin: Không thể mở tệp tin: '; +$PHPMAILER_LANG['from_failed'] = 'Lỗi địa chỉ gửi đi: '; +$PHPMAILER_LANG['instantiate'] = 'Không dùng được các hàm gửi thư.'; +$PHPMAILER_LANG['invalid_address'] = 'Đại chỉ emai không đúng'; $PHPMAILER_LANG['mailer_not_supported'] = ' trình gửi thư không được hỗ trợ.'; -$PHPMAILER_LANG['provide_address'] = 'Bạn phải cung cấp ít nhất một địa chỉ người nhận.'; -$PHPMAILER_LANG['recipients_failed'] = 'Lỗi SMTP: lỗi địa chỉ người nhận: '; -$PHPMAILER_LANG['signing'] = 'Lỗi đăng nhập: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Lỗi kết nối với SMTP'; -$PHPMAILER_LANG['smtp_error'] = 'Lỗi máy chủ smtp '; -$PHPMAILER_LANG['variable_set'] = 'Không thể thiết lập hoặc thiết lập lại biến: '; +$PHPMAILER_LANG['provide_address'] = 'Bạn phải cung cấp ít nhất một địa chỉ người nhận.'; +$PHPMAILER_LANG['recipients_failed'] = 'Lỗi SMTP: lỗi địa chỉ người nhận: '; +$PHPMAILER_LANG['signing'] = 'Lỗi đăng nhập: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Lỗi kết nối với SMTP'; +$PHPMAILER_LANG['smtp_error'] = 'Lỗi máy chủ smtp '; +$PHPMAILER_LANG['variable_set'] = 'Không thể thiết lập hoặc thiết lập lại biến: '; diff --git a/language/phpmailer.lang-zh.php b/language/phpmailer.lang-zh.php index 3e3e8836..a0b0bb9c 100644 --- a/language/phpmailer.lang-zh.php +++ b/language/phpmailer.lang-zh.php @@ -6,20 +6,20 @@ * @author Peter Dave Hello <@PeterDaveHello/> */ -$PHPMAILER_LANG['authenticate'] = 'SMTP 錯誤:登入失敗。'; -$PHPMAILER_LANG['connect_host'] = 'SMTP 錯誤:無法連線到 SMTP 主機。'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 錯誤:無法接受的資料。'; -$PHPMAILER_LANG['empty_message'] = '郵件內容為空'; -$PHPMAILER_LANG['encoding'] = '未知編碼: '; -$PHPMAILER_LANG['file_access'] = '無法存取檔案:'; -$PHPMAILER_LANG['file_open'] = '檔案錯誤:無法開啟檔案:'; -$PHPMAILER_LANG['from_failed'] = '發送地址錯誤:'; -$PHPMAILER_LANG['execute'] = '無法執行:'; -$PHPMAILER_LANG['instantiate'] = '未知函數呼叫。'; -$PHPMAILER_LANG['invalid_address'] = '因為電子郵件地址無效,無法傳送: '; -$PHPMAILER_LANG['provide_address'] = '必須提供至少一個收件人地址。'; +$PHPMAILER_LANG['authenticate'] = 'SMTP 錯誤:登入失敗。'; +$PHPMAILER_LANG['connect_host'] = 'SMTP 錯誤:無法連線到 SMTP 主機。'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 錯誤:無法接受的資料。'; +$PHPMAILER_LANG['empty_message'] = '郵件內容為空'; +$PHPMAILER_LANG['encoding'] = '未知編碼: '; +$PHPMAILER_LANG['file_access'] = '無法存取檔案:'; +$PHPMAILER_LANG['file_open'] = '檔案錯誤:無法開啟檔案:'; +$PHPMAILER_LANG['from_failed'] = '發送地址錯誤:'; +$PHPMAILER_LANG['execute'] = '無法執行:'; +$PHPMAILER_LANG['instantiate'] = '未知函數呼叫。'; +$PHPMAILER_LANG['invalid_address'] = '因為電子郵件地址無效,無法傳送: '; +$PHPMAILER_LANG['provide_address'] = '必須提供至少一個收件人地址。'; $PHPMAILER_LANG['mailer_not_supported'] = '不支援的發信客戶端。'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP 錯誤:收件人地址錯誤:'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP 錯誤:收件人地址錯誤:'; $PHPMAILER_LANG['signing'] = '登入失敗: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP連線失敗'; $PHPMAILER_LANG['smtp_error'] = 'SMTP伺服器錯誤: '; diff --git a/language/phpmailer.lang-zh_cn.php b/language/phpmailer.lang-zh_cn.php index 2250dc0c..36770199 100644 --- a/language/phpmailer.lang-zh_cn.php +++ b/language/phpmailer.lang-zh_cn.php @@ -6,20 +6,20 @@ * @author young */ -$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:登录失败。'; -$PHPMAILER_LANG['connect_host'] = 'SMTP 错误:无法连接到 SMTP 主机。'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误:数据不被接受。'; +$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:登录失败。'; +$PHPMAILER_LANG['connect_host'] = 'SMTP 错误:无法连接到 SMTP 主机。'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误:数据不被接受。'; $PHPMAILER_LANG['empty_message'] = '邮件正文为空。'; -$PHPMAILER_LANG['encoding'] = '未知编码: '; -$PHPMAILER_LANG['execute'] = '无法执行:'; -$PHPMAILER_LANG['file_access'] = '无法访问文件:'; -$PHPMAILER_LANG['file_open'] = '文件错误:无法打开文件:'; -$PHPMAILER_LANG['from_failed'] = '发送地址错误:'; -$PHPMAILER_LANG['instantiate'] = '未知函数调用。'; -$PHPMAILER_LANG['invalid_address'] = '发送失败,电子邮箱地址是无效的。'; +$PHPMAILER_LANG['encoding'] = '未知编码: '; +$PHPMAILER_LANG['execute'] = '无法执行:'; +$PHPMAILER_LANG['file_access'] = '无法访问文件:'; +$PHPMAILER_LANG['file_open'] = '文件错误:无法打开文件:'; +$PHPMAILER_LANG['from_failed'] = '发送地址错误:'; +$PHPMAILER_LANG['instantiate'] = '未知函数调用。'; +$PHPMAILER_LANG['invalid_address'] = '发送失败,电子邮箱地址是无效的。'; $PHPMAILER_LANG['mailer_not_supported'] = '发信客户端不被支持。'; -$PHPMAILER_LANG['provide_address'] = '必须提供至少一个收件人地址。'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误:收件人地址错误:'; +$PHPMAILER_LANG['provide_address'] = '必须提供至少一个收件人地址。'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误:收件人地址错误:'; $PHPMAILER_LANG['signing'] = '登录失败:'; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP服务器连接失败。'; $PHPMAILER_LANG['smtp_error'] = 'SMTP服务器出错: '; From ec9452012a55220b565225166eb1bc500ea447ab Mon Sep 17 00:00:00 2001 From: Synchro Date: Thu, 5 Mar 2015 15:55:18 +0100 Subject: [PATCH 7/9] Avoid ternary statements Use boolean values consistently for magic_quotes settings --- class.phpmailer.php | 50 ++++++++++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/class.phpmailer.php b/class.phpmailer.php index 69f5ff1d..1faaabd4 100644 --- a/class.phpmailer.php +++ b/class.phpmailer.php @@ -1218,7 +1218,11 @@ class PHPMailer if (!$this->smtpConnect()) { throw new phpmailerException($this->lang('smtp_connect_failed'), self::STOP_CRITICAL); } - $smtp_from = ($this->Sender == '') ? $this->From : $this->Sender; + if ('' == $this->Sender) { + $smtp_from = $this->From; + } else { + $smtp_from = $this->Sender; + } if (!$this->smtp->mail($smtp_from)) { $this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError())); throw new phpmailerException($this->ErrorInfo, self::STOP_CRITICAL); @@ -1496,7 +1500,11 @@ class PHPMailer */ public function wrapText($message, $length, $qp_mode = false) { - $soft_break = ($qp_mode) ? sprintf(' =%s', $this->LE) : $this->LE; + if ($qp_mode) { + $soft_break = sprintf(' =%s', $this->LE); + } else { + $soft_break = $this->LE; + } // If utf-8 encoding is used, we will need to make sure we don't // split multibyte characters when we wrap $is_utf8 = (strtolower($this->CharSet) == 'utf-8'); @@ -1582,11 +1590,11 @@ class PHPMailer /** * Find the last character boundary prior to $maxLength in a utf-8 - * quoted (printable) encoded string. + * quoted-printable encoded string. * Original written by Colin Brown. * @access public * @param string $encodedText utf-8 QP text - * @param integer $maxLength find last character boundary prior to this length + * @param integer $maxLength Find the last character boundary prior to this length * @return integer */ public function utf8CharBoundary($encodedText, $maxLength) @@ -1601,17 +1609,21 @@ class PHPMailer // Check the encoded byte value (the 2 chars after the '=') $hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2); $dec = hexdec($hex); - if ($dec < 128) { // Single byte character. + if ($dec < 128) { + // Single byte character. // If the encoded char was found at pos 0, it will fit // otherwise reduce maxLength to start of the encoded char - $maxLength = ($encodedCharPos == 0) ? $maxLength : - $maxLength - ($lookBack - $encodedCharPos); + if ($encodedCharPos > 0) { + $maxLength = $maxLength - ($lookBack - $encodedCharPos); + } $foundSplitPos = true; - } elseif ($dec >= 192) { // First byte of a multi byte character + } elseif ($dec >= 192) { + // First byte of a multi byte character // Reduce maxLength to split at start of character $maxLength = $maxLength - ($lookBack - $encodedCharPos); $foundSplitPos = true; - } elseif ($dec < 192) { // Middle byte of a multi byte character, look further back + } elseif ($dec < 192) { + // Middle byte of a multi byte character, look further back $lookBack += 3; } } else { @@ -1623,7 +1635,10 @@ class PHPMailer } /** - * Set the body wrapping. + * Apply word wrapping to the message body. + * Wraps the message body to the number of chars set in the WordWrap property. + * You should only do this to plain-text bodies as wrapping HTML tags may break them. + * This is called automatically by createBody(), so you don't need to call it yourself. * @access public * @return void */ @@ -2259,7 +2274,7 @@ class PHPMailer //Doesn't exist in PHP 5.4, but we don't need to check because //get_magic_quotes_runtime always returns false in 5.4+ //so it will never get here - ini_set('magic_quotes_runtime', 0); + ini_set('magic_quotes_runtime', false); } } $file_buffer = file_get_contents($path); @@ -2268,7 +2283,7 @@ class PHPMailer if (version_compare(PHP_VERSION, '5.3.0', '<')) { set_magic_quotes_runtime($magic_quotes); } else { - ini_set('magic_quotes_runtime', ($magic_quotes?'1':'0')); + ini_set('magic_quotes_runtime', $magic_quotes); } } return $file_buffer; @@ -3100,7 +3115,10 @@ class PHPMailer 'avi' => 'video/x-msvideo', 'movie' => 'video/x-sgi-movie' ); - return (array_key_exists(strtolower($ext), $mimes) ? $mimes[strtolower($ext)]: 'application/octet-stream'); + if (array_key_exists(strtolower($ext), $mimes)) { + return $mimes[strtolower($ext)]; + } + return 'application/octet-stream'; } /** @@ -3366,7 +3384,11 @@ class PHPMailer $body = $this->DKIM_BodyC($body); $DKIMlen = strlen($body); // Length of body $DKIMb64 = base64_encode(pack('H*', sha1($body))); // Base64 of packed binary SHA-1 hash of body - $ident = ($this->DKIM_identity == '') ? '' : ' i=' . $this->DKIM_identity . ';'; + if ('' == $this->DKIM_identity) { + $ident = ''; + } else { + $ident = ' i=' . $this->DKIM_identity . ';'; + } $dkimhdrs = 'DKIM-Signature: v=1; a=' . $DKIMsignatureType . '; q=' . $DKIMquery . '; l=' . From c506185d50fb9f10b707160f6ecccd424de1bdd7 Mon Sep 17 00:00:00 2001 From: Synchro Date: Fri, 6 Mar 2015 16:35:29 +0100 Subject: [PATCH 8/9] Add support for additional CA certificate when S/MIME signing, fixes #376 --- .gitignore | 1 + class.phpmailer.php | 15 ++++++- test/phpmailerTest.php | 91 +++++++++++++++++++++++++++++++++++++++++- 3 files changed, 103 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 989164d6..d3c6c62f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ docs/phpdoc/ test/message.txt test/testbootstrap.php +test/*.pem .idea build/ diff --git a/class.phpmailer.php b/class.phpmailer.php index 1faaabd4..e45b3070 100644 --- a/class.phpmailer.php +++ b/class.phpmailer.php @@ -536,6 +536,13 @@ class PHPMailer */ protected $sign_key_file = ''; + /** + * The optional S/MIME extra certificates ("CA Chain") file path. + * @type string + * @access protected + */ + protected $sign_extracerts_file = ''; + /** * The S/MIME password for the key. * Used only if the key is encrypted. @@ -1971,7 +1978,9 @@ class PHPMailer $signed, 'file://' . realpath($this->sign_cert_file), array('file://' . realpath($this->sign_key_file), $this->sign_key_pass), - null + null, + PKCS7_DETACHED, + $this->sign_extracerts_file ) ) { @unlink($file); @@ -3244,12 +3253,14 @@ class PHPMailer * @param string $cert_filename * @param string $key_filename * @param string $key_pass Password for private key + * @param string $extracerts_filename Optional path to chain certificate */ - public function sign($cert_filename, $key_filename, $key_pass) + public function sign($cert_filename, $key_filename, $key_pass, $extracerts_filename = '') { $this->sign_cert_file = $cert_filename; $this->sign_key_file = $key_filename; $this->sign_key_pass = $key_pass; + $this->sign_extracerts_file = $extracerts_filename; } /** diff --git a/test/phpmailerTest.php b/test/phpmailerTest.php index 2fd66e6e..b59a8949 100644 --- a/test/phpmailerTest.php +++ b/test/phpmailerTest.php @@ -1260,7 +1260,7 @@ EOT; $this->assertTrue($this->Mail->send(), 'Base64 encoding failed'); } /** - * S/MIME Signing tests. + * S/MIME Signing tests (self-signed). */ public function testSigning() { @@ -1277,12 +1277,17 @@ EOT; 'commonName' => 'PHPMailer Test', 'emailAddress' => 'phpmailer@example.com' ); + $keyconfig = array( + "digest_alg" => "sha256", + "private_key_bits" => 2048, + "private_key_type" => OPENSSL_KEYTYPE_RSA, + ); $password = 'password'; $certfile = 'certfile.txt'; $keyfile = 'keyfile.txt'; //Make a new key pair - $pk = openssl_pkey_new(); + $pk = openssl_pkey_new($keyconfig); //Create a certificate signing request $csr = openssl_csr_new($dn, $pk); //Create a self-signed cert @@ -1304,6 +1309,88 @@ EOT; unlink($keyfile); } + /** + * S/MIME Signing tests using a CA chain cert. + * To test that a generated message is signed correctly, save the message in a file + * and use openssl along with the certs generated by this script: + * `openssl smime -verify -in signed.eml -signer certfile.pem -CAfile cacertfile.pem` + */ + public function testSigningWithCA() + { + $this->Mail->Subject .= ': S/MIME signing with CA'; + $this->Mail->Body = 'This message is S/MIME signed with an extra CA cert.'; + $this->buildBody(); + + $certprops = array( + 'countryName' => 'UK', + 'stateOrProvinceName' => 'Here', + 'localityName' => 'There', + 'organizationName' => 'PHP', + 'organizationalUnitName' => 'PHPMailer', + 'commonName' => 'PHPMailer Test', + 'emailAddress' => 'phpmailer@example.com' + ); + $cacertprops = array( + 'countryName' => 'UK', + 'stateOrProvinceName' => 'Here', + 'localityName' => 'There', + 'organizationName' => 'PHP', + 'organizationalUnitName' => 'PHPMailer CA', + 'commonName' => 'PHPMailer Test CA', + 'emailAddress' => 'phpmailer@example.com' + ); + $keyconfig = array( + "digest_alg" => "sha256", + "private_key_bits" => 2048, + "private_key_type" => OPENSSL_KEYTYPE_RSA, + ); + $password = 'password'; + $cacertfile = 'cacertfile.pem'; + $cakeyfile = 'cakeyfile.pem'; + $certfile = 'certfile.pem'; + $keyfile = 'keyfile.pem'; + + //Create a CA cert + //Make a new key pair + $capk = openssl_pkey_new($keyconfig); + //Create a certificate signing request + $csr = openssl_csr_new($cacertprops, $capk); + //Create a self-signed cert + $cert = openssl_csr_sign($csr, null, $capk, 1); + //Save the CA cert + openssl_x509_export($cert, $certout); + file_put_contents($cacertfile, $certout); + //Save the CA key + openssl_pkey_export($capk, $pkeyout, $password); + file_put_contents($cakeyfile, $pkeyout); + + //Create a cert signed by our CA + //Make a new key pair + $pk = openssl_pkey_new($keyconfig); + //Create a certificate signing request + $csr = openssl_csr_new($certprops, $pk); + //Create a self-signed cert + $cert = openssl_csr_sign($csr, 'file://' . $cacertfile, $capk, 1); + //Save the cert + openssl_x509_export($cert, $certout); + file_put_contents($certfile, $certout); + //Save the key + openssl_pkey_export($pk, $pkeyout, $password); + file_put_contents($keyfile, $pkeyout); + + $this->Mail->sign( + $certfile, + $keyfile, + $password, + $cacertfile + ); + $this->assertTrue($this->Mail->send(), 'S/MIME signing with CA failed'); + unlink($cacertfile); + unlink($cakeyfile); + unlink($certfile); + unlink($keyfile); + } + /** * DKIM Signing tests. */ From 3e3617d2950bf3155a55e24083c69af04d933104 Mon Sep 17 00:00:00 2001 From: Synchro Date: Fri, 6 Mar 2015 16:45:33 +0100 Subject: [PATCH 9/9] Changelog --- changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.md b/changelog.md index a119b0ba..dbc6c52f 100644 --- a/changelog.md +++ b/changelog.md @@ -19,6 +19,7 @@ * Add Armenian translation (Thanks to Hrayr Grigoryan) * Add Slovenian translation (Thanks to Klemen Tušar) * More efficient word wrapping +* Add support for S/MIME signing with additional CA certificate (thanks to @IgitBuh) ## Version 5.2.9 (Sept 25th 2014) * **Important: The autoloader is no longer autoloaded by the PHPMailer class**