0
0
mirror of https://github.com/PHPMailer/PHPMailer.git synced 2024-09-20 10:02:14 +02:00
Commit Graph

457 Commits

Author SHA1 Message Date
Juliette
6d613a4c8b
Tests: move ICal tests to own file (#2384)
* Tests/reorganize: move ICal tests to own file

* ICalTest: reorganize to use data providers

These three tests were 99% duplicate code. Using a data provider removes the duplication, while the actual tests being run are still 100% the same, including same test count and assertion count.

* ICalTest: add additional tests

... to ensure all valid methods are checked.

Adding these extra tests is a breeze now with the data provider setup.

* ICalTest: various test tweaks

Minor test tweaks:
* Add `@covers` tag. **_<- is this correct ?_**
* Minor comment punctuation.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-24 21:18:12 +02:00
Juliette
a4e3c130ae
Tests: move OAuth test to own file (#2383)
* Tests/reorganize: move OAuth test to own file

This test uses the `Yoast\PHPUnitPolyfills\TestCases\TestCase` instead of the `PHPMailer\Test\TestCase` base class as it doesn't need the `set_up()` or `tear_down()` methods from the PHPMailer base test class.

* OAuthTest: various test tweaks

Minor test tweaks:
* Add `@covers` tags.
* Add "failure" messages to assertions.
* Minor comment punctuation.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-24 19:19:36 +02:00
Juliette
8317ed0bb5
Tests: move POP before SMTP tests to separate file (#2382)
* Tests/reorganize: move POP before SMTP tests to own file

This also removed the `$pids` property and handling from the PHPMailer base `TestCase` and moves this to the POP test class.

As this test now does not actually need an instantiated PHPMailer object, this class extends the `Yoast\PHPUnitPolyfills\TestCases\TestCase` instead of the `PHPMailer\Test\TestCase`.

* PopBeforeSmtpTest: move `@group` tags

... to the class level and remove them from the individual test functions.

* PopBeforeSmtpTest: various test tweaks

Minor test tweaks:
* Add `@covers` tag at class level.
* Inline comment punctuation.
* Minor code readability tweaks.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-24 15:22:24 +02:00
Juliette
d2780d4125
Tests: move tests related to DKIM to separate file (#2381)
* Tests/reorganize: move DKIM related tests to own file

* DKIMTest: stabilize removal of private key file

When an assertion in a test fails, the rest of the code within the test method is no longer executed.
This means that for a test which - like three out of the five DKIM test - creates a file, the test "clean up" via `unlink()` is also no longer executed.
It also means that one test may - unintentionally - interfere with the results of another test due to the file still existing, while it is expected to have been removed.

Aside from that, the `$privatekeyfile` variable used in the various test is the same everywhere, but not consistently used in the tests, as the `'dkim_private.pem'` is hard-coded in multiple places, which decreases maintainability.

This commit fixes both these issues by:
* Declaring a class constant with the target private key file name for use in the test method.
* Implements use of this constant throughout the tests.
* Removes the `unlink()` call from the individual tests, in favour of executing it via the test `tear_down()`, which should still be executed, even when a test has failed.
    Note: as the file also contains two tests which do not create the private key file, but for which the `tear_down()` would also be executed, the `unlink()` call is wrapped in a `file_exists()`.

* DKIMTest: move `@group` tags

... to the class level and remove them from the individual test functions.

* DKIMTest: add missing `@requires` tags

Three out of the five tests actually require the `openssl` extension. Only one was so marked.

* DKIMTest: various test tweaks

Minor test tweaks:
* Rename a test to a more specific name to allow for easier test filtering via PHPUnit.
* Add `@covers` tags (Needs review!)
* The `@see` tag is indented for code elements. For external links, the `@link` tag should be used.
* Inline comment punctuation.
* Minor code readability tweaks.

* DKIMTest: add two additional tests

... to cover the "open SSL" not available case.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-24 13:20:27 +02:00
Juliette
b7910e3978
Tests: move tests for the various mail transports to separate file (#2380)
* Tests/reorganize: move email transport tests to own file

* MailTransportTest: various test tweaks

Minor test tweaks:
* Add `@covers` tags (Needs review! - especially the `testMailSend()` method seems to do more than it should)
* Check if test skipping is necessary at the start of a test method.
* Add "failure message" for each assertion in tests with multiple assertions.
* Tidy up inline comments.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-24 10:30:20 +02:00
Marcus Bointon
3991967c80
Only need these validator functions to be loaded for this test 2021-06-23 23:50:26 +02:00
Marcus Bointon
ff1abf608c
Don't need this noise; a failing test is enough 2021-06-23 23:42:09 +02:00
Juliette
ee70f2265e
Tests: move tests for PHPMailer::validateAddress with custom validator to separate file (#2379)
* Tests/reorganize: move email validation using custom validator test to own file

* ValidateAddressCustomValidatorTest: reorganize test

Split the test into three tests, each testing a specific situation and use a data provider for one of the tests.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-23 23:42:01 +02:00
Juliette
e6445ac201
Tests: move tests for PHPMailer::validateAddress to separate file (#2378)
* Tests/reorganize: move email validation test to own file

As this test does not actually need an instantiated PHPMailer object, this class extends the `Yoast\PHPUnitPolyfills\TestCases\TestCase` instead of the `PHPMailer\Test\TestCase`.

* ValidateAddressTest: reorganize to use data providers

The original test as was, would run through a number of arrays and keep track of fails/passes, only to use an assertion at the end to check that the list of "fails" was empty.
In addition to this, the original test also contained some additional assertions which would never be run if the earlier assertion would fail. (failing assertion possibly hiding more failing (or passing) assertions).

Using data providers for these kind of data array based tests, has a couple of advantages:
1. Each data set is counted as an individual test.
2. Each test can be set up to have only one assertion.
3. When a test for a data set fails, PHPUnit just moves on to the next data set, instead of failing the test and not examining the rest of the test cases.

With that in mind, this test has now been reorganized into multiple test functions, each with one or more data providers.

In addition to that:
* Each data set in a test provider is named after the email address it provides, with optionally a prefix to show which data provider it came from.
    This has two advantages:
    1. When using the `--testdox` runner, the output will list each test case by name.
    2. When a test fails, instead of getting a "failed with data set 65" message, you now get a "failed with data set _data set name_" message, and as the data set name is the same as the email address value, it's easy to see which test case failed.
* Each assertion now has a "failure message" attached, as the default "true does not match false" message from PHPUnit is not very descriptive.

* ValidateAddressTest: enable two out of three of the unused data sets

The original test contained three additional data sets which were *not* being tested:
* `$invalidphp`
* `$validqandc`
* `$validipv6`

The `$invalidphp` data set has now been set up as a data provider and has been added to the `testInvalidAddresses()` test.
The `$validipv6` data set has now been set up as a data provider and has been added to the `testValidAddresses()` test.

And the `$validqandc` data set has been removed after consultation with synchro.

Note: there are six test in the `$validipv6` array which are currently failing. Those have been commented out to be addressed later.

* ValidateAddressTest: add `@todo`

While the tests in this class will show that the `PHPMailer::validateAddress()` is 100% covered by tests, the tests do **not** in actual fact test all functionality properly.

To that end, I've added a recommendation in a `@todo` at the top of the class to document how these tests could be further improved in a future iteration.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-23 23:09:07 +02:00
Juliette
c576a531b1
PHPMailerLangTest: rename and minor tweaks (#2377)
* PHPMailerLangTest: rename test class to `TranslationCompletenessTest`

As the test class has been moved to a separate directory, we may as well make the class name more descriptive of what the test class actually does.

* TranslationCompletenessTest: various test tweaks

Minor test tweaks:
* Move `@group` tag up to class level.
* Add a `@coversNothing` tag as this test is more a maintainer utility/package test than a test to cover functionality in code.
* Tidy up inline comments.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-23 23:04:15 +02:00
Juliette
6372ff87c1
Tests: introduce base testcase and move test classes to subdirectories (#2376)
* Tests/reorganize: add an abstract base testcase

As a first step towards reorganizing the tests, this commit:
* Creates an abstract base `TestCase` class which can be extended by concrete child test classes and holds the generic properties and helper methods for use throughout the tests.
    Based on their use, the visibility of properties and methods have been adjusted for the new setup.
* Removes the generic property and helper method declarations from the concrete test class.
* Moves the `require` statement for the `validators.php` file to a `set_up_before_class()` method in the base `TestCase`.

* Tests/reorganize: define base directory in set_up_before_class

The `$this->INCLUDE_DIR` property which points to the project root directory does not change at any time during the test run, but was being redefined for every test in the `set_up()` method.

As this is in effect a _constant_ value, let's define it as a constant in the TestCase `set_up_before_class()` method instead.

Notes:
Both actions executed in the `set_up_before_class()` method are typically things for a test bootstrap file.
However, to allow for PHPUnit to be able to run from both a Composer install as well as a Phar file, without having to create custom autoloaders, it is simpler to have the `vendor/autoload.php` file as the bootstrap file as, in that case, PHPUnit will handle the loading order and prevent loading conflicting PHPUnit files from a Composer install when running via the Phar.
With this in mind, putting these actions in a `set_up_before_class()` method is a valid compromise.

* Tests/reorganize: move actual test files to subdirectories

... leaving the test root directory to only contain test utility files.

Note: I've added a second entry for the test generated files to the `.gitignore`. Adding this entry instead of replacing the entry allows for any existing generated files in contributor clones to continue to be ignored.
At a later point in time, it could be elected to remove the original entry, once all active contributors have updated their installs and removed any stray generated files from their `test` root directories.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-23 22:43:46 +02:00
Juliette
c33a304650
Tests: various improvements (#2372)
* Tests: remove unused test bootstrap file

The PHPUnit config file requires the `vendor/autoload.php` file as the test bootstrap and this file is not referenced anywhere in the code base, so this is dead code.

* Tests: apply test method naming conventions

For tests to be picked up by PHPUnit automatically, the method should start with the prefix `test`.
For differently named tests, the `@test` annotation can be used to still mark a method as a test and get PHPUnit to run it.

As the vast majority of tests use the "prefix the method with `test`" convention, this changes the names of the few tests which did not comply with that convention and removes the `@test` annotations.

* Tests: use test skipping where appropriate

In this case, the condition being tested should never be `false`, so could possibly be removed.

All the same, if the condition _would_ result in a `false`, the test would be marked as "risky" as no assertions would be run by it.

This can be avoided by using the condition to set a test skip annotation, instead of wrapping the actual test code in the condition.

* Tests: use strict assertions

PHPUnit contains a variety of assertions and the ones available has been extended hugely over the years.
To have the most reliable tests, the most specific assertion should be used.

Most notably, this changes calls to `assertEquals()` to `assertSame()`, where `assertEquals()` does a loose type comparison `==` and `assertSame()` does a strict type `===` comparison.

The only real exception to this is when comparing two objects, as in that case, the objectID will not be the same, so those should still use `assertEquals()` - or the PHPUnit 9.4.0 `assertObjectEquals()` method for comparing value objects using a callback method in the ValueObject class.

* Tests: use the correct parameter order

For PHPUnit assertions which expect an `$expected` and a `$result` parameter, the parameter order is always `( $expected, $result, ...).

While it may not seem important to use the correct parameter order for assertions doing a straight comparison, in actual fact, it is.
The PHPUnit output when the assertions fail expects this order and the failure message will be reversed if the parameters are passed in reversed order which leads to confusion and makes it more difficult to debug a failing test.

* Tests: use static closures

... when the closure doesn't use `$this`.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-23 11:01:19 +02:00
Marcus Bointon
acd264bf17
Merge branch 'CVE-2021-34551'
# Conflicts:
#	SECURITY.md
#	changelog.md
2021-06-16 16:02:29 +02:00
Marcus Bointon
45f3c18dc6
Deny string-based callables altogether 2021-06-15 17:37:24 +02:00
Marcus Bointon
de90099080
Add tests for injected validators 2021-06-15 14:54:40 +02:00
Marcus Bointon
8107a91852
WIP 2021-06-10 22:31:30 +02:00
Marcus Bointon
fd7ec67a7c
Add more tests for bad paths 2021-04-29 10:53:19 +02:00
Marcus Bointon
bc51d1f607
Add not-strictly-necessary backslash to avoid ambiguity 2021-04-29 10:51:05 +02:00
Marcus Bointon
e86e4e3f2a
CS 2021-02-19 16:04:57 +01:00
Marcus Bointon
0f24617b0c
Consistent comment style 2021-02-19 13:42:01 +01:00
Marcus Bointon
e28e3552a5
Remove test env diagnostic 2021-02-19 09:37:25 +01:00
Marcus Bointon
0a191cc7ec
More IDN twiddling 2021-02-18 23:46:33 +01:00
Marcus Bointon
7f22287bdb
More IDN twiddling 2021-02-18 23:14:13 +01:00
Marcus Bointon
f9cc642d6d
CS 2021-02-18 14:44:15 +01:00
Marcus Bointon
34e1c900be
Charset woes 2021-02-18 14:35:27 +01:00
Marcus Bointon
7aa80026cb
CS 2021-02-18 11:48:59 +01:00
Marcus Bointon
e2eb2304fe
Decode encoded names in the address parser, see #2266 2021-02-18 11:46:07 +01:00
Juliette
78bda9997d
Make the tests PHPUnit cross version compatible + test on PHP 8 (#2202)
* .gitignore: ignore files created during a test run

* Tests: make config cross-version compatible

PHPUnit config file:

* Add `backupGlobals="true"`.
    The default value for this setting changed in PHPUnit 6 from `true` to `false`. By explicitly setting it to `true`, the existing behaviour is maintained.
* Remove the `logIncompleteSkipped` directive which is no longer supported.
* Remove a number of directives which use the default values and for which the defaults have not changed across PHPUnit versions.
* Remove the space in the testsuite name to make it more easily usable on the command line.
* Make sure that all src files are taken into consideration when calculating code coverage.
* Add XSD schema reference.
    Note: the config as-is will now validate for PHPUnit 4.4-9.2. For PHPUnit 9.3, the code coverage terminology has changed, though the "old" configuration is still supported.
    If needs be (PHPUnit 10), the config can be updated on the fly by using `--migrate-configuration`.

Other:
* Ignore a locally overloaded PHPUnit config file using the standard `phpunit.xml` file name.

Question: why does the config file not use the standard `phpunit.xml.dist` file name ? That would allow for running the tests without command line arguments.
That file can still be overloaded locally by a `phpunit.xml` file.

* Composer: add dependency on the PHPUnit Polyfills package

* Adds a dev dependency to the `yoast/phpunit-polyfills` package.
* As that package already requires and manages the installable versions for PHPUnit, remove this as an explicit requirement from `require-dev` in favour of letting the PHPUnit Polyfills package manage the versions.
    This will update the supported PHPUnit versions from `^4.8 || ^5.7` to `^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0`.
    Note: the supported versions for PHPUnit 4.x and 5.x are very specific and restrictive as it specifically targets the versions in which the "forward compatible" alias files for the namespaced classes are available.

This new package adds the following features:
* Polyfills for various PHPUnit cross-version changes.
* Basic test case and test listener.

Refs:
* https://github.com/Yoast/PHPUnit-Polyfills/

Includes adding the PHPUnit cache file, which is automatically created in PHPUnit 8 and 9, to the `.gitignore` file.

* Tests: switch over to use the Yoast\PHPUnitPolyfills\TestCases\TestCase

This switches the parent class of the test classes over `TestCase` from the PHPUnit native TestCase to the `Yoast\PHPUnitPolyfills\TestCases\TestCase`.

The Yoast `TestCase`:
* Provides cross-version compatibility using snake case fixture method names instead of the PHPUnit native camelCase names.

This switch over includes:
* Renaming the `setUp()` and `tearDown()` methods to, respectively, `set_up()` and `tear_down()` in various test classes for PHPUnit cross-version compatibility.

* Tests: switch over to use the Yoast Polyfill TestListenerDefaultImplementation

This switches `DebugLogTestListener` class over to using the PHPUnit 9 default implementation pattern in combination with using the `TestListenerDefaultImplementation` from the PHPUnit Polyfill library for the cross-version compatibility layer for the TestListener.

The Yoast `TestListenerDefaultImplementation`:
* Provides cross-version compatibility using snake case method names instead of the PHPUnit native camelCase names.

This switch over includes:
* Renaming the template methods used in the `DebugLogTestListener` to use their snake_case variant and removes the type declarations.

* Tests: switch out `assertInternalType()`

... in favour of the more specific assertion(s) as introduced in PHPUnit 7.5.0.

The new assertions are automatically polyfilled via the PHPUnit Polyfill repo as this test class extends the `Yoast\PHPUnitPolyfills\TestCases\TestCase` test case.

* Tests: switch out `assert[Not]Contains()` with string haystacks

... in favour of the string specific `assertString[Not]ContainsString() assertion(s) as introduced in PHPUnit 7.5.0.

The new assertions are automatically polyfilled via the PHPUnit Polyfill repo as this test class extends the `Yoast\PHPUnitPolyfills\TestCases\TestCase` test case.

* Tests: switch out `@expectException` annotations

... in favour of method calls to the `TestCase::expectException()` method as introduced in PHPUnit 5.2.0.

The new method and its variants are automatically polyfilled via the PHPUnit Polyfill repo as this test class extends the `Yoast\PHPUnitPolyfills\TestCases\TestCase` test case.

* Tests: switch out `assertRegExp()`

... in favour of the renamed `Assert::assertMatchesRegularExpression() as introduced in PHPUnit 9.1.0.

The new assertion is automatically polyfilled via the PHPUnit Polyfill repo as this test class extends the `Yoast\PHPUnitPolyfills\TestCases\TestCase` test case.

* Tests: mark a test as incomplete

As per the comment in the docblock:
> Needs a connection to a server that supports this auth mechanism, so commented out by default.

As the test cannot currently be executed succesfully, we may as well skip it with a meaningful message.

* Tests: mark a test as not performing assertions

... to prevent it from being marked as risky.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2020-11-25 15:35:50 +01:00
Juliette
600bcde8a8
Travis: simplify and improve setup and run tests on php 5.5 (#2183)
* Travis: reorder the config

No functional changes.

* Travis: remove redundant env variable

The "CS check" is being run in its own stage with its own script, so there is no need for this environment variable anymore.

* Travis: disable Xdebug before running Composer

Composer can be slower when Xdebug is enabled, so when Xdebug isn't needed, let's disable it _before_ running Composer.

* Travis: remove duplicate build definitions

The default stage is the `test` stage and all builds defined in the `php` key, possibly combined with an `env` key, will automatically be build in the `test` stage.

No need to define them twice.

The only builds to declare explicitly in `jobs` are those which need custom `env`, `dist`, `script`s etc.

So:
* Remove those builds which don't need anything "custom" from the `jobs` key.
* Remove the one build which _does_ need something "custom" from the `php` key.

* Travis: re-enable testing against PHP 5.5

PHP 5.5 is not available on the default `xenial` distro, but by explicitly telling Travis to use the `trusty` distro, we can still  run the tests against PHP 5.5.

* Travis: run code coverage in a separate stage

Code coverage builds are "expensive" builds and if any of the tests would be failing, we are wasting time and resources by running them.

So, let's move the coverage build(s) to a separate stage, which will only run once the `test` stage has passed.

As this is now a separate stage, we don't need to set an environment variable to toggle code coverage on/off anymore. We can base conditions on the Travis stage name.

Let's also run code coverage for PHP 5.5, so both high and low PHP code coverage output can be combined for the most realistic results, taking PHP version specific conditions into account.

To make this work, we do need to tell Scrutinizer to expect reports from two separate code coverage runs.

And if I'm editing that file anyway, let's remove the redundant `filter` setting for a Scrutinizer native code coverage run which is turned off anyway.

* Tests: fix test failing on PHP 5.5

... due to the use of a PHPUnit method which is not available on PHPUnit 4.x.

These kind of things will be addressed better in a future PR, but this will get the build passing for now.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2020-10-26 18:39:29 +01:00
Marcus Bointon
22e81749ae
Switch from PHP CS fixer to phpcs and apply PSR12 reformatting 2020-10-13 15:08:42 +02:00
Marcus Bointon
f9373db9a5
Fix tests 2020-10-07 14:45:06 +02:00
Marcus Bointon
46fa62268e
Fix tests 2020-10-07 14:42:17 +02:00
criri99
86d5cb060b
(-)remove branch #85-improvement/TestImprovement (+) add branch increase_code_coverage (+) add changes from old branch (#2119)
Co-authored-by: chriri99 <au000171>
2020-09-30 22:29:24 +02:00
Marcus Bointon
e2e07a355e
Proposed fix for #2069 2020-09-30 19:29:00 +02:00
Marcus Bointon
13e9224c1e
Update copyright year 2020-09-02 08:41:14 +02:00
Marcus Bointon
ecdf374c74
Allow local override of SMTP auth settings in tests; allows easy use of HELO (which requires a username) for local testing 2020-08-04 09:46:12 +02:00
Marcus Bointon
8b4ee589bd
CS, minor tweaks from EA plugin 2020-07-14 20:15:45 +02:00
Marcus Bointon
b07638a562
Fix assertions: they should be static calls 2020-07-14 20:15:45 +02:00
Marcus Bointon
5bb37af70d
CS 2020-07-14 20:15:45 +02:00
Marcus Bointon
c2796cb1cb
Merge pull request from GHSA-f7hx-fqxw-rvvj
* Initial fixes, tests, and bump to 6.1.6

* Add CVE number
2020-05-27 14:24:03 +02:00
Pierre Grimaud
5b63b3955c
Fix typos (#2037) 2020-04-26 10:31:39 +02:00
Marcus Bointon
a559852f2d
More thorough checks that attachment files are accessible, return error or throw exception if file has been deleted since adding it, fixes #1960 2020-02-24 15:49:49 +01:00
Marcus Bointon
b8f4e4e9c2
Allow empty header values after all, rearrange tests. See #1984 2020-02-20 12:30:47 +01:00
Marcus Bointon
af4c0ad322
CS 2020-02-20 12:05:01 +01:00
Marcus Bointon
594fbb4182
Don't allow headers to contain breaks, fixes #1984 2020-02-20 12:01:48 +01:00
Patrick Kuijvenhoven
7eff728136 Feature improve host check (#1909)
* Let isValidHost() determine validness of host

- PHP way of doing so (https://github.com/php/php-src/pull/826)
- Improved and shortened regexp a bit

* Give more specific debug message in case host(entry) is invalid

* Rewrite filter_var checks

* Host [[<ipv6>]] is not valid
2019-12-10 11:48:50 +01:00
Marcus Bointon
e4123e66b4 Merge branch 'master' into dkimrevision 2019-10-20 19:37:17 +02:00
Marcus Bointon
8087171624 Alter test to check UTF-8 in content-IDs, see #1691 2019-10-16 10:38:55 +02:00
Marcus Bointon
3649f0697e Use HTML5 doctype and set lang attr everywhere 2019-10-16 10:09:01 +02:00
Marcus Bointon
694b911c9c
Merge remote-tracking branch 'remotes/origin/master' into dkimrevision 2019-10-14 12:18:57 +02:00
Marcus Bointon
b8c44fca4e
Add test for content-id header formatting 2019-10-14 12:17:28 +02:00
Marcus Bointon
961e782634
Test was wrong before, even though it results in an unexpected space 2019-10-11 12:54:15 +02:00
Marcus Bointon
47a31a2f7f
Test fixes 2019-10-11 10:24:15 +02:00
Marcus Bointon
aa07c8f7c7
DKIM_add rewrite, see #1860 2019-10-10 15:57:08 +02:00
puhr-mde
de53537ba3 Cancel ICS file corrupted on Office 365 #1780 (#1842)
* Cancel ICS file corrupted on Office 365 #1780
2019-09-26 10:52:14 +02:00
Claas Augner
21b35dc49b Use Q-encode to wrap too long headers (#1840)
* Always Q-encode headers exceeding maximum length

Previously, headers exceeding the maximum line length without
any special characters were only folded. This lead to problems
with long filenames (#1469) and long headers in general (#1525).

Now, long headers are always Q-encoded (and still folded).

* Use ASCII as Q-encoding charset if applicable

Previously, headers were Q-encoded using the message
charset, e.g. UTF-8. This is excessive for ASCII
values, as it requires a unicode engine.

Now, we use ASCII if we only find 7-bit characters.

* Separate header encoding from encoding selection

* Use ASCII for B-encoding as well

* Refactor max line length calculation

Previously, we calculated the maximum
line length for header encoding both
for B- and Q-encoding, even though
they share the same limits.

Now, we calculate these once for both.
2019-09-25 08:58:44 +02:00
Marcus Bointon
8414097b86
Use constants more consistently 2019-09-24 12:38:51 +02:00
Marcus Bointon
2d1ab8e07c
Standards 2019-09-02 19:58:06 +02:00
Marcus Bointon
a0ab65d0dc
Revise DKIM header canonicalisation, see #1525 2019-09-02 19:44:12 +02:00
Marcus Bointon
463ccbbf16
Standards 2019-05-27 21:26:41 +02:00
Marcus Bointon
e86a4274a5
More consistent use of exceptions for encoding errors
Test coverage for the same
See #1733
Coding standards
2019-05-27 17:09:48 +02:00
Marcus Bointon
abaee17daa
Add encoding validator
Add exceptions and make return values consistent when requesting an invalid encoding in any attachment method
2019-05-24 22:47:25 +02:00
Marcus Bointon
c614717a7e
Test for double quotes in from name 2019-04-26 18:40:54 +02:00
Marcus Bointon
6b36cba90b
Adjust tests for previous commit 2019-04-26 18:38:11 +02:00
Carlos Marin Ugalde
258931af90 DSN suppot added (#1554)
* DSN suppot added

* Added test for code coverage of dsn support
Added link for RFC3461 for property $dsn documentation

* Updated coding style
2019-02-15 10:08:43 +01:00
Shoko Ishigaki
7582514b36 Update the language directory path (#1639) 2019-02-01 15:38:17 +01:00
Marcus Bointon
8190d73eb5
Standards 2018-11-16 01:41:32 +01:00
Marcus Bointon
77c26cdf18
Use debug level constants 2018-11-15 23:37:32 +01:00
Marcus Bointon
8e653bb796
Mitigations for CVE-2018-19296 2018-11-15 23:37:18 +01:00
Gabriel Caruso
43b774272b Use dedicated assertContains assertion (#1594) 2018-11-11 16:34:54 +01:00
miyama
c482b20724 Improve tests (#1575)
* [fix] fix test cas

fix test case

- testBCCAddressing

* [fix] fix test case testSmtpConnect

* [fix] improve test case about coverage

* [fix] invalid address

* [add] test case for setSMTPInstance

* [add] Add OAuth test case

* [add] createbody test case added

* [add] add case validateaddress test

* [add] attachmentExists test case

* [add] add test case getMailMIME

* [fix] remove not need line

* [fix] fix codes for github comment

* [fix] fix code style for travis.

* [fix] fix code style for travis.

* [fix] fix code style for travis.

* [fix] fix code style for travis.

* [fix] fix code style for travis.

* [fix] fix miss type.

* [fix] fix test case of testMailSend

* [fix] fix test case of testSmtpConnect

* [fix] remove not needed line.

* [fix] remove not need space.

* [fix] fix test case of sendMail

* [fix] fix test case

* [fix] fix test case smtpconnect

* [fix] fix test case of smtpconnect

* [fix] fix test case of smtpconnect

* [fix] fix test case of smtpconnect
2018-11-04 18:20:06 +01:00
Marco Muths
5c9d3c5484 Add flag for using copiedHeaderFields and config for using extra headers in DKIM signature (#1468)
* Changed in DKIM signature

- Add flag for using copiedHeaderFields
- config for using extra headers in DKIM signature

* Cleanups after Review

- Don't use masked ampersands in url
- Remove test related artifacts after run

* Complete docs
2018-06-26 17:04:38 +02:00
François B
10341cc310 Make idnSupported() static (#1203)
Upgrade guide and changelog say that idnSupported() is now static, but it actually isn't.

Probably this PR should wait v6.1 or other version where breaking changes are OK.
2017-10-14 08:22:54 +02:00
Marcus Bointon
d47a148ebc
Add missing POP3 name import 2017-09-29 16:10:11 +02:00
Marcus Bointon
f47cfbdd75
Switch to using max line length *without* including line break length. See #1181 2017-09-29 16:09:25 +02:00
Filippo Tessarotto
992392437c Tests improvements (#1162)
* Move tests to proper namespace; enforce signatures

* Travis stages, check coding-standard before tests

* Test against PHP 7.2

* CS Fix

* Remove php-cs-fixer on test builds

* Travis: remove phpdocumentor/phpdocumentor from builds

* Allow PHPUnit 5
2017-09-14 18:47:12 +02:00
Filippo Tessarotto
dc54e2b93c Show debug log only when tests fail (#1161) 2017-09-14 15:56:04 +02:00
Filippo Tessarotto
9e05e796d0 Enforce PSR-4 (#1159) 2017-09-14 12:55:50 +02:00
Marcus Bointon
28a306bfbd
Reset to SMTP mailer for line break tests 2017-09-12 09:49:15 +02:00
Marcus Bointon
819f540c77
Reset to SMTP mailer for line break tests 2017-09-12 09:17:58 +02:00
Marcus Bointon
2feb461f04
Add test for sending DKIM-signed message via mail() 2017-09-12 09:00:40 +02:00
Marcus Bointon
700ea0983d
Code style fixes 2017-09-08 16:19:20 +02:00
Marcus Bointon
31493b6732
Big cleanup for Symfony coding style and php-cs-fixer, see #1148 2017-09-07 18:21:09 +02:00
Marcus Bointon
de3db41419
Casts & PHPDoc boolean -> bool, see http://php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration 2017-09-07 11:17:37 +02:00
Marcus Bointon
3f80e2dc92
Fix obtaining transaction ID when keepalive is active, fixes #1123 2017-08-11 13:55:51 +02:00
Marcus Bointon
1e3f4e4062
Merge remote-tracking branch 'remotes/origin/master' into 6.0
# Conflicts:
#	VERSION
#	changelog.md
#	examples/code_generator.phps
#	src/PHPMailer.php
#	src/POP3.php
#	src/SMTP.php
#	test/phpmailerTest.php
2017-07-26 23:10:42 +02:00
Marcus Bointon
cb2be11013
Add failing test for #1094
Exercise more bad host checks
2017-07-26 22:51:02 +02:00
Marcus Bointon
d8880934f5 No empty parens on new 2017-06-29 21:54:47 +02:00
Marcus Bointon
b25f93eb2d
More reliable folding of message headers 2017-05-22 18:53:00 +02:00
Marcus Bointon
70e35cc9da
Rewrite host checks to be more predictable, add more test cases 2017-05-12 15:13:08 +02:00
Marcus Bointon
9f08355ed3
Add host validation tests
Improve host validator
2017-05-12 09:43:46 +02:00
Marcus Bointon
1f9a66492a
Replace all uses of MD5 and SHA1 with SHA256
Use more secure method of generating IDs
2017-05-11 18:41:34 +02:00
Marcus Bointon
c3aba6d974
Test suite now works on HHVM on Travis-CI 2017-03-02 16:09:45 +01:00
Marcus Bointon
4eaed21a6e
Avoid HHVM problem with file:// URL 2017-03-01 18:49:09 +01:00
Marcus Bointon
bb5ca4329b
Clean up 2017-02-14 19:24:45 +01:00
Marcus Bointon
1e267b66a6
Avoid possibility of line length being too short to trigger test if LE is 1 char 2017-02-14 13:46:50 +01:00
Marcus Bointon
ec5661e699
More test feedback 2017-02-14 12:14:19 +01:00
Marcus Bointon
16a060be1a
More test feedback 2017-02-14 01:32:41 +01:00
Marcus Bointon
8e8da27e3d
Fix tests 2017-02-14 00:16:25 +01:00
Marcus Bointon
02332a843f
Attempt solution to line break issue, see #953 2017-02-13 23:55:05 +01:00
Marcus Bointon
016cb3395c
Fix INCLUDE_DIR 2017-01-09 12:19:12 +01:00
Marcus Bointon
96c5d32386
Extend line break tests 2017-01-09 10:19:14 +01:00
Marcus Bointon
8914ec7a4b
Merge branch 'master' into 6.0
# Conflicts:
#	VERSION
#	examples/contentsutf8.html
#	src/PHPMailer.php
#	src/POP3.php
#	src/SMTP.php
#	test/bootstrap.php
2017-01-06 23:34:57 +01:00
Marcus Bointon
48e8cac067
Improve msgHTML tests 2017-01-06 22:30:55 +01:00
Marcus Bointon
d1a7de4e94
Make test bootstrap a bit more flexible 2017-01-06 22:27:49 +01:00
Marcus Bointon
789e0846ab
Merge branch 'master' into 6.0
# Conflicts:
#	VERSION
#	extras/htmlfilter.php
#	src/PHPMailer.php
#	src/POP3.php
#	src/SMTP.php
#	test/phpmailerTest.php
2016-12-29 14:01:45 +01:00
Marcus Bointon
dbbbf49d61
Unbreak tests 2016-12-24 15:26:34 +01:00
Marcus Bointon
e0fefda64b
5.2.18 2016-12-24 01:06:31 +01:00
corentinheadoo
a55b67d965 Fix: function call is not case-sensitive (#857) 2016-10-17 16:38:25 +02:00
Marcus Bointon
6931f31028 Simplify validation options, default to filter_var, see #804 2016-09-03 01:02:38 +02:00
Marcus Bointon
1e53c07286 Minor fixes, code style 2016-08-31 10:26:06 +02:00
Marcus Bointon
51e8e91c20 PHPCBF phpdoc cleanup 2016-08-29 11:04:27 +02:00
Marcus Bointon
63e0a2c1db PHPCBF phpdoc cleanup 2016-08-29 10:29:13 +02:00
Marcus Bointon
593a0c586a Remove unneeded PHPDoc tags: @static, @access, @return void, @private
@link -> @see (PSR-5)
Always use `boolean`
2016-08-29 10:21:39 +02:00
Marcus Bointon
ec4c2ee867 Standardise on CRLF line breaks
Better auth mechanism selection
2016-05-23 10:30:31 +02:00
Marcus Bointon
e61b522f2d Merge branch 'master' into 6.0
# Conflicts:
#	src/PHPMailer.php
#	src/SMTP.php
2016-05-22 21:11:00 +02:00
Marcus Bointon
d3c73b1739 Reset encoding on simple bodies, hopefully will fix #728! 2016-05-22 10:26:48 +02:00
Marcus Bointon
c27c1597bc Fix build
Actually changes the test to test a different thing, still need to deal with what it was originally testing.
2016-05-22 01:25:10 +02:00
Marcus Bointon
1a7f380457 Fix test case 2016-05-09 11:36:15 +02:00
Marcus Bointon
86d2b069d8 Merge branch 'master' into 6.0
# Conflicts:
#	changelog.md
#	test/phpmailerTest.php
2016-05-09 11:34:42 +02:00
Marcus Bointon
77c0bc8d28 Add ability to inject custom validator and set custom default validator, fixes #573 2016-05-09 11:18:50 +02:00
Marcus Bointon
f7033d68b6 Remove obsolete QP-encode function
Improve & fix data URL handling
Remove old class loader from phpunit bootstrap
Improve test coverage
Remove some unnecessary trailing line breaks from attachment MIME structure
2016-05-02 18:27:44 +02:00
Marcus Bointon
a46689bed8 Make DKIM canonicalization stricter, add unit tests 2016-05-02 15:18:22 +02:00
Marcus Bointon
2f63fcd3da Defensive comparisons 2016-05-02 12:01:25 +02:00
Marcus Bointon
7a67a33181 Cleanup 2016-05-01 17:45:39 +02:00
Marcus Bointon
efbcfa97c0 Callback cleanup, examples 2016-05-01 17:00:48 +02:00
Marcus Bointon
558bcdc269 DKIM cleanup, examples 2016-05-01 13:09:24 +02:00
Marcus
3abcab1936 Clean up TODOs
Switch SingleToArray to protected
Update Readme
Update composer deps
2016-04-19 18:26:33 +02:00
Marcus
a8b44e9a8e Merge remote-tracking branch 'remotes/upstream/master' into xoauth
# Conflicts:
#	src/PHPMailer.php
2016-04-19 17:30:13 +02:00
František Svoboda
fb82f2b9ea Add unit test that shows how address parser returns its result 2016-04-17 09:49:12 +02:00
Marcus
3d4e3b1a0d Years & version numbers 2016-04-07 11:04:03 +02:00
Marcus
33f82ab517 Merge branch 'master' into 5.4
Bump version to 5.5
Clean up code generator
# Conflicts:
#	README.md
#	examples/send_file_upload.phps
#	src/SMTP.php
#	test/phpmailerTest.php
2016-04-07 10:52:37 +02:00
Marcus
27501ac7b9 Merge branch 'master' into 5.4
Bump version to 5.5
Clean up code generator
# Conflicts:
#	README.md
#	examples/send_file_upload.phps
#	src/SMTP.php
#	test/phpmailerTest.php
2016-04-07 10:51:05 +02:00
Marcus
b7151db9b7 Improve Windows compatibility for tests 2016-03-29 15:14:19 +02:00
Marcus
99bf646428 Ignore files created during tests 2016-03-16 10:02:38 +01:00
Synchro
bf60c58a01 Merge branch 'master' into 5.4
# Conflicts:
#	composer.lock
#	get_oauth_token.php
2016-01-07 18:39:55 +01:00
Synchro
9211ba6728 Ensure Message-ID is always valid, fixes #587 2016-01-07 16:28:39 +01:00
Marcus Bointon
32a99356ef Merge remote-tracking branch 'remotes/upstream/master' into 5.4
# Conflicts:
#	test/phpmailerTest.php
2015-12-22 09:35:50 +01:00
Marcus Bointon
ea7bb516f1 Remove personal email address 2015-12-22 09:23:03 +01:00
Synchro
104359d993 Fix extra line break in getSentMIMEMessage(), fixes #589 2015-12-18 13:16:51 +01:00
Synchro
280e7a51f8 Make parseAddresses static, see #82 2015-12-17 17:32:39 +01:00
Synchro
5cdb01b129 Ignore whatever the problem is with pop3 for now! 2015-12-01 15:44:12 +01:00
Synchro
cccf32b7a6 Fix POP3 script path 2015-12-01 14:23:47 +01:00
Synchro
bd4bb1024a Revert to old code for POP tests, ignore exit errors
Update deps
2015-12-01 10:20:44 +01:00
Synchro
2074c8e5ab See what's happening in the shell 2015-11-24 19:04:12 +01:00
Synchro
a7aa1491ef Ps args 2015-11-24 11:56:07 +01:00
Synchro
f8ed4eba2a PHPUnit again 2015-11-23 08:54:21 +01:00
Synchro
da9666e893 PHPUnit tweaks 2015-11-12 14:43:19 +01:00
Synchro
428949a697 PHPUnit tweaks 2015-11-12 12:51:29 +01:00
Synchro
2ea088ecc5 PHPUnit tweaks 2015-11-12 12:30:31 +01:00
Synchro
6a7ed78618 PHPUnit tweaks 2015-11-12 12:18:21 +01:00
Synchro
eaebda7d66 PHPUnit tweaks 2015-11-12 11:47:10 +01:00
Synchro
1f3a204d70 PHPUnit tweaks 2015-11-12 11:29:23 +01:00
Synchro
f66899617a PHPUnit tweaks 2015-11-12 10:45:16 +01:00
Synchro
0c116a6287 PHPUnit tweaks 2015-11-12 10:13:28 +01:00
Synchro
c9f2347300 PHPUnit tweaks 2015-11-12 10:12:55 +01:00
Synchro
545febf0cf PHPUnit tweaks 2015-11-12 09:43:56 +01:00
Synchro
7a55a752b3 PHPUnit tweaks 2015-11-12 09:37:41 +01:00
Synchro
6bcb0f8f8d PHPUnit tweaks 2015-11-12 08:43:23 +01:00
Synchro
2b632a71be PHPUnit tweaks 2015-11-11 19:20:16 +01:00
Synchro
a0407c6630 Travis & PHPUnit tweaks 2015-11-10 19:09:08 +01:00
Synchro
12805da50a Travis & PHPUnit tweaks 2015-11-10 15:17:46 +01:00
Synchro
fbe62ff9b5 Tidy up copyright notices 2015-11-10 14:44:16 +01:00
Synchro
14e8ef03eb Short array syntax 2015-11-10 13:45:13 +01:00
Synchro
9b3e13dc14 First draft of 5.4 2015-11-09 19:09:13 +01:00
Synchro
6687a96a18 Add test for line breaks in addresses vulnerability
Don't allow line breaks in addresses
Don't allow line breaks in SMTP commands
Rearrange tests so slowest tests run last
2015-11-01 11:12:04 +01:00
François B
0fa9518609 Allow addresses with IDN
Accepts Internationalized Domain Name everywhere PHPMailler expects
email addresses (To, CC, BCC, Reply-To, From, Sender and
ConfirmReadingTo).

Requires PHP >= 5.3 with "intl" extension installed and "mbstring"
extension enabled. Earlier versions don't see a change, i.e. specifying
an address with IDN still fails validation.

Follow-up to PR #516. Ran test/phpmailerTest.php

Other changes:

- From, Sender and ConfirmReadingTo addresses are now validated in
send(). Previously, only From and Sender addresses would be validated
only if specified via the setFrom() method. ConfirmReadingTo was never
validated.

- Half language strings for the 'invalid_address' message used colon at
the end and half didn't. Harmonized messages to always include colon,
and not add a second one with PHP code.
2015-10-14 22:02:07 +02:00
François B
4532cec50d Improve some comments and minor improvements
- Define an $error_message and reuse it, instead of recreating the
error message 3 times
- Use in_array() check instead of a regex
2015-10-13 22:38:15 +02:00
Roman Minchyn
870350756b [TASK]
replace "@type" annotation in favor of "@var" as proposed by phpdoc.org

Issue #513
2015-09-28 11:35:42 +02:00
Synchro
c93759dcd1 Fix issues with embedding items without filenames, fixes #478 2015-08-25 12:01:39 +02:00
Synchro
6f266a2e42 Don't normalise line breaks when QP-encoding, fixes #464 2015-08-01 11:32:18 +02:00
Synchro
199bd9698b Add address parser, fixes #82, #145 2015-05-21 17:05:57 +02:00
Synchro
c7e488d64b Add multiple attachment test 2015-05-04 10:59:56 +02:00
Synchro
9164e6d9eb Corrections to ISO text test
Only test ICS configs that are actually supported!
Fix missing headers when using signed messages
2015-04-29 20:46:10 +02:00
Synchro
4e8a80a657 Merge remote-tracking branch 'remotes/upstream/longlines' 2015-04-29 11:31:39 +02:00
Marcus Bointon
89bb0d6094 Fix file attachment test 2015-04-23 19:33:15 +02:00
Joris Berthelot
47fd54d04d Added custom header getter 2015-04-23 19:06:49 +02:00
Synchro
b83f2a6b6b Merge remote-tracking branch 'remotes/upstream/master' into longlines 2015-04-17 15:16:13 +02:00
Synchro
50eac8739f Use multibyte text in tests
Add explicit test for UTF-8 with embedded images, see #279 and #377
Add ISO-8859-1 test
2015-03-25 19:22:55 +01:00
Synchro
a071e68f46 Fix unique id / boundary problems when creating body before header
Add tests for line length transfer encoding override
2015-03-20 20:58:32 +01:00
Synchro
6e444ac33c Merge remote-tracking branch 'remotes/upstream/master' into longlines
# Conflicts:
#	class.phpmailer.php
#	test/phpmailerTest.php
2015-03-20 19:11:19 +01:00
Synchro
08f7807205 Add UTF-8 tests 2015-03-20 18:11:15 +01:00
Synchro
c39b89fbf3 Tweak MIME preamble
Test output cleanup
2015-03-20 12:03:16 +01:00
Synchro
78f323d326 Tidy up format of test messages 2015-03-18 08:49:42 +01:00
Synchro
3bdaa171c6 Tidy up format of test messages 2015-03-17 19:00:07 +01:00
Synchro
c8be94946e Add MIME preamble to all multipart message types, should fix #316
Tidy up format of test messages
2015-03-17 18:55:11 +01:00
Synchro
d7c44d5a9e Add tests for line breaks in headers, see #372
Minor cleanup
2015-03-16 14:10:14 +01:00
Synchro
1ad1217759 typo 2015-03-16 10:24:39 +01:00
Synchro
4680d1f6cf Improve reporting of missing OpenSSL extension for SSl and TLS, see #378
Add 'missing extension' language string
Improve default handling of language strings
2015-03-16 10:23:38 +01:00
Synchro
c506185d50 Add support for additional CA certificate when S/MIME signing, fixes #376 2015-03-06 16:35:29 +01:00
Synchro
541cfec405 More efficient, more readable loops in wrapText
Add multibyte wordwrap test
phpDoc cleanup in tests
2015-03-04 10:29:46 +01:00
Synchro
c00fdf7b9a Fix inappropriate checks in set(), make more reliable 2015-01-28 12:18:11 +01:00
Synchro
43091014e0 Refactor and major cleanup of EasyPeasyICS, including a fix for #338 2015-01-09 14:13:47 +01:00
Synchro
ecce82a38b Use autoloader 2015-01-05 09:13:09 +01:00
Synchro
127d26ef3c Remove 'advanced' html2text converter to resolve license clash, fixes #232
Allow injection of custom html2text converter, amend tests to cover it
Update README and related docs
2014-12-17 16:07:02 +01:00
Synchro
b7f1dd174d Make tests a bit less verbose 2014-12-06 15:07:54 +01:00
Synchro
aa8e499b8a Deal with excessively long lines, see #314 2014-11-14 10:15:45 +01:00
Synchro
6365f4d6fd PHPDoc cleanup - consistent naming of integer and boolean types 2014-06-06 09:45:38 +02:00
Synchro
ca71445fb2 Make tests check for config
Generate debug output during POP tests
Ignore errors during POP3 disconnect
Update PHPUnit dependency to 4.1 in composer
2014-06-05 16:58:17 +02:00
Synchro
1a8fae1535 Remove fixed PHPUnit loader 2014-05-01 11:43:40 +02:00
Synchro
f03b54f01d Remove fixed PHPUnit loader
Add hhvm to test envs
2014-05-01 11:42:50 +02:00
Synchro
3d246420c4 Reorder tests to fail faster 2014-04-08 13:32:46 +02:00
Synchro
cc99349c15 Enable debug output during tests - increases coverage! 2014-04-03 13:49:44 +02:00
Synchro
943e0bd529 New graphics 2014-03-10 16:25:31 +01:00
Synchro
379b700e77 Add config for scrutinizer 2013-12-17 08:43:48 +01:00
Elan Ruusamäe
f302f1d497 fix parse error under php 5.2.17
```
$ php -l test/phpmailerTest.php
PHP Parse error:  syntax error, unexpected T_SL in
test/phpmailerTest.php on line 746
Errors parsing test/phpmailerTest.php
```
2013-11-09 14:53:45 +02:00
Synchro
41415a821f Manually merge my qmail patches for #126
Minor cleanups
2013-10-29 11:17:57 +01:00
Synchro
70ba3fbc0f Fix the way that SMTP host lists are parsed, see #112 2013-09-24 14:35:34 +02:00
Synchro
accd948dad Alter the way that SMTP host lists are parsed, fixes #112 2013-09-23 09:12:02 +02:00
Synchro
09a978fb1c Tests for messageID
Minor cleanup
2013-08-30 18:51:37 +02:00
Synchro
cd4ed6130a Fix POP3 test failures
Fake pop server can now specify a port to run on
2013-08-05 18:12:08 +02:00
Synchro
73093a32a3 Add fake pop server and POP-before-SMTP tests.
Update POP before SMTP example to use new static method.
2013-08-02 16:19:01 +02:00
Synchro
331d24bc82 Fix Q-encoding for strings containing '=', fixes #91 2013-08-01 09:55:26 +02:00
Synchro
d992ae6dc4 Centralise check for debug output
PSR-2 reformat

Enable debug output for failing test

Fix broken test
Comment clearout

Proper thin spaces before French punctuation

Fix phpdocs for addrAppend and addrFormat, fixes #81
Minor code cleanup, remove some local vars

See changelog.

More phpdoc cleanup
2013-07-30 12:51:15 +02:00
Synchro
2032af0d56 Fix bad return for failed attachment
Add test for failing attachment
2013-06-06 17:31:11 +02:00
Synchro
3c80c56a55 Add iCal event attachments and test case, fixes #47, thanks to @reblutus
Minor code cleanup
Bundle EasyPeasyICS class in extras
2013-05-29 02:15:17 +02:00
Synchro
7f39eff84b Code cleanup 2013-05-16 17:08:50 +02:00
Synchro
3215f89736 Use a different stream option to see if it works with Travis 2013-05-16 17:05:23 +02:00
Synchro
85136af8b6 Use new support for stream options on SMTP connect, add tests for it 2013-05-16 11:44:09 +02:00
Synchro
9cbce116dc Add support for stream options on SMTP connect, use stream_socket_client instead of fsockopen, thanks to @stanislavdavid 2013-05-16 11:33:19 +02:00
Synchro
3666c3469a Fix cid generation in MsgHTML (Thanks to @digitalthought), fixes #60
Fix handling of multiple SMTP servers (Thanks to @NanoCaiordo), see #58, #32
2013-05-15 12:36:42 +02:00
Synchro
bfe6f6b183 More secure temp folder selection in fakesendmail
Use .eml extension for created files, works better with Apple Mail
2013-05-10 03:18:16 +02:00
Marcus Bointon
019499efc3 Convert line breaks to CRLF in MsgHTML, closes #52
Fix double suffix on image cids, see #50
Remove unneeded test files, re-use example content for tests
Remove reference to phpmailer-lite
Ignore .idea folder
2013-05-01 10:20:10 +02:00
Synchro
ff8718f722 Major overhaul and cleanup of example code
Update test_script to use some recently changed features, rename to code_generator
Generated code actually works!
Update SyntaxHighlighter
New PHPMailer graphic
2013-04-26 18:22:45 +02:00
Synchro
72f41f1f64 Determine MIME type of attachments automatically
Add cross-platform, multibyte-safe pathinfo replacement and use it
2013-04-25 12:24:43 +02:00
Synchro
4d9434e394 5.2.6 release
See changelog
2013-04-11 18:45:39 +02:00
Synchro
0642bf5901 Move house 2013-04-02 09:12:48 +02:00
Synchro
e26b905f3e Add tests for trying to add empty addresses 2013-03-21 16:06:47 +01:00
Synchro
9a279e3a6f Implement an 'advanced' html to text converter for MsgHTML, using the html2text class we already bundle [via SourceForge](https://sourceforge.net/p/phpmailer/bugs/368/)
Some code cleanup in tests
2013-03-21 15:08:29 +01:00
Synchro
5d64a6ea77 Add mechanism for allowing sending messages with an empty body [via SourceForge](https://sourceforge.net/p/phpmailer/bugs/334/) 2013-03-21 11:56:26 +01:00
Synchro
230e369b30 Add unit test for EncodeQ [via SourceForge](https://sourceforge.net/p/phpmailer/bugs/341/)
Minor PHPDoc cleanup
2013-03-21 11:10:52 +01:00
Synchro
997a4027de Various small fixes and changes from SourceForge 2013-03-06 23:55:58 +01:00
Synchro
9dd16cef4e Quotes, indents, add test for BCC-only 2013-03-06 17:34:28 +01:00
Synchro
263bf4fa27 Try another tack, try to see how php is configured on Travis 2013-02-28 19:25:31 +01:00
Synchro
0680e1c7ce Test Travis mail config 2013-02-28 19:09:53 +01:00
Synchro
8ad881fb30 Don't try to use the mail() function if it's not available, should fix Travis-CI builds. 2013-02-28 18:29:55 +01:00
Synchro
dfc40d56ce Break out translation tests into separate test case so Travis can pass the rest of the code, see #24 2013-02-28 17:53:20 +01:00
Synchro
c15920ece2 Make MsgHTML() always overwrite AltBody, fixes #28
Break out html to text conversion to a method so it can be overridden easily and use it internally, fixes #29
2013-02-28 14:21:00 +01:00
Synchro
adb0197c10 Merge in changes from Google code 5.2.4 release
Code cleanup in SMTP class
2013-02-21 12:44:28 +01:00
Synchro
a51a9e1818 Fix location of true 2013-02-02 21:10:17 +01:00
Synchro
07f7a1bdd5 Add fake sendmail script, adjust travis config to use it 2013-02-02 18:41:54 +01:00
Synchro
edbefba3b7 Add example test config, adjust test setup to use it, see #19 2013-02-01 16:05:17 +01:00
Synchro
691d7b086c Cleanup 2013-01-31 12:04:26 +01:00
Synchro
b53ab113a8 Add unit test for S/MIME signing
Add checks for OpenSSL before trying to use it
2013-01-31 11:48:45 +01:00
Synchro
104869b669 Updated validation regex from Michael Rushton
Update unit tests
2012-12-04 17:35:58 +01:00
Synchro
10c57b72fe Merge changes from Google Code 5.2.2 release, thanks Jim
Replace Quoted-Printable encoder, improve tests
Reformat changelog using markdown
Coding standards
2012-12-04 12:15:39 +01:00
Synchro
95cc8b829b Add info & test case for CRAM-MD5 auth
Fix validation test
Fix misdocumented do_debug property in SMTP
Code cleanup
2012-12-04 10:33:23 +01:00
Synchro
a50834223d Make ValidateAddress return an explicit boolean as docs say it does
Reformat regex slightly, seemed to produce odd effects with literal tab chars in: This fixes #10
Add email validation test cases
Reformulate translation test case so all problems are reported together
2012-12-03 15:19:38 +01:00
Synchro
6f919df65e Import 5.2.2rc2 from Google Code
Major cleanup of PHPDocs
Test suite works again
2012-11-21 16:12:07 +01:00
Marcus Bointon
cca7fc22fb Import PHPMailer 5.2.0 from apache project 2011-08-23 10:20:10 +02:00