MDL-70292 lib: update phpmailer to 6.2.0

This commit is contained in:
Ilya Tregubov 2021-01-19 09:02:19 +02:00
parent fee3970787
commit a93d965968
56 changed files with 455 additions and 222 deletions

View file

@ -102,8 +102,8 @@ try {
$mail->SMTPAuth = true; // Enable SMTP authentication $mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'user@example.com'; // SMTP username $mail->Username = 'user@example.com'; // SMTP username
$mail->Password = 'secret'; // SMTP password $mail->Password = 'secret'; // SMTP password
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` also accepted $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged
$mail->Port = 587; // TCP port to connect to $mail->Port = 587; // TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above
//Recipients //Recipients
$mail->setFrom('from@example.com', 'Mailer'); $mail->setFrom('from@example.com', 'Mailer');
@ -155,7 +155,7 @@ Note that in order to reduce PHPMailer's deployed code footprint, the examples a
Complete generated API documentation is [available online](http://phpmailer.github.io/PHPMailer/). Complete generated API documentation is [available online](http://phpmailer.github.io/PHPMailer/).
You can generate complete API-level documentation by running `phpdoc` in the top-level folder, and documentation will appear in the `docs` folder, though you'll need to have [PHPDocumentor](http://www.phpdoc.org) installed. You may find [the unit tests](https://github.com/PHPMailer/PHPMailer/tree/master/test/phpmailerTest.php) a good source of how to do various operations such as encryption. You can generate complete API-level documentation by running `phpdoc` in the top-level folder, and documentation will appear in the `docs` folder, though you'll need to have [PHPDocumentor](http://www.phpdoc.org) installed. You may find [the unit tests](https://github.com/PHPMailer/PHPMailer/blob/master/test/PHPMailerTest.php) a good source of how to do various operations such as encryption.
If the documentation doesn't cover what you need, search the [many questions on Stack Overflow](http://stackoverflow.com/questions/tagged/phpmailer), and before you ask a question about "SMTP Error: Could not connect to SMTP host.", [read the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting). If the documentation doesn't cover what you need, search the [many questions on Stack Overflow](http://stackoverflow.com/questions/tagged/phpmailer), and before you ask a question about "SMTP Error: Could not connect to SMTP host.", [read the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting).
@ -167,15 +167,9 @@ Build status: [![Build Status](https://travis-ci.org/PHPMailer/PHPMailer.svg)](h
If this isn't passing, is there something you can do to help? If this isn't passing, is there something you can do to help?
## Security ## Security
Please disclose any vulnerabilities found responsibly - report any security problems found to the maintainers privately. Please disclose any vulnerabilities found responsibly report security issues to the maintainers privately.
PHPMailer versions prior to 5.2.22 (released January 9th 2017) have a local file disclosure vulnerability, [CVE-2017-5223](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-5223). If content passed into `msgHTML()` is sourced from unfiltered user input, relative paths can map to absolute local file paths and added as attachments. Also note that `addAttachment` (just like `file_get_contents`, `passthru`, `unlink`, etc) should not be passed user-sourced params either! Reported by Yongxiang Li of Asiasecurity. See [SECURITY](https://github.com/PHPMailer/PHPMailer/tree/master/SECURITY.md) for details on security issues.
PHPMailer versions prior to 5.2.20 (released December 28th 2016) are vulnerable to [CVE-2016-10045](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10045) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10045-Vuln-Patch-Bypass.html), and patched by Paul Buonopane (@Zenexer).
PHPMailer versions prior to 5.2.18 (released December 2016) are vulnerable to [CVE-2016-10033](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10033) a critical remote code execution vulnerability, responsibly reported by [Dawid Golunski](http://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html).
See [SECURITY](https://github.com/PHPMailer/PHPMailer/tree/master/SECURITY.md) for more detail on security issues.
## Contributing ## Contributing
Please submit bug reports, suggestions and pull requests to the [GitHub issue tracker](https://github.com/PHPMailer/PHPMailer/issues). Please submit bug reports, suggestions and pull requests to the [GitHub issue tracker](https://github.com/PHPMailer/PHPMailer/issues).

View file

@ -1 +1 @@
6.1.3 6.2.0

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Afrikaans PHPMailer language file: refer to English translation for definitive list * Afrikaans PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Arabic PHPMailer language file: refer to English translation for definitive list * Arabic PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Azerbaijani PHPMailer language file: refer to English translation for definitive list * Azerbaijani PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Bosnian PHPMailer language file: refer to English translation for definitive list * Bosnian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer
@ -23,4 +24,4 @@ $PHPMAILER_LANG['signing'] = 'Greška prilikom prijave: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'Spajanje na SMTP server nije uspjelo.'; $PHPMAILER_LANG['smtp_connect_failed'] = 'Spajanje na SMTP server nije uspjelo.';
$PHPMAILER_LANG['smtp_error'] = 'SMTP greška: '; $PHPMAILER_LANG['smtp_error'] = 'SMTP greška: ';
$PHPMAILER_LANG['variable_set'] = 'Nije moguće postaviti varijablu ili je vratiti nazad: '; $PHPMAILER_LANG['variable_set'] = 'Nije moguće postaviti varijablu ili je vratiti nazad: ';
$PHPMAILER_LANG['extension_missing'] = 'Nedostaje ekstenzija: '; $PHPMAILER_LANG['extension_missing'] = 'Nedostaje ekstenzija: ';

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Belarusian PHPMailer language file: refer to English translation for definitive list * Belarusian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Bulgarian PHPMailer language file: refer to English translation for definitive list * Bulgarian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Catalan PHPMailer language file: refer to English translation for definitive list * Catalan PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Chinese PHPMailer language file: refer to English translation for definitive list * Chinese PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Czech PHPMailer language file: refer to English translation for definitive list * Czech PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,26 +1,29 @@
<?php <?php
/** /**
* Danish PHPMailer language file: refer to English translation for definitive list * Danish PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer
* @author Mikael Stokkebro <info@stokkebro.dk> * @author John Sebastian <jms@iwb.dk>
* Rewrite and extension of the work by Mikael Stokkebro <info@stokkebro.dk>
*
*/ */
$PHPMAILER_LANG['authenticate'] = 'SMTP fejl: Kunne ikke logge på.'; $PHPMAILER_LANG['authenticate'] = 'SMTP fejl: Login mislykkedes.';
$PHPMAILER_LANG['connect_host'] = 'SMTP fejl: Kunne ikke tilslutte SMTP serveren.'; $PHPMAILER_LANG['connect_host'] = 'SMTP fejl: Forbindelse til SMTP serveren kunne ikke oprettes.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data kunne ikke accepteres.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data blev ikke accepteret.';
//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; $PHPMAILER_LANG['empty_message'] = 'Meddelelsen er uden indhold';
$PHPMAILER_LANG['encoding'] = 'Ukendt encode-format: '; $PHPMAILER_LANG['encoding'] = 'Ukendt encode-format: ';
$PHPMAILER_LANG['execute'] = 'Kunne ikke køre: '; $PHPMAILER_LANG['execute'] = 'Kunne ikke afvikle: ';
$PHPMAILER_LANG['file_access'] = 'Ingen adgang til fil: '; $PHPMAILER_LANG['file_access'] = 'Kunne ikke tilgå filen: ';
$PHPMAILER_LANG['file_open'] = 'Fil fejl: Kunne ikke åbne filen: '; $PHPMAILER_LANG['file_open'] = 'Fil fejl: Kunne ikke åbne filen: ';
$PHPMAILER_LANG['from_failed'] = 'Følgende afsenderadresse er forkert: '; $PHPMAILER_LANG['from_failed'] = 'Følgende afsenderadresse er forkert: ';
$PHPMAILER_LANG['instantiate'] = 'Kunne ikke initialisere email funktionen.'; $PHPMAILER_LANG['instantiate'] = 'Email funktionen kunne ikke initialiseres.';
//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: '; $PHPMAILER_LANG['invalid_address'] = 'Udgyldig adresse: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.'; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.';
$PHPMAILER_LANG['provide_address'] = 'Du skal indtaste mindst en modtagers emailadresse.'; $PHPMAILER_LANG['provide_address'] = 'Indtast mindst en modtagers email adresse.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere er forkerte: '; $PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere er forkerte: ';
//$PHPMAILER_LANG['signing'] = 'Signing Error: '; $PHPMAILER_LANG['signing'] = 'Signeringsfejl: ';
//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fejlede.';
//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; $PHPMAILER_LANG['smtp_error'] = 'SMTP server fejl: ';
//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; $PHPMAILER_LANG['variable_set'] = 'Kunne ikke definere eller nulstille variablen: ';
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; $PHPMAILER_LANG['extension_missing'] = 'Udvidelse mangler: ';

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* German PHPMailer language file: refer to English translation for definitive list * German PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer
@ -15,6 +16,8 @@ $PHPMAILER_LANG['file_open'] = 'Dateifehler: Konnte folgende Datei ni
$PHPMAILER_LANG['from_failed'] = 'Die folgende Absenderadresse ist nicht korrekt: '; $PHPMAILER_LANG['from_failed'] = 'Die folgende Absenderadresse ist nicht korrekt: ';
$PHPMAILER_LANG['instantiate'] = 'Mail-Funktion konnte nicht initialisiert werden.'; $PHPMAILER_LANG['instantiate'] = 'Mail-Funktion konnte nicht initialisiert werden.';
$PHPMAILER_LANG['invalid_address'] = 'Die Adresse ist ungültig: '; $PHPMAILER_LANG['invalid_address'] = 'Die Adresse ist ungültig: ';
$PHPMAILER_LANG['invalid_hostentry'] = 'Ungültiger Hosteintrag: ';
$PHPMAILER_LANG['invalid_host'] = 'Ungültiger Host: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer wird nicht unterstützt.'; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer wird nicht unterstützt.';
$PHPMAILER_LANG['provide_address'] = 'Bitte geben Sie mindestens eine Empfängeradresse an.'; $PHPMAILER_LANG['provide_address'] = 'Bitte geben Sie mindestens eine Empfängeradresse an.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP-Fehler: Die folgenden Empfänger sind nicht korrekt: '; $PHPMAILER_LANG['recipients_failed'] = 'SMTP-Fehler: Die folgenden Empfänger sind nicht korrekt: ';

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Greek PHPMailer language file: refer to English translation for definitive list * Greek PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Esperanto PHPMailer language file: refer to English translation for definitive list * Esperanto PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Spanish PHPMailer language file: refer to English translation for definitive list * Spanish PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Estonian PHPMailer language file: refer to English translation for definitive list * Estonian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Persian/Farsi PHPMailer language file: refer to English translation for definitive list * Persian/Farsi PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Finnish PHPMailer language file: refer to English translation for definitive list * Finnish PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Faroese PHPMailer language file: refer to English translation for definitive list * Faroese PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* French PHPMailer language file: refer to English translation for definitive list * French PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer
@ -19,6 +20,8 @@ $PHPMAILER_LANG['file_open'] = 'Ouverture du fichier impossible: '
$PHPMAILER_LANG['from_failed'] = 'L\'adresse d\'expéditeur suivante a échoué: '; $PHPMAILER_LANG['from_failed'] = 'L\'adresse d\'expéditeur suivante a échoué: ';
$PHPMAILER_LANG['instantiate'] = 'Impossible d\'instancier la fonction mail.'; $PHPMAILER_LANG['instantiate'] = 'Impossible d\'instancier la fonction mail.';
$PHPMAILER_LANG['invalid_address'] = 'L\'adresse courriel n\'est pas valide: '; $PHPMAILER_LANG['invalid_address'] = 'L\'adresse courriel n\'est pas valide: ';
$PHPMAILER_LANG['invalid_hostentry'] = 'L\'entrée hôte n\'est pas valide: ';
$PHPMAILER_LANG['invalid_host'] = 'L\'hôte n\'est pas valide: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' client de messagerie non supporté.'; $PHPMAILER_LANG['mailer_not_supported'] = ' client de messagerie non supporté.';
$PHPMAILER_LANG['provide_address'] = 'Vous devez fournir au moins une adresse de destinataire.'; $PHPMAILER_LANG['provide_address'] = 'Vous devez fournir au moins une adresse de destinataire.';
$PHPMAILER_LANG['recipients_failed'] = 'Erreur SMTP: les destinataires suivants sont en erreur: '; $PHPMAILER_LANG['recipients_failed'] = 'Erreur SMTP: les destinataires suivants sont en erreur: ';

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Galician PHPMailer language file: refer to English translation for definitive list * Galician PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Hebrew PHPMailer language file: refer to English translation for definitive list * Hebrew PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,10 +1,11 @@
<?php <?php
/** /**
* Hindi PHPMailer language file: refer to English translation for definitive list * Hindi PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer
* @author Yash Karanke <mr.karanke@gmail.com> * @author Yash Karanke <mr.karanke@gmail.com>
*/ */
$PHPMAILER_LANG['authenticate'] = 'SMTP त्रुटि: प्रामाणिकता की जांच नहीं हो सका। '; $PHPMAILER_LANG['authenticate'] = 'SMTP त्रुटि: प्रामाणिकता की जांच नहीं हो सका। ';
$PHPMAILER_LANG['connect_host'] = 'SMTP त्रुटि: SMTP सर्वर से कनेक्ट नहीं हो सका। '; $PHPMAILER_LANG['connect_host'] = 'SMTP त्रुटि: SMTP सर्वर से कनेक्ट नहीं हो सका। ';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP त्रुटि: डेटा स्वीकार नहीं किया जाता है। '; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP त्रुटि: डेटा स्वीकार नहीं किया जाता है। ';

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Croatian PHPMailer language file: refer to English translation for definitive list * Croatian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Hungarian PHPMailer language file: refer to English translation for definitive list * Hungarian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,10 +1,11 @@
<?php <?php
/** /**
* Armenian PHPMailer language file: refer to English translation for definitive list * Armenian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer
* @author Hrayr Grigoryan <hrayr@bits.am> * @author Hrayr Grigoryan <hrayr@bits.am>
*/ */
$PHPMAILER_LANG['authenticate'] = 'SMTP -ի սխալ: չհաջողվեց ստուգել իսկությունը.'; $PHPMAILER_LANG['authenticate'] = 'SMTP -ի սխալ: չհաջողվեց ստուգել իսկությունը.';
$PHPMAILER_LANG['connect_host'] = 'SMTP -ի սխալ: չհաջողվեց կապ հաստատել SMTP սերվերի հետ.'; $PHPMAILER_LANG['connect_host'] = 'SMTP -ի սխալ: չհաջողվեց կապ հաստատել SMTP սերվերի հետ.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP -ի սխալ: տվյալները ընդունված չեն.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP -ի սխալ: տվյալները ընդունված չեն.';

View file

@ -1,9 +1,11 @@
<?php <?php
/** /**
* Indonesian PHPMailer language file: refer to English translation for definitive list * Indonesian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer
* @author Cecep Prawiro <cecep.prawiro@gmail.com> * @author Cecep Prawiro <cecep.prawiro@gmail.com>
* @author @januridp * @author @januridp
* @author Ian Mustafa <mail@ianmustafa.com>
*/ */
$PHPMAILER_LANG['authenticate'] = 'Kesalahan SMTP: Tidak dapat mengotentikasi.'; $PHPMAILER_LANG['authenticate'] = 'Kesalahan SMTP: Tidak dapat mengotentikasi.';
@ -11,17 +13,19 @@ $PHPMAILER_LANG['connect_host'] = 'Kesalahan SMTP: Tidak dapat terhubung
$PHPMAILER_LANG['data_not_accepted'] = 'Kesalahan SMTP: Data tidak diterima.'; $PHPMAILER_LANG['data_not_accepted'] = 'Kesalahan SMTP: Data tidak diterima.';
$PHPMAILER_LANG['empty_message'] = 'Isi pesan kosong'; $PHPMAILER_LANG['empty_message'] = 'Isi pesan kosong';
$PHPMAILER_LANG['encoding'] = 'Pengkodean karakter tidak dikenali: '; $PHPMAILER_LANG['encoding'] = 'Pengkodean karakter tidak dikenali: ';
$PHPMAILER_LANG['execute'] = 'Tidak dapat menjalankan proses : '; $PHPMAILER_LANG['execute'] = 'Tidak dapat menjalankan proses: ';
$PHPMAILER_LANG['file_access'] = 'Tidak dapat mengakses berkas : '; $PHPMAILER_LANG['file_access'] = 'Tidak dapat mengakses berkas: ';
$PHPMAILER_LANG['file_open'] = 'Kesalahan File: Berkas tidak dapat dibuka : '; $PHPMAILER_LANG['file_open'] = 'Kesalahan Berkas: Berkas tidak dapat dibuka: ';
$PHPMAILER_LANG['from_failed'] = 'Alamat pengirim berikut mengakibatkan kesalahan : '; $PHPMAILER_LANG['from_failed'] = 'Alamat pengirim berikut mengakibatkan kesalahan: ';
$PHPMAILER_LANG['instantiate'] = 'Tidak dapat menginisialisasi fungsi surel'; $PHPMAILER_LANG['instantiate'] = 'Tidak dapat menginisialisasi fungsi surel.';
$PHPMAILER_LANG['invalid_address'] = 'Gagal terkirim, alamat surel tidak benar : '; $PHPMAILER_LANG['invalid_address'] = 'Gagal terkirim, alamat surel tidak sesuai: ';
$PHPMAILER_LANG['provide_address'] = 'Harus disediakan minimal satu alamat tujuan'; $PHPMAILER_LANG['invalid_hostentry'] = 'Gagal terkirim, entri host tidak sesuai: ';
$PHPMAILER_LANG['invalid_host'] = 'Gagal terkirim, host tidak sesuai: ';
$PHPMAILER_LANG['provide_address'] = 'Harus tersedia minimal satu alamat tujuan';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer tidak didukung'; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer tidak didukung';
$PHPMAILER_LANG['recipients_failed'] = 'Kesalahan SMTP: Alamat tujuan berikut menghasilkan kesalahan : '; $PHPMAILER_LANG['recipients_failed'] = 'Kesalahan SMTP: Alamat tujuan berikut menyebabkan kesalahan: ';
$PHPMAILER_LANG['signing'] = 'Kesalahan dalam tanda tangan : '; $PHPMAILER_LANG['signing'] = 'Kesalahan dalam penandatangan SSL: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() gagal.'; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() gagal.';
$PHPMAILER_LANG['smtp_error'] = 'Kesalahan pada pelayan SMTP : '; $PHPMAILER_LANG['smtp_error'] = 'Kesalahan pada pelayan SMTP: ';
$PHPMAILER_LANG['variable_set'] = 'Tidak dapat mengatur atau mengatur ulang variable : '; $PHPMAILER_LANG['variable_set'] = 'Tidak dapat mengatur atau mengatur ulang variabel: ';
$PHPMAILER_LANG['extension_missing'] = 'Ekstensi hilang: '; $PHPMAILER_LANG['extension_missing'] = 'Ekstensi PHP tidak tersedia: ';

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Italian PHPMailer language file: refer to English translation for definitive list * Italian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Japanese PHPMailer language file: refer to English translation for definitive list * Japanese PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Georgian PHPMailer language file: refer to English translation for definitive list * Georgian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Korean PHPMailer language file: refer to English translation for definitive list * Korean PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Lithuanian PHPMailer language file: refer to English translation for definitive list * Lithuanian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Latvian PHPMailer language file: refer to English translation for definitive list * Latvian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,9 +1,11 @@
<?php <?php
/** /**
* Malagasy PHPMailer language file: refer to English translation for definitive list * Malagasy PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer
* @author Hackinet <piyushjha8164@gmail.com> * @author Hackinet <piyushjha8164@gmail.com>
*/ */
$PHPMAILER_LANG['authenticate'] = 'Hadisoana SMTP: Tsy nahomby ny fanamarinana.'; $PHPMAILER_LANG['authenticate'] = 'Hadisoana SMTP: Tsy nahomby ny fanamarinana.';
$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Tsy afaka mampifandray amin\'ny mpampiantrano SMTP.'; $PHPMAILER_LANG['connect_host'] = 'SMTP Error: Tsy afaka mampifandray amin\'ny mpampiantrano SMTP.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP diso: tsy voarakitra ny angona.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP diso: tsy voarakitra ny angona.';

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Malaysian PHPMailer language file: refer to English translation for definitive list * Malaysian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Norwegian Bokmål PHPMailer language file: refer to English translation for definitive list * Norwegian Bokmål PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Dutch PHPMailer language file: refer to PHPMailer.php for definitive list. * Dutch PHPMailer language file: refer to PHPMailer.php for definitive list.
* @package PHPMailer * @package PHPMailer
@ -16,6 +17,8 @@ $PHPMAILER_LANG['file_open'] = 'Bestandsfout: kon bestand niet openen
$PHPMAILER_LANG['from_failed'] = 'Het volgende afzendersadres is mislukt: '; $PHPMAILER_LANG['from_failed'] = 'Het volgende afzendersadres is mislukt: ';
$PHPMAILER_LANG['instantiate'] = 'Kon mailfunctie niet initialiseren.'; $PHPMAILER_LANG['instantiate'] = 'Kon mailfunctie niet initialiseren.';
$PHPMAILER_LANG['invalid_address'] = 'Ongeldig adres: '; $PHPMAILER_LANG['invalid_address'] = 'Ongeldig adres: ';
$PHPMAILER_LANG['invalid_hostentry'] = 'Ongeldige hostentry: ';
$PHPMAILER_LANG['invalid_host'] = 'Ongeldige host: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer wordt niet ondersteund.'; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer wordt niet ondersteund.';
$PHPMAILER_LANG['provide_address'] = 'Er moet minstens één ontvanger worden opgegeven.'; $PHPMAILER_LANG['provide_address'] = 'Er moet minstens één ontvanger worden opgegeven.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP-fout: de volgende ontvangers zijn mislukt: '; $PHPMAILER_LANG['recipients_failed'] = 'SMTP-fout: de volgende ontvangers zijn mislukt: ';

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Polish PHPMailer language file: refer to English translation for definitive list * Polish PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer
@ -14,7 +15,7 @@ $PHPMAILER_LANG['file_access'] = 'Brak dostępu do pliku: ';
$PHPMAILER_LANG['file_open'] = 'Nie można otworzyć pliku: '; $PHPMAILER_LANG['file_open'] = 'Nie można otworzyć pliku: ';
$PHPMAILER_LANG['from_failed'] = 'Następujący adres Nadawcy jest nieprawidłowy: '; $PHPMAILER_LANG['from_failed'] = 'Następujący adres Nadawcy jest nieprawidłowy: ';
$PHPMAILER_LANG['instantiate'] = 'Nie można wywołać funkcji mail(). Sprawdź konfigurację serwera.'; $PHPMAILER_LANG['instantiate'] = 'Nie można wywołać funkcji mail(). Sprawdź konfigurację serwera.';
$PHPMAILER_LANG['invalid_address'] = 'Nie można wysłać wiadomości, '. $PHPMAILER_LANG['invalid_address'] = 'Nie można wysłać wiadomości, ' .
'następujący adres Odbiorcy jest nieprawidłowy: '; 'następujący adres Odbiorcy jest nieprawidłowy: ';
$PHPMAILER_LANG['provide_address'] = 'Należy podać prawidłowy adres email Odbiorcy.'; $PHPMAILER_LANG['provide_address'] = 'Należy podać prawidłowy adres email Odbiorcy.';
$PHPMAILER_LANG['mailer_not_supported'] = 'Wybrana metoda wysyłki wiadomości nie jest obsługiwana.'; $PHPMAILER_LANG['mailer_not_supported'] = 'Wybrana metoda wysyłki wiadomości nie jest obsługiwana.';

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Portuguese (European) PHPMailer language file: refer to English translation for definitive list * Portuguese (European) PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Brazilian Portuguese PHPMailer language file: refer to English translation for definitive list * Brazilian Portuguese PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Romanian PHPMailer language file: refer to English translation for definitive list * Romanian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Russian PHPMailer language file: refer to English translation for definitive list * Russian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Slovak PHPMailer language file: refer to English translation for definitive list * Slovak PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,9 +1,11 @@
<?php <?php
/** /**
* Slovene PHPMailer language file: refer to English translation for definitive list * Slovene PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer
* @author Klemen Tušar <techouse@gmail.com> * @author Klemen Tušar <techouse@gmail.com>
* @author Filip Š <projects@filips.si> * @author Filip Š <projects@filips.si>
* @author Blaž Oražem <blaz@orazem.si>
*/ */
$PHPMAILER_LANG['authenticate'] = 'SMTP napaka: Avtentikacija ni uspela.'; $PHPMAILER_LANG['authenticate'] = 'SMTP napaka: Avtentikacija ni uspela.';
@ -17,8 +19,10 @@ $PHPMAILER_LANG['file_open'] = 'Ne morem odpreti datoteke: ';
$PHPMAILER_LANG['from_failed'] = 'Neveljaven e-naslov pošiljatelja: '; $PHPMAILER_LANG['from_failed'] = 'Neveljaven e-naslov pošiljatelja: ';
$PHPMAILER_LANG['instantiate'] = 'Ne morem inicializirati mail funkcije.'; $PHPMAILER_LANG['instantiate'] = 'Ne morem inicializirati mail funkcije.';
$PHPMAILER_LANG['invalid_address'] = 'E-poštno sporočilo ni bilo poslano. E-naslov je neveljaven: '; $PHPMAILER_LANG['invalid_address'] = 'E-poštno sporočilo ni bilo poslano. E-naslov je neveljaven: ';
$PHPMAILER_LANG['invalid_hostentry'] = 'Neveljaven vnos gostitelja: ';
$PHPMAILER_LANG['invalid_host'] = 'Neveljaven gostitelj: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer ni podprt.'; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer ni podprt.';
$PHPMAILER_LANG['provide_address'] = 'Prosim vnesite vsaj enega naslovnika.'; $PHPMAILER_LANG['provide_address'] = 'Prosimo, vnesite vsaj enega naslovnika.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP napaka: Sledeči naslovniki so neveljavni: '; $PHPMAILER_LANG['recipients_failed'] = 'SMTP napaka: Sledeči naslovniki so neveljavni: ';
$PHPMAILER_LANG['signing'] = 'Napaka pri podpisovanju: '; $PHPMAILER_LANG['signing'] = 'Napaka pri podpisovanju: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'Ne morem vzpostaviti povezave s SMTP strežnikom.'; $PHPMAILER_LANG['smtp_connect_failed'] = 'Ne morem vzpostaviti povezave s SMTP strežnikom.';

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Serbian PHPMailer language file: refer to English translation for definitive list * Serbian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Swedish PHPMailer language file: refer to English translation for definitive list * Swedish PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer
@ -19,8 +20,8 @@ $PHPMAILER_LANG['invalid_address'] = 'Felaktig adress: ';
$PHPMAILER_LANG['provide_address'] = 'Du måste ange minst en mottagares e-postadress.'; $PHPMAILER_LANG['provide_address'] = 'Du måste ange minst en mottagares e-postadress.';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer stöds inte.'; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer stöds inte.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP fel: Följande mottagare är felaktig: '; $PHPMAILER_LANG['recipients_failed'] = 'SMTP fel: Följande mottagare är felaktig: ';
$PHPMAILER_LANG['signing'] = 'Signerings fel: '; $PHPMAILER_LANG['signing'] = 'Signeringsfel: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() misslyckades.'; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() misslyckades.';
$PHPMAILER_LANG['smtp_error'] = 'SMTP server fel: '; $PHPMAILER_LANG['smtp_error'] = 'SMTP serverfel: ';
$PHPMAILER_LANG['variable_set'] = 'Kunde inte definiera eller återställa variabel: '; $PHPMAILER_LANG['variable_set'] = 'Kunde inte definiera eller återställa variabel: ';
$PHPMAILER_LANG['extension_missing'] = 'Tillägg ej tillgängligt: '; $PHPMAILER_LANG['extension_missing'] = 'Tillägg ej tillgängligt: ';

View file

@ -1,27 +1,28 @@
<?php <?php
/** /**
* Tagalog PHPMailer language file: refer to English translation for definitive list * Tagalog PHPMailer language file: refer to English translation for definitive list
* *
* @package PHPMailer * @package PHPMailer
* @author Adriane Justine Tan <adrianetan12@gmail.com> * @author Adriane Justine Tan <eidoriantan@gmail.com>
*/ */
$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Hindi mapatotohanan.'; $PHPMAILER_LANG['authenticate'] = 'SMTP Error: Hindi mapatotohanan.';
$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Hindi makakonekta sa SMTP host.'; $PHPMAILER_LANG['connect_host'] = 'SMTP Error: Hindi makakonekta sa SMTP host.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Ang datos ay hindi maaaring matatanggap.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Ang datos ay hindi naitanggap.';
$PHPMAILER_LANG['empty_message'] = 'Walang laman ang mensahe'; $PHPMAILER_LANG['empty_message'] = 'Walang laman ang mensahe';
$PHPMAILER_LANG['encoding'] = 'Hindi alam ang encoding: '; $PHPMAILER_LANG['encoding'] = 'Hindi alam ang encoding: ';
$PHPMAILER_LANG['execute'] = 'Hindi maisasagawa: '; $PHPMAILER_LANG['execute'] = 'Hindi maisasagawa: ';
$PHPMAILER_LANG['file_access'] = 'Hindi ma-access ang file: '; $PHPMAILER_LANG['file_access'] = 'Hindi ma-access ang file: ';
$PHPMAILER_LANG['file_open'] = 'Hindi mabuksan ang file: '; $PHPMAILER_LANG['file_open'] = 'File Error: Hindi mabuksan ang file: ';
$PHPMAILER_LANG['from_failed'] = 'Ang sumusunod na address ay nabigo: '; $PHPMAILER_LANG['from_failed'] = 'Ang sumusunod na address ay nabigo: ';
$PHPMAILER_LANG['instantiate'] = 'Hindi maaaring magbigay ng institusyon ang mail'; $PHPMAILER_LANG['instantiate'] = 'Hindi maisimulan ang instance ng mail function.';
$PHPMAILER_LANG['invalid_address'] = 'Hindi wasto ang address na naibigay: '; $PHPMAILER_LANG['invalid_address'] = 'Hindi wasto ang address na naibigay: ';
$PHPMAILER_LANG['mailer_not_supported'] = 'Ang mailer ay hindi suportado'; $PHPMAILER_LANG['mailer_not_supported'] = 'Ang mailer ay hindi suportado.';
$PHPMAILER_LANG['provide_address'] = 'Kailangan mong magbigay ng kahit isang email address na tatanggap'; $PHPMAILER_LANG['provide_address'] = 'Kailangan mong magbigay ng kahit isang email address na tatanggap.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Ang mga sumusunod na tatanggap ay nabigo: '; $PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Ang mga sumusunod na tatanggap ay nabigo: ';
$PHPMAILER_LANG['signing'] = 'Hindi ma-sign'; $PHPMAILER_LANG['signing'] = 'Hindi ma-sign: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'Ang SMTP connect() ay nabigo'; $PHPMAILER_LANG['smtp_connect_failed'] = 'Ang SMTP connect() ay nabigo.';
$PHPMAILER_LANG['smtp_error'] = 'Ang server ng SMTP ay nabigo'; $PHPMAILER_LANG['smtp_error'] = 'Ang server ng SMTP ay nabigo: ';
$PHPMAILER_LANG['variable_set'] = 'Hindi matatakda ang mga variables: '; $PHPMAILER_LANG['variable_set'] = 'Hindi matatakda o ma-reset ang mga variables: ';
$PHPMAILER_LANG['extension_missing'] = 'Nawawala ang extension'; $PHPMAILER_LANG['extension_missing'] = 'Nawawala ang extension: ';

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Turkish PHPMailer language file: refer to English translation for definitive list * Turkish PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Ukrainian PHPMailer language file: refer to English translation for definitive list * Ukrainian PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Vietnamese (Tiếng Việt) PHPMailer language file: refer to English translation for definitive list. * Vietnamese (Tiếng Việt) PHPMailer language file: refer to English translation for definitive list.
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Traditional Chinese PHPMailer language file: refer to English translation for definitive list * Traditional Chinese PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Simplified Chinese PHPMailer language file: refer to English translation for definitive list * Simplified Chinese PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer * @package PHPMailer

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* PHPMailer Exception class. * PHPMailer Exception class.
* PHP Version 5.5. * PHP Version 5.5.
@ -9,7 +10,7 @@
* @author Jim Jagielski (jimjag) <jimjag@gmail.com> * @author Jim Jagielski (jimjag) <jimjag@gmail.com>
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net> * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
* @author Brent R. Matzelle (original founder) * @author Brent R. Matzelle (original founder)
* @copyright 2012 - 2017 Marcus Bointon * @copyright 2012 - 2020 Marcus Bointon
* @copyright 2010 - 2012 Jim Jagielski * @copyright 2010 - 2012 Jim Jagielski
* @copyright 2004 - 2009 Andy Prevost * @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* PHPMailer - PHP email creation and transport class. * PHPMailer - PHP email creation and transport class.
* PHP Version 5.5. * PHP Version 5.5.
@ -9,7 +10,7 @@
* @author Jim Jagielski (jimjag) <jimjag@gmail.com> * @author Jim Jagielski (jimjag) <jimjag@gmail.com>
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net> * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
* @author Brent R. Matzelle (original founder) * @author Brent R. Matzelle (original founder)
* @copyright 2012 - 2019 Marcus Bointon * @copyright 2012 - 2020 Marcus Bointon
* @copyright 2010 - 2012 Jim Jagielski * @copyright 2010 - 2012 Jim Jagielski
* @copyright 2004 - 2009 Andy Prevost * @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
@ -64,7 +65,7 @@ class PHPMailer
* Options: null (default), 1 = High, 3 = Normal, 5 = low. * Options: null (default), 1 = High, 3 = Normal, 5 = low.
* When null, the header is not set at all. * When null, the header is not set at all.
* *
* @var int * @var int|null
*/ */
public $Priority; public $Priority;
@ -388,11 +389,11 @@ class PHPMailer
* SMTP class debug output mode. * SMTP class debug output mode.
* Debug output level. * Debug output level.
* Options: * Options:
* * SMTP::DEBUG_OFF: No output * @see SMTP::DEBUG_OFF: No output
* * SMTP::DEBUG_CLIENT: Client messages * @see SMTP::DEBUG_CLIENT: Client messages
* * SMTP::DEBUG_SERVER: Client and server messages * @see SMTP::DEBUG_SERVER: Client and server messages
* * SMTP::DEBUG_CONNECTION: As SERVER plus connection status * @see SMTP::DEBUG_CONNECTION: As SERVER plus connection status
* * SMTP::DEBUG_LOWLEVEL: Noisy, low-level data output, rarely needed * @see SMTP::DEBUG_LOWLEVEL: Noisy, low-level data output, rarely needed
* *
* @see SMTP::$do_debug * @see SMTP::$do_debug
* *
@ -441,6 +442,8 @@ class PHPMailer
* Only supported in `mail` and `sendmail` transports, not in SMTP. * Only supported in `mail` and `sendmail` transports, not in SMTP.
* *
* @var bool * @var bool
*
* @deprecated 6.0.0 PHPMailer isn't a mailing list manager!
*/ */
public $SingleTo = false; public $SingleTo = false;
@ -745,7 +748,7 @@ class PHPMailer
* *
* @var string * @var string
*/ */
const VERSION = '6.1.3'; const VERSION = '6.2.0';
/** /**
* Error severity: message only, continue processing. * Error severity: message only, continue processing.
@ -769,11 +772,22 @@ class PHPMailer
const STOP_CRITICAL = 2; const STOP_CRITICAL = 2;
/** /**
* SMTP RFC standard line ending. * The SMTP standard CRLF line break.
* If you want to change line break format, change static::$LE, not this.
*/
const CRLF = "\r\n";
/**
* "Folding White Space" a white space string used for line folding.
*/
const FWS = ' ';
/**
* SMTP RFC standard line ending; Carriage Return, Line Feed.
* *
* @var string * @var string
*/ */
protected static $LE = "\r\n"; protected static $LE = self::CRLF;
/** /**
* The maximum line length supported by mail(). * The maximum line length supported by mail().
@ -886,6 +900,7 @@ class PHPMailer
switch ($this->Debugoutput) { switch ($this->Debugoutput) {
case 'error_log': case 'error_log':
//Don't output, just log //Don't output, just log
/** @noinspection ForgottenDebugOutputInspection */
error_log($str); error_log($str);
break; break;
case 'html': case 'html':
@ -1171,9 +1186,11 @@ class PHPMailer
//Use this built-in parser if it's available //Use this built-in parser if it's available
$list = imap_rfc822_parse_adrlist($addrstr, ''); $list = imap_rfc822_parse_adrlist($addrstr, '');
foreach ($list as $address) { foreach ($list as $address) {
if (('.SYNTAX-ERROR.' !== $address->host) && static::validateAddress( if (
$address->mailbox . '@' . $address->host ('.SYNTAX-ERROR.' !== $address->host) && static::validateAddress(
)) { $address->mailbox . '@' . $address->host
)
) {
$addresses[] = [ $addresses[] = [
'name' => (property_exists($address, 'personal') ? $address->personal : ''), 'name' => (property_exists($address, 'personal') ? $address->personal : ''),
'address' => $address->mailbox . '@' . $address->host, 'address' => $address->mailbox . '@' . $address->host,
@ -1227,7 +1244,8 @@ class PHPMailer
$name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
// Don't validate now addresses with IDN. Will be done in send(). // Don't validate now addresses with IDN. Will be done in send().
$pos = strrpos($address, '@'); $pos = strrpos($address, '@');
if ((false === $pos) if (
(false === $pos)
|| ((!$this->has8bitChars(substr($address, ++$pos)) || !static::idnSupported()) || ((!$this->has8bitChars(substr($address, ++$pos)) || !static::idnSupported())
&& !static::validateAddress($address)) && !static::validateAddress($address))
) { ) {
@ -1296,7 +1314,7 @@ class PHPMailer
$patternselect = static::$validator; $patternselect = static::$validator;
} }
if (is_callable($patternselect)) { if (is_callable($patternselect)) {
return $patternselect($address); return call_user_func($patternselect, $address);
} }
//Reject line breaks in addresses; it's valid RFC5322, but not RFC5321 //Reject line breaks in addresses; it's valid RFC5322, but not RFC5321
if (strpos($address, "\n") !== false || strpos($address, "\r") !== false) { if (strpos($address, "\n") !== false || strpos($address, "\r") !== false) {
@ -1337,7 +1355,7 @@ class PHPMailer
/* /*
* This is the pattern used in the HTML5 spec for validation of 'email' type form input elements. * This is the pattern used in the HTML5 spec for validation of 'email' type form input elements.
* *
* @see http://www.whatwg.org/specs/web-apps/current-work/#e-mail-state-(type=email) * @see https://html.spec.whatwg.org/#e-mail-state-(type=email)
*/ */
return (bool) preg_match( return (bool) preg_match(
'/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}' . '/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}' .
@ -1346,7 +1364,7 @@ class PHPMailer
); );
case 'php': case 'php':
default: default:
return (bool) filter_var($address, FILTER_VALIDATE_EMAIL); return filter_var($address, FILTER_VALIDATE_EMAIL) !== false;
} }
} }
@ -1379,7 +1397,8 @@ class PHPMailer
{ {
// Verify we have required functions, CharSet, and at-sign. // Verify we have required functions, CharSet, and at-sign.
$pos = strrpos($address, '@'); $pos = strrpos($address, '@');
if (!empty($this->CharSet) && if (
!empty($this->CharSet) &&
false !== $pos && false !== $pos &&
static::idnSupported() static::idnSupported()
) { ) {
@ -1389,7 +1408,13 @@ class PHPMailer
$domain = mb_convert_encoding($domain, 'UTF-8', $this->CharSet); $domain = mb_convert_encoding($domain, 'UTF-8', $this->CharSet);
//Ignore IDE complaints about this line - method signature changed in PHP 5.4 //Ignore IDE complaints about this line - method signature changed in PHP 5.4
$errorcode = 0; $errorcode = 0;
$punycode = idn_to_ascii($domain, $errorcode, INTL_IDNA_VARIANT_UTS46); if (defined('INTL_IDNA_VARIANT_UTS46')) {
$punycode = idn_to_ascii($domain, $errorcode, INTL_IDNA_VARIANT_UTS46);
} elseif (defined('INTL_IDNA_VARIANT_2003')) {
$punycode = idn_to_ascii($domain, $errorcode, INTL_IDNA_VARIANT_2003);
} else {
$punycode = idn_to_ascii($domain, $errorcode);
}
if (false !== $punycode) { if (false !== $punycode) {
return substr($address, 0, $pos) . $punycode; return substr($address, 0, $pos) . $punycode;
} }
@ -1435,18 +1460,20 @@ class PHPMailer
*/ */
public function preSend() public function preSend()
{ {
if ('smtp' === $this->Mailer if (
|| ('mail' === $this->Mailer && stripos(PHP_OS, 'WIN') === 0) 'smtp' === $this->Mailer
|| ('mail' === $this->Mailer && (PHP_VERSION_ID >= 80000 || stripos(PHP_OS, 'WIN') === 0))
) { ) {
//SMTP mandates RFC-compliant line endings //SMTP mandates RFC-compliant line endings
//and it's also used with mail() on Windows //and it's also used with mail() on Windows
static::setLE("\r\n"); static::setLE(self::CRLF);
} else { } else {
//Maintain backward compatibility with legacy Linux command line mailers //Maintain backward compatibility with legacy Linux command line mailers
static::setLE(PHP_EOL); static::setLE(PHP_EOL);
} }
//Check for buggy PHP versions that add a header with an incorrect line break //Check for buggy PHP versions that add a header with an incorrect line break
if ('mail' === $this->Mailer if (
'mail' === $this->Mailer
&& ((PHP_VERSION_ID >= 70000 && PHP_VERSION_ID < 70017) && ((PHP_VERSION_ID >= 70000 && PHP_VERSION_ID < 70017)
|| (PHP_VERSION_ID >= 70100 && PHP_VERSION_ID < 70103)) || (PHP_VERSION_ID >= 70100 && PHP_VERSION_ID < 70103))
&& ini_get('mail.add_x_header') === '1' && ini_get('mail.add_x_header') === '1'
@ -1533,7 +1560,8 @@ class PHPMailer
} }
// Sign with DKIM if enabled // Sign with DKIM if enabled
if (!empty($this->DKIM_domain) if (
!empty($this->DKIM_domain)
&& !empty($this->DKIM_selector) && !empty($this->DKIM_selector)
&& (!empty($this->DKIM_private_string) && (!empty($this->DKIM_private_string)
|| (!empty($this->DKIM_private) || (!empty($this->DKIM_private)
@ -1547,7 +1575,7 @@ class PHPMailer
$this->encodeHeader($this->secureHeader($this->Subject)), $this->encodeHeader($this->secureHeader($this->Subject)),
$this->MIMEBody $this->MIMEBody
); );
$this->MIMEHeader = rtrim($this->MIMEHeader, "\r\n ") . static::$LE . $this->MIMEHeader = static::stripTrailingWSP($this->MIMEHeader) . static::$LE .
static::normalizeBreaks($header_dkim) . static::$LE; static::normalizeBreaks($header_dkim) . static::$LE;
} }
@ -1590,6 +1618,9 @@ class PHPMailer
return $this->mailSend($this->MIMEHeader, $this->MIMEBody); return $this->mailSend($this->MIMEHeader, $this->MIMEBody);
} }
} catch (Exception $exc) { } catch (Exception $exc) {
if ($this->Mailer === 'smtp' && $this->SMTPKeepAlive == true) {
$this->smtp->reset();
}
$this->setError($exc->getMessage()); $this->setError($exc->getMessage());
$this->edebug($exc->getMessage()); $this->edebug($exc->getMessage());
if ($this->exceptions) { if ($this->exceptions) {
@ -1614,7 +1645,7 @@ class PHPMailer
*/ */
protected function sendmailSend($header, $body) protected function sendmailSend($header, $body)
{ {
$header = rtrim($header, "\r\n ") . static::$LE . static::$LE; $header = static::stripTrailingWSP($header) . static::$LE . static::$LE;
// CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped. // CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped.
if (!empty($this->Sender) && self::isShellSafe($this->Sender)) { if (!empty($this->Sender) && self::isShellSafe($this->Sender)) {
@ -1694,7 +1725,8 @@ class PHPMailer
protected static function isShellSafe($string) protected static function isShellSafe($string)
{ {
// Future-proof // Future-proof
if (escapeshellcmd($string) !== $string if (
escapeshellcmd($string) !== $string
|| !in_array(escapeshellarg($string), ["'$string'", "\"$string\""]) || !in_array(escapeshellarg($string), ["'$string'", "\"$string\""])
) { ) {
return false; return false;
@ -1730,6 +1762,23 @@ class PHPMailer
return !preg_match('#^[a-z]+://#i', $path); return !preg_match('#^[a-z]+://#i', $path);
} }
/**
* Check whether a file path is safe, accessible, and readable.
*
* @param string $path A relative or absolute path to a file
*
* @return bool
*/
protected static function fileIsAccessible($path)
{
$readable = file_exists($path);
//If not a UNC path (expected to start with \\), check read permission, see #2069
if (strpos($path, '\\\\') !== 0) {
$readable = $readable && is_readable($path);
}
return static::isPermittedPath($path) && $readable;
}
/** /**
* Send mail using the PHP mail() function. * Send mail using the PHP mail() function.
* *
@ -1744,7 +1793,7 @@ class PHPMailer
*/ */
protected function mailSend($header, $body) protected function mailSend($header, $body)
{ {
$header = rtrim($header, "\r\n ") . static::$LE . static::$LE; $header = static::stripTrailingWSP($header) . static::$LE . static::$LE;
$toArr = []; $toArr = [];
foreach ($this->to as $toaddr) { foreach ($this->to as $toaddr) {
@ -1833,7 +1882,7 @@ class PHPMailer
*/ */
protected function smtpSend($header, $body) protected function smtpSend($header, $body)
{ {
$header = rtrim($header, "\r\n ") . static::$LE . static::$LE; $header = static::stripTrailingWSP($header) . static::$LE . static::$LE;
$bad_rcpt = []; $bad_rcpt = [];
if (!$this->smtpConnect($this->SMTPOptions)) { if (!$this->smtpConnect($this->SMTPOptions)) {
throw new Exception($this->lang('smtp_connect_failed'), self::STOP_CRITICAL); throw new Exception($this->lang('smtp_connect_failed'), self::STOP_CRITICAL);
@ -1861,7 +1910,7 @@ class PHPMailer
$isSent = true; $isSent = true;
} }
$callbacks[] = ['issent'=>$isSent, 'to'=>$to[0]]; $callbacks[] = ['issent' => $isSent, 'to' => $to[0]];
} }
} }
@ -1941,34 +1990,36 @@ class PHPMailer
foreach ($hosts as $hostentry) { foreach ($hosts as $hostentry) {
$hostinfo = []; $hostinfo = [];
if (!preg_match( if (
'/^((ssl|tls):\/\/)*([a-zA-Z\d.-]*|\[[a-fA-F\d:]+]):?(\d*)$/', !preg_match(
trim($hostentry), '/^(?:(ssl|tls):\/\/)?(.+?)(?::(\d+))?$/',
$hostinfo trim($hostentry),
)) { $hostinfo
$this->edebug($this->lang('connect_host') . ' ' . $hostentry); )
) {
$this->edebug($this->lang('invalid_hostentry') . ' ' . trim($hostentry));
// Not a valid host entry // Not a valid host entry
continue; continue;
} }
// $hostinfo[2]: optional ssl or tls prefix // $hostinfo[1]: optional ssl or tls prefix
// $hostinfo[3]: the hostname // $hostinfo[2]: the hostname
// $hostinfo[4]: optional port number // $hostinfo[3]: optional port number
// The host string prefix can temporarily override the current setting for SMTPSecure // The host string prefix can temporarily override the current setting for SMTPSecure
// If it's not specified, the default value is used // If it's not specified, the default value is used
//Check the host name is a valid name or IP address before trying to use it //Check the host name is a valid name or IP address before trying to use it
if (!static::isValidHost($hostinfo[3])) { if (!static::isValidHost($hostinfo[2])) {
$this->edebug($this->lang('connect_host') . ' ' . $hostentry); $this->edebug($this->lang('invalid_host') . ' ' . $hostinfo[2]);
continue; continue;
} }
$prefix = ''; $prefix = '';
$secure = $this->SMTPSecure; $secure = $this->SMTPSecure;
$tls = (static::ENCRYPTION_STARTTLS === $this->SMTPSecure); $tls = (static::ENCRYPTION_STARTTLS === $this->SMTPSecure);
if ('ssl' === $hostinfo[2] || ('' === $hostinfo[2] && static::ENCRYPTION_SMTPS === $this->SMTPSecure)) { if ('ssl' === $hostinfo[1] || ('' === $hostinfo[1] && static::ENCRYPTION_SMTPS === $this->SMTPSecure)) {
$prefix = 'ssl://'; $prefix = 'ssl://';
$tls = false; // Can't have SSL and TLS at the same time $tls = false; // Can't have SSL and TLS at the same time
$secure = static::ENCRYPTION_SMTPS; $secure = static::ENCRYPTION_SMTPS;
} elseif ('tls' === $hostinfo[2]) { } elseif ('tls' === $hostinfo[1]) {
$tls = true; $tls = true;
// tls doesn't use a prefix // tls doesn't use a prefix
$secure = static::ENCRYPTION_STARTTLS; $secure = static::ENCRYPTION_STARTTLS;
@ -1981,11 +2032,15 @@ class PHPMailer
throw new Exception($this->lang('extension_missing') . 'openssl', self::STOP_CRITICAL); throw new Exception($this->lang('extension_missing') . 'openssl', self::STOP_CRITICAL);
} }
} }
$host = $hostinfo[3]; $host = $hostinfo[2];
$port = $this->Port; $port = $this->Port;
$tport = (int) $hostinfo[4]; if (
if ($tport > 0 && $tport < 65536) { array_key_exists(3, $hostinfo) &&
$port = $tport; is_numeric($hostinfo[3]) &&
$hostinfo[3] > 0 &&
$hostinfo[3] < 65536
) {
$port = (int) $hostinfo[3];
} }
if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) { if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) {
try { try {
@ -2010,12 +2065,14 @@ class PHPMailer
// We must resend EHLO after TLS negotiation // We must resend EHLO after TLS negotiation
$this->smtp->hello($hello); $this->smtp->hello($hello);
} }
if ($this->SMTPAuth && !$this->smtp->authenticate( if (
$this->Username, $this->SMTPAuth && !$this->smtp->authenticate(
$this->Password, $this->Username,
$this->AuthType, $this->Password,
$this->oauth $this->AuthType,
)) { $this->oauth
)
) {
throw new Exception($this->lang('authenticate')); throw new Exception($this->lang('authenticate'));
} }
@ -2070,9 +2127,10 @@ class PHPMailer
'se' => 'sv', 'se' => 'sv',
'rs' => 'sr', 'rs' => 'sr',
'tg' => 'tl', 'tg' => 'tl',
'am' => 'hy',
]; ];
if (isset($renamed_langcodes[$langcode])) { if (array_key_exists($langcode, $renamed_langcodes)) {
$langcode = $renamed_langcodes[$langcode]; $langcode = $renamed_langcodes[$langcode];
} }
@ -2089,6 +2147,8 @@ class PHPMailer
'from_failed' => 'The following From address failed: ', 'from_failed' => 'The following From address failed: ',
'instantiate' => 'Could not instantiate mail function.', 'instantiate' => 'Could not instantiate mail function.',
'invalid_address' => 'Invalid address: ', 'invalid_address' => 'Invalid address: ',
'invalid_hostentry' => 'Invalid hostentry: ',
'invalid_host' => 'Invalid host: ',
'mailer_not_supported' => ' mailer is not supported.', 'mailer_not_supported' => ' mailer is not supported.',
'provide_address' => 'You must provide at least one recipient email address.', 'provide_address' => 'You must provide at least one recipient email address.',
'recipients_failed' => 'SMTP Error: The following recipients failed: ', 'recipients_failed' => 'SMTP Error: The following recipients failed: ',
@ -2111,7 +2171,7 @@ class PHPMailer
// There is no English translation file // There is no English translation file
if ('en' !== $langcode) { if ('en' !== $langcode) {
// Make sure language file path is readable // Make sure language file path is readable
if (!static::isPermittedPath($lang_file) || !file_exists($lang_file)) { if (!static::fileIsAccessible($lang_file)) {
$foundlang = false; $foundlang = false;
} else { } else {
// Overwrite language-specific strings. // Overwrite language-specific strings.
@ -2359,21 +2419,18 @@ class PHPMailer
$result .= $this->headerLine('Date', '' === $this->MessageDate ? self::rfcDate() : $this->MessageDate); $result .= $this->headerLine('Date', '' === $this->MessageDate ? self::rfcDate() : $this->MessageDate);
// To be created automatically by mail() // The To header is created automatically by mail(), so needs to be omitted here
if ($this->SingleTo) { if ('mail' !== $this->Mailer) {
if ('mail' !== $this->Mailer) { if ($this->SingleTo) {
foreach ($this->to as $toaddr) { foreach ($this->to as $toaddr) {
$this->SingleToArray[] = $this->addrFormat($toaddr); $this->SingleToArray[] = $this->addrFormat($toaddr);
} }
} } elseif (count($this->to) > 0) {
} elseif (count($this->to) > 0) {
if ('mail' !== $this->Mailer) {
$result .= $this->addrAppend('To', $this->to); $result .= $this->addrAppend('To', $this->to);
} elseif (count($this->cc) === 0) {
$result .= $this->headerLine('To', 'undisclosed-recipients:;');
} }
} elseif (count($this->cc) === 0) {
$result .= $this->headerLine('To', 'undisclosed-recipients:;');
} }
$result .= $this->addrAppend('From', [[trim($this->From), $this->FromName]]); $result .= $this->addrAppend('From', [[trim($this->From), $this->FromName]]);
// sendmail and mail() extract Cc from the header before sending // sendmail and mail() extract Cc from the header before sending
@ -2382,7 +2439,8 @@ class PHPMailer
} }
// sendmail and mail() extract Bcc from the header before sending // sendmail and mail() extract Bcc from the header before sending
if (( if (
(
'sendmail' === $this->Mailer || 'qmail' === $this->Mailer || 'mail' === $this->Mailer 'sendmail' === $this->Mailer || 'qmail' === $this->Mailer || 'mail' === $this->Mailer
) )
&& count($this->bcc) > 0 && count($this->bcc) > 0
@ -2504,7 +2562,8 @@ class PHPMailer
*/ */
public function getSentMIMEMessage() public function getSentMIMEMessage()
{ {
return rtrim($this->MIMEHeader . $this->mailHeader, "\n\r") . static::$LE . static::$LE . $this->MIMEBody; return static::stripTrailingWSP($this->MIMEHeader . $this->mailHeader) .
static::$LE . static::$LE . $this->MIMEBody;
} }
/** /**
@ -2587,7 +2646,7 @@ class PHPMailer
$altBodyEncoding = static::ENCODING_QUOTED_PRINTABLE; $altBodyEncoding = static::ENCODING_QUOTED_PRINTABLE;
} }
//Use this as a preamble in all multipart message types //Use this as a preamble in all multipart message types
$mimepre = 'This is a multi-part message in MIME format.' . static::$LE; $mimepre = 'This is a multi-part message in MIME format.' . static::$LE . static::$LE;
switch ($this->message_type) { switch ($this->message_type) {
case 'inline': case 'inline':
$body .= $mimepre; $body .= $mimepre;
@ -2927,7 +2986,7 @@ class PHPMailer
* @param string $path Path to the attachment * @param string $path Path to the attachment
* @param string $name Overrides the attachment name * @param string $name Overrides the attachment name
* @param string $encoding File encoding (see $Encoding) * @param string $encoding File encoding (see $Encoding)
* @param string $type File extension (MIME) type * @param string $type MIME type, e.g. `image/jpeg`; determined automatically from $path if not specified
* @param string $disposition Disposition to use * @param string $disposition Disposition to use
* *
* @throws Exception * @throws Exception
@ -2942,7 +3001,7 @@ class PHPMailer
$disposition = 'attachment' $disposition = 'attachment'
) { ) {
try { try {
if (!static::isPermittedPath($path) || !@is_file($path)) { if (!static::fileIsAccessible($path)) {
throw new Exception($this->lang('file_access') . $path, self::STOP_CONTINUE); throw new Exception($this->lang('file_access') . $path, self::STOP_CONTINUE);
} }
@ -2955,7 +3014,6 @@ class PHPMailer
if ('' === $name) { if ('' === $name) {
$name = $filename; $name = $filename;
} }
if (!$this->validateEncoding($encoding)) { if (!$this->validateEncoding($encoding)) {
throw new Exception($this->lang('encoding') . $encoding); throw new Exception($this->lang('encoding') . $encoding);
} }
@ -3044,9 +3102,9 @@ class PHPMailer
//Only include a filename property if we have one //Only include a filename property if we have one
if (!empty($name)) { if (!empty($name)) {
$mime[] = sprintf( $mime[] = sprintf(
'Content-Type: %s; name="%s"%s', 'Content-Type: %s; name=%s%s',
$type, $type,
$this->encodeHeader($this->secureHeader($name)), static::quotedString($this->encodeHeader($this->secureHeader($name))),
static::$LE static::$LE
); );
} else { } else {
@ -3066,24 +3124,14 @@ class PHPMailer
$mime[] = 'Content-ID: <' . $this->encodeHeader($this->secureHeader($cid)) . '>' . static::$LE; $mime[] = 'Content-ID: <' . $this->encodeHeader($this->secureHeader($cid)) . '>' . static::$LE;
} }
// If a filename contains any of these chars, it should be quoted, // Allow for bypassing the Content-Disposition header
// but not otherwise: RFC2183 & RFC2045 5.1
// Fixes a warning in IETF's msglint MIME checker
// Allow for bypassing the Content-Disposition header totally
if (!empty($disposition)) { if (!empty($disposition)) {
$encoded_name = $this->encodeHeader($this->secureHeader($name)); $encoded_name = $this->encodeHeader($this->secureHeader($name));
if (preg_match('/[ ()<>@,;:"\/\[\]?=]/', $encoded_name)) { if (!empty($encoded_name)) {
$mime[] = sprintf(
'Content-Disposition: %s; filename="%s"%s',
$disposition,
$encoded_name,
static::$LE . static::$LE
);
} elseif (!empty($encoded_name)) {
$mime[] = sprintf( $mime[] = sprintf(
'Content-Disposition: %s; filename=%s%s', 'Content-Disposition: %s; filename=%s%s',
$disposition, $disposition,
$encoded_name, static::quotedString($encoded_name),
static::$LE . static::$LE static::$LE . static::$LE
); );
} else { } else {
@ -3127,7 +3175,7 @@ class PHPMailer
protected function encodeFile($path, $encoding = self::ENCODING_BASE64) protected function encodeFile($path, $encoding = self::ENCODING_BASE64)
{ {
try { try {
if (!static::isPermittedPath($path) || !file_exists($path)) { if (!static::fileIsAccessible($path)) {
throw new Exception($this->lang('file_open') . $path, self::STOP_CONTINUE); throw new Exception($this->lang('file_open') . $path, self::STOP_CONTINUE);
} }
$file_buffer = file_get_contents($path); $file_buffer = file_get_contents($path);
@ -3139,6 +3187,10 @@ class PHPMailer
return $file_buffer; return $file_buffer;
} catch (Exception $exc) { } catch (Exception $exc) {
$this->setError($exc->getMessage()); $this->setError($exc->getMessage());
$this->edebug($exc->getMessage());
if ($this->exceptions) {
throw $exc;
}
return ''; return '';
} }
@ -3239,7 +3291,7 @@ class PHPMailer
if ('mail' === $this->Mailer) { if ('mail' === $this->Mailer) {
$maxlen = static::MAIL_MAX_LINE_LENGTH - $overhead; $maxlen = static::MAIL_MAX_LINE_LENGTH - $overhead;
} else { } else {
$maxlen = static::STD_LINE_LENGTH - $overhead; $maxlen = static::MAX_LINE_LENGTH - $overhead;
} }
// Select the encoding that produces the shortest output and/or prevents corruption. // Select the encoding that produces the shortest output and/or prevents corruption.
@ -3509,7 +3561,7 @@ class PHPMailer
$disposition = 'inline' $disposition = 'inline'
) { ) {
try { try {
if (!static::isPermittedPath($path) || !@is_file($path)) { if (!static::fileIsAccessible($path)) {
throw new Exception($this->lang('file_access') . $path, self::STOP_CONTINUE); throw new Exception($this->lang('file_access') . $path, self::STOP_CONTINUE);
} }
@ -3858,23 +3910,25 @@ class PHPMailer
public static function isValidHost($host) public static function isValidHost($host)
{ {
//Simple syntax limits //Simple syntax limits
if (empty($host) if (
empty($host)
|| !is_string($host) || !is_string($host)
|| strlen($host) > 256 || strlen($host) > 256
|| !preg_match('/^([a-zA-Z\d.-]*|\[[a-fA-F\d:]+])$/', $host)
) { ) {
return false; return false;
} }
//Looks like a bracketed IPv6 address //Looks like a bracketed IPv6 address
if (trim($host, '[]') !== $host) { if (strlen($host) > 2 && substr($host, 0, 1) === '[' && substr($host, -1, 1) === ']') {
return (bool) filter_var(trim($host, '[]'), FILTER_VALIDATE_IP, FILTER_FLAG_IPV6); return filter_var(substr($host, 1, -1), FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) !== false;
} }
//If removing all the dots results in a numeric string, it must be an IPv4 address. //If removing all the dots results in a numeric string, it must be an IPv4 address.
//Need to check this first because otherwise things like `999.0.0.0` are considered valid host names //Need to check this first because otherwise things like `999.0.0.0` are considered valid host names
if (is_numeric(str_replace('.', '', $host))) { if (is_numeric(str_replace('.', '', $host))) {
//Is it a valid IPv4 address? //Is it a valid IPv4 address?
return (bool) filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4); return filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false;
} }
if (filter_var('http://' . $host, FILTER_VALIDATE_URL)) { if (filter_var('http://' . $host, FILTER_VALIDATE_URL) !== false) {
//Is it a syntactically valid hostname? //Is it a syntactically valid hostname?
return true; return true;
} }
@ -3927,15 +3981,28 @@ class PHPMailer
* *
* @param string $name Custom header name * @param string $name Custom header name
* @param string|null $value Header value * @param string|null $value Header value
*
* @throws Exception
*/ */
public function addCustomHeader($name, $value = null) public function addCustomHeader($name, $value = null)
{ {
if (null === $value) { if (null === $value && strpos($name, ':') !== false) {
// Value passed in as name:value // Value passed in as name:value
$this->CustomHeader[] = explode(':', $name, 2); list($name, $value) = explode(':', $name, 2);
} else {
$this->CustomHeader[] = [$name, $value];
} }
$name = trim($name);
$value = trim($value);
//Ensure name is not empty, and that neither name nor value contain line breaks
if (empty($name) || strpbrk($name . $value, "\r\n") !== false) {
if ($this->exceptions) {
throw new Exception('Invalid header name or value');
}
return false;
}
$this->CustomHeader[] = [$name, $value];
return true;
} }
/** /**
@ -3962,7 +4029,8 @@ class PHPMailer
* @param string $message HTML message string * @param string $message HTML message string
* @param string $basedir Absolute path to a base directory to prepend to relative paths to images * @param string $basedir Absolute path to a base directory to prepend to relative paths to images
* @param bool|callable $advanced Whether to use the internal HTML to text converter * @param bool|callable $advanced Whether to use the internal HTML to text converter
* or your own custom converter @return string $message The transformed message Body * or your own custom converter
* @return string The transformed message body
* *
* @throws Exception * @throws Exception
* *
@ -3979,6 +4047,7 @@ class PHPMailer
foreach ($images[2] as $imgindex => $url) { foreach ($images[2] as $imgindex => $url) {
// Convert data URIs into embedded images // Convert data URIs into embedded images
//e.g. "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" //e.g. "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="
$match = [];
if (preg_match('#^data:(image/(?:jpe?g|gif|png));?(base64)?,(.+)#', $url, $match)) { if (preg_match('#^data:(image/(?:jpe?g|gif|png));?(base64)?,(.+)#', $url, $match)) {
if (count($match) === 4 && static::ENCODING_BASE64 === $match[2]) { if (count($match) === 4 && static::ENCODING_BASE64 === $match[2]) {
$data = base64_decode($match[3]); $data = base64_decode($match[3]);
@ -4008,7 +4077,8 @@ class PHPMailer
); );
continue; continue;
} }
if (// Only process relative URLs if a basedir is provided (i.e. no absolute local paths) if (
// Only process relative URLs if a basedir is provided (i.e. no absolute local paths)
!empty($basedir) !empty($basedir)
// Ignore URLs containing parent dir traversal (..) // Ignore URLs containing parent dir traversal (..)
&& (strpos($url, '..') === false) && (strpos($url, '..') === false)
@ -4030,13 +4100,14 @@ class PHPMailer
if (strlen($directory) > 1 && '/' !== substr($directory, -1)) { if (strlen($directory) > 1 && '/' !== substr($directory, -1)) {
$directory .= '/'; $directory .= '/';
} }
if ($this->addEmbeddedImage( if (
$basedir . $directory . $filename, $this->addEmbeddedImage(
$cid, $basedir . $directory . $filename,
$filename, $cid,
static::ENCODING_BASE64, $filename,
static::_mime_types((string) static::mb_pathinfo($filename, PATHINFO_EXTENSION)) static::ENCODING_BASE64,
) static::_mime_types((string) static::mb_pathinfo($filename, PATHINFO_EXTENSION))
)
) { ) {
$message = preg_replace( $message = preg_replace(
'/' . $images[1][$imgindex] . '=["\']' . preg_quote($url, '/') . '["\']/Ui', '/' . $images[1][$imgindex] . '=["\']' . preg_quote($url, '/') . '["\']/Ui',
@ -4085,7 +4156,7 @@ class PHPMailer
public function html2text($html, $advanced = false) public function html2text($html, $advanced = false)
{ {
if (is_callable($advanced)) { if (is_callable($advanced)) {
return $advanced($html); return call_user_func($advanced, $html);
} }
return html_entity_decode( return html_entity_decode(
@ -4184,6 +4255,7 @@ class PHPMailer
'tiff' => 'image/tiff', 'tiff' => 'image/tiff',
'tif' => 'image/tiff', 'tif' => 'image/tiff',
'webp' => 'image/webp', 'webp' => 'image/webp',
'avif' => 'image/avif',
'heif' => 'image/heif', 'heif' => 'image/heif',
'heifs' => 'image/heif-sequence', 'heifs' => 'image/heif-sequence',
'heic' => 'image/heic', 'heic' => 'image/heic',
@ -4347,7 +4419,7 @@ class PHPMailer
$breaktype = static::$LE; $breaktype = static::$LE;
} }
// Normalise to \n // Normalise to \n
$text = str_replace(["\r\n", "\r"], "\n", $text); $text = str_replace([self::CRLF, "\r"], "\n", $text);
// Now convert LE as needed // Now convert LE as needed
if ("\n" !== $breaktype) { if ("\n" !== $breaktype) {
$text = str_replace("\n", $breaktype, $text); $text = str_replace("\n", $breaktype, $text);
@ -4356,6 +4428,18 @@ class PHPMailer
return $text; return $text;
} }
/**
* Remove trailing breaks from a string.
*
* @param string $text
*
* @return string The text to remove breaks from
*/
public static function stripTrailingWSP($text)
{
return rtrim($text, " \r\n\t");
}
/** /**
* Return the current line break format string. * Return the current line break format string.
* *
@ -4442,11 +4526,15 @@ class PHPMailer
$privKey = openssl_pkey_get_private($privKeyStr); $privKey = openssl_pkey_get_private($privKeyStr);
} }
if (openssl_sign($signHeader, $signature, $privKey, 'sha256WithRSAEncryption')) { if (openssl_sign($signHeader, $signature, $privKey, 'sha256WithRSAEncryption')) {
openssl_pkey_free($privKey); if (PHP_MAJOR_VERSION < 8) {
openssl_pkey_free($privKey);
}
return base64_encode($signature); return base64_encode($signature);
} }
openssl_pkey_free($privKey); if (PHP_MAJOR_VERSION < 8) {
openssl_pkey_free($privKey);
}
return ''; return '';
} }
@ -4464,13 +4552,15 @@ class PHPMailer
*/ */
public function DKIM_HeaderC($signHeader) public function DKIM_HeaderC($signHeader)
{ {
//Normalize breaks to CRLF (regardless of the mailer)
$signHeader = static::normalizeBreaks($signHeader, self::CRLF);
//Unfold header lines
//Note PCRE \s is too broad a definition of whitespace; RFC5322 defines it as `[ \t]` //Note PCRE \s is too broad a definition of whitespace; RFC5322 defines it as `[ \t]`
//@see https://tools.ietf.org/html/rfc5322#section-2.2 //@see https://tools.ietf.org/html/rfc5322#section-2.2
//That means this may break if you do something daft like put vertical tabs in your headers. //That means this may break if you do something daft like put vertical tabs in your headers.
//Unfold header lines
$signHeader = preg_replace('/\r\n[ \t]+/', ' ', $signHeader); $signHeader = preg_replace('/\r\n[ \t]+/', ' ', $signHeader);
//Break headers out into an array //Break headers out into an array
$lines = explode("\r\n", $signHeader); $lines = explode(self::CRLF, $signHeader);
foreach ($lines as $key => $line) { foreach ($lines as $key => $line) {
//If the header is missing a :, skip it as it's invalid //If the header is missing a :, skip it as it's invalid
//This is likely to happen because the explode() above will also split //This is likely to happen because the explode() above will also split
@ -4490,7 +4580,7 @@ class PHPMailer
$lines[$key] = trim($heading, " \t") . ':' . trim($value, " \t"); $lines[$key] = trim($heading, " \t") . ':' . trim($value, " \t");
} }
return implode("\r\n", $lines); return implode(self::CRLF, $lines);
} }
/** /**
@ -4507,13 +4597,13 @@ class PHPMailer
public function DKIM_BodyC($body) public function DKIM_BodyC($body)
{ {
if (empty($body)) { if (empty($body)) {
return "\r\n"; return self::CRLF;
} }
// Normalize line endings to CRLF // Normalize line endings to CRLF
$body = static::normalizeBreaks($body, "\r\n"); $body = static::normalizeBreaks($body, self::CRLF);
//Reduce multiple trailing line breaks to a single one //Reduce multiple trailing line breaks to a single one
return rtrim($body, "\r\n") . "\r\n"; return static::stripTrailingWSP($body) . self::CRLF;
} }
/** /**
@ -4534,17 +4624,18 @@ class PHPMailer
$DKIMquery = 'dns/txt'; // Query method $DKIMquery = 'dns/txt'; // Query method
$DKIMtime = time(); $DKIMtime = time();
//Always sign these headers without being asked //Always sign these headers without being asked
//Recommended list from https://tools.ietf.org/html/rfc6376#section-5.4.1
$autoSignHeaders = [ $autoSignHeaders = [
'From', 'from',
'To', 'to',
'CC', 'cc',
'Date', 'date',
'Subject', 'subject',
'Reply-To', 'reply-to',
'Message-ID', 'message-id',
'Content-Type', 'content-type',
'Mime-Version', 'mime-version',
'X-Mailer', 'x-mailer',
]; ];
if (stripos($headers_line, 'Subject') === false) { if (stripos($headers_line, 'Subject') === false) {
$headers_line .= 'Subject: ' . $subject . static::$LE; $headers_line .= 'Subject: ' . $subject . static::$LE;
@ -4579,7 +4670,7 @@ class PHPMailer
$headersToSign = []; $headersToSign = [];
foreach ($parsedHeaders as $header) { foreach ($parsedHeaders as $header) {
//Is this header one that must be included in the DKIM signature? //Is this header one that must be included in the DKIM signature?
if (in_array($header['label'], $autoSignHeaders, true)) { if (in_array(strtolower($header['label']), $autoSignHeaders, true)) {
$headersToSignKeys[] = $header['label']; $headersToSignKeys[] = $header['label'];
$headersToSign[] = $header['label'] . ': ' . $header['value']; $headersToSign[] = $header['label'] . ': ' . $header['value'];
if ($this->DKIM_copyHeaderFields) { if ($this->DKIM_copyHeaderFields) {
@ -4617,9 +4708,9 @@ class PHPMailer
//Fold long values //Fold long values
if (strlen($copiedHeader) > self::STD_LINE_LENGTH - 3) { if (strlen($copiedHeader) > self::STD_LINE_LENGTH - 3) {
$copiedHeaderFields .= substr( $copiedHeaderFields .= substr(
chunk_split($copiedHeader, self::STD_LINE_LENGTH - 3, static::$LE . ' '), chunk_split($copiedHeader, self::STD_LINE_LENGTH - 3, static::$LE . self::FWS),
0, 0,
-strlen(static::$LE . ' ') -strlen(static::$LE . self::FWS)
); );
} else { } else {
$copiedHeaderFields .= $copiedHeader; $copiedHeaderFields .= $copiedHeader;
@ -4631,7 +4722,6 @@ class PHPMailer
$headerKeys = ' h=' . implode(':', $headersToSignKeys) . ';' . static::$LE; $headerKeys = ' h=' . implode(':', $headersToSignKeys) . ';' . static::$LE;
$headerValues = implode(static::$LE, $headersToSign); $headerValues = implode(static::$LE, $headersToSign);
$body = $this->DKIM_BodyC($body); $body = $this->DKIM_BodyC($body);
$DKIMlen = strlen($body); // Length of body
$DKIMb64 = base64_encode(pack('H*', hash('sha256', $body))); // Base64 of packed binary SHA-256 hash of body $DKIMb64 = base64_encode(pack('H*', hash('sha256', $body))); // Base64 of packed binary SHA-256 hash of body
$ident = ''; $ident = '';
if ('' !== $this->DKIM_identity) { if ('' !== $this->DKIM_identity) {
@ -4645,7 +4735,6 @@ class PHPMailer
' s=' . $this->DKIM_selector . ';' . static::$LE . ' s=' . $this->DKIM_selector . ';' . static::$LE .
' a=' . $DKIMsignatureType . ';' . ' a=' . $DKIMsignatureType . ';' .
' q=' . $DKIMquery . ';' . ' q=' . $DKIMquery . ';' .
' l=' . $DKIMlen . ';' .
' t=' . $DKIMtime . ';' . ' t=' . $DKIMtime . ';' .
' c=' . $DKIMcanonicalization . ';' . static::$LE . ' c=' . $DKIMcanonicalization . ';' . static::$LE .
$headerKeys . $headerKeys .
@ -4658,9 +4747,9 @@ class PHPMailer
$headerValues . static::$LE . $dkimSignatureHeader $headerValues . static::$LE . $dkimSignatureHeader
); );
$signature = $this->DKIM_Sign($canonicalizedHeaders); $signature = $this->DKIM_Sign($canonicalizedHeaders);
$signature = trim(chunk_split($signature, self::STD_LINE_LENGTH - 3, static::$LE . ' ')); $signature = trim(chunk_split($signature, self::STD_LINE_LENGTH - 3, static::$LE . self::FWS));
return static::normalizeBreaks($dkimSignatureHeader . $signature) . static::$LE; return static::normalizeBreaks($dkimSignatureHeader . $signature);
} }
/** /**
@ -4676,6 +4765,28 @@ class PHPMailer
return (bool) preg_match('/^(.{' . (self::MAX_LINE_LENGTH + strlen(static::$LE)) . ',})/m', $str); return (bool) preg_match('/^(.{' . (self::MAX_LINE_LENGTH + strlen(static::$LE)) . ',})/m', $str);
} }
/**
* If a string contains any "special" characters, double-quote the name,
* and escape any double quotes with a backslash.
*
* @param string $str
*
* @return string
*
* @see RFC822 3.4.1
*/
public static function quotedString($str)
{
if (preg_match('/[ ()<>@,;:"\/\[\]?=]/', $str)) {
//If the string contains any of these chars, it must be double-quoted
//and any double quotes must be escaped with a backslash
return '"' . str_replace('"', '\\"', $str) . '"';
}
//Return the string untouched, it doesn't need quoting
return $str;
}
/** /**
* Allows for public read access to 'to' property. * Allows for public read access to 'to' property.
* Before the send() call, queued addresses (i.e. with IDN) are not yet included. * Before the send() call, queued addresses (i.e. with IDN) are not yet included.

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* PHPMailer RFC821 SMTP email transport class. * PHPMailer RFC821 SMTP email transport class.
* PHP Version 5.5. * PHP Version 5.5.
@ -9,7 +10,7 @@
* @author Jim Jagielski (jimjag) <jimjag@gmail.com> * @author Jim Jagielski (jimjag) <jimjag@gmail.com>
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net> * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
* @author Brent R. Matzelle (original founder) * @author Brent R. Matzelle (original founder)
* @copyright 2012 - 2019 Marcus Bointon * @copyright 2012 - 2020 Marcus Bointon
* @copyright 2010 - 2012 Jim Jagielski * @copyright 2010 - 2012 Jim Jagielski
* @copyright 2004 - 2009 Andy Prevost * @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
@ -34,7 +35,7 @@ class SMTP
* *
* @var string * @var string
*/ */
const VERSION = '6.1.3'; const VERSION = '6.2.0';
/** /**
* SMTP line break constant. * SMTP line break constant.
@ -311,12 +312,6 @@ class SMTP
*/ */
public function connect($host, $port = null, $timeout = 30, $options = []) public function connect($host, $port = null, $timeout = 30, $options = [])
{ {
static $streamok;
//This is enabled by default since 5.0.0 but some providers disable it
//Check this once and cache the result
if (null === $streamok) {
$streamok = function_exists('stream_socket_client');
}
// Clear errors to avoid confusion // Clear errors to avoid confusion
$this->setError(''); $this->setError('');
// Make sure we are __not__ connected // Make sure we are __not__ connected
@ -335,12 +330,48 @@ class SMTP
(count($options) > 0 ? var_export($options, true) : 'array()'), (count($options) > 0 ? var_export($options, true) : 'array()'),
self::DEBUG_CONNECTION self::DEBUG_CONNECTION
); );
$this->smtp_conn = $this->getSMTPConnection($host, $port, $timeout, $options);
if ($this->smtp_conn === false) {
//Error info already set inside `getSMTPConnection()`
return false;
}
$this->edebug('Connection: opened', self::DEBUG_CONNECTION);
// Get any announcement
$this->last_reply = $this->get_lines();
$this->edebug('SERVER -> CLIENT: ' . $this->last_reply, self::DEBUG_SERVER);
return true;
}
/**
* Create connection to the SMTP server.
*
* @param string $host SMTP server IP or host name
* @param int $port The port number to connect to
* @param int $timeout How long to wait for the connection to open
* @param array $options An array of options for stream_context_create()
*
* @return false|resource
*/
protected function getSMTPConnection($host, $port = null, $timeout = 30, $options = [])
{
static $streamok;
//This is enabled by default since 5.0.0 but some providers disable it
//Check this once and cache the result
if (null === $streamok) {
$streamok = function_exists('stream_socket_client');
}
$errno = 0; $errno = 0;
$errstr = ''; $errstr = '';
if ($streamok) { if ($streamok) {
$socket_context = stream_context_create($options); $socket_context = stream_context_create($options);
set_error_handler([$this, 'errorHandler']); set_error_handler([$this, 'errorHandler']);
$this->smtp_conn = stream_socket_client( $connection = stream_socket_client(
$host . ':' . $port, $host . ':' . $port,
$errno, $errno,
$errstr, $errstr,
@ -356,7 +387,7 @@ class SMTP
self::DEBUG_CONNECTION self::DEBUG_CONNECTION
); );
set_error_handler([$this, 'errorHandler']); set_error_handler([$this, 'errorHandler']);
$this->smtp_conn = fsockopen( $connection = fsockopen(
$host, $host,
$port, $port,
$errno, $errno,
@ -365,8 +396,9 @@ class SMTP
); );
restore_error_handler(); restore_error_handler();
} }
// Verify we connected properly // Verify we connected properly
if (!is_resource($this->smtp_conn)) { if (!is_resource($connection)) {
$this->setError( $this->setError(
'Failed to connect to server', 'Failed to connect to server',
'', '',
@ -381,22 +413,19 @@ class SMTP
return false; return false;
} }
$this->edebug('Connection: opened', self::DEBUG_CONNECTION);
// SMTP server can take longer to respond, give longer timeout for first read // SMTP server can take longer to respond, give longer timeout for first read
// Windows does not have support for this timeout function // Windows does not have support for this timeout function
if (strpos(PHP_OS, 'WIN') !== 0) { if (strpos(PHP_OS, 'WIN') !== 0) {
$max = (int) ini_get('max_execution_time'); $max = (int)ini_get('max_execution_time');
// Don't bother if unlimited // Don't bother if unlimited, or if set_time_limit is disabled
if (0 !== $max && $timeout > $max) { if (0 !== $max && $timeout > $max && strpos(ini_get('disable_functions'), 'set_time_limit') === false) {
@set_time_limit($timeout); @set_time_limit($timeout);
} }
stream_set_timeout($this->smtp_conn, $timeout, 0); stream_set_timeout($connection, $timeout, 0);
} }
// Get any announcement
$announce = $this->get_lines();
$this->edebug('SERVER -> CLIENT: ' . $announce, self::DEBUG_SERVER);
return true; return $connection;
} }
/** /**
@ -511,11 +540,12 @@ class SMTP
return false; return false;
} }
// Send encoded username and password // Send encoded username and password
if (!$this->sendCommand( if (
'User & Password', !$this->sendCommand(
base64_encode("\0" . $username . "\0" . $password), 'User & Password',
235 base64_encode("\0" . $username . "\0" . $password),
) 235
)
) { ) {
return false; return false;
} }
@ -1058,8 +1088,10 @@ class SMTP
{ {
//If SMTP transcripts are left enabled, or debug output is posted online //If SMTP transcripts are left enabled, or debug output is posted online
//it can leak credentials, so hide credentials in all but lowest level //it can leak credentials, so hide credentials in all but lowest level
if (self::DEBUG_LOWLEVEL > $this->do_debug && if (
in_array($command, ['User & Password', 'Username', 'Password'], true)) { self::DEBUG_LOWLEVEL > $this->do_debug &&
in_array($command, ['User & Password', 'Username', 'Password'], true)
) {
$this->edebug('CLIENT -> SERVER: [credentials hidden]', self::DEBUG_CLIENT); $this->edebug('CLIENT -> SERVER: [credentials hidden]', self::DEBUG_CLIENT);
} else { } else {
$this->edebug('CLIENT -> SERVER: ' . $data, self::DEBUG_CLIENT); $this->edebug('CLIENT -> SERVER: ' . $data, self::DEBUG_CLIENT);
@ -1166,13 +1198,41 @@ class SMTP
$selW = null; $selW = null;
while (is_resource($this->smtp_conn) && !feof($this->smtp_conn)) { while (is_resource($this->smtp_conn) && !feof($this->smtp_conn)) {
//Must pass vars in here as params are by reference //Must pass vars in here as params are by reference
if (!stream_select($selR, $selW, $selW, $this->Timelimit)) { //solution for signals inspired by https://github.com/symfony/symfony/pull/6540
set_error_handler([$this, 'errorHandler']);
$n = stream_select($selR, $selW, $selW, $this->Timelimit);
restore_error_handler();
if ($n === false) {
$message = $this->getError()['detail'];
$this->edebug( $this->edebug(
'SMTP -> get_lines(): timed-out (' . $this->Timeout . ' sec)', 'SMTP -> get_lines(): select failed (' . $message . ')',
self::DEBUG_LOWLEVEL
);
//stream_select returns false when the `select` system call is interrupted
//by an incoming signal, try the select again
if (stripos($message, 'interrupted system call') !== false) {
$this->edebug(
'SMTP -> get_lines(): retrying stream_select',
self::DEBUG_LOWLEVEL
);
$this->setError('');
continue;
}
break;
}
if (!$n) {
$this->edebug(
'SMTP -> get_lines(): select timed-out in (' . $this->Timelimit . ' sec)',
self::DEBUG_LOWLEVEL self::DEBUG_LOWLEVEL
); );
break; break;
} }
//Deliberate noise suppression - errors are handled afterwards //Deliberate noise suppression - errors are handled afterwards
$str = @fgets($this->smtp_conn, self::MAX_REPLY_LENGTH); $str = @fgets($this->smtp_conn, self::MAX_REPLY_LENGTH);
$this->edebug('SMTP INBOUND: "' . trim($str) . '"', self::DEBUG_LOWLEVEL); $this->edebug('SMTP INBOUND: "' . trim($str) . '"', self::DEBUG_LOWLEVEL);
@ -1187,7 +1247,7 @@ class SMTP
$info = stream_get_meta_data($this->smtp_conn); $info = stream_get_meta_data($this->smtp_conn);
if ($info['timed_out']) { if ($info['timed_out']) {
$this->edebug( $this->edebug(
'SMTP -> get_lines(): timed-out (' . $this->Timeout . ' sec)', 'SMTP -> get_lines(): stream timed-out (' . $this->Timeout . ' sec)',
self::DEBUG_LOWLEVEL self::DEBUG_LOWLEVEL
); );
break; break;
@ -1344,6 +1404,7 @@ class SMTP
} else { } else {
$this->last_smtp_transaction_id = false; $this->last_smtp_transaction_id = false;
foreach ($this->smtp_transaction_id_patterns as $smtp_transaction_id_pattern) { foreach ($this->smtp_transaction_id_patterns as $smtp_transaction_id_pattern) {
$matches = [];
if (preg_match($smtp_transaction_id_pattern, $reply, $matches)) { if (preg_match($smtp_transaction_id_pattern, $reply, $matches)) {
$this->last_smtp_transaction_id = trim($matches[1]); $this->last_smtp_transaction_id = trim($matches[1]);
break; break;