View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0032828||mantisbt||tools||public||2023-08-15 03:54||2023-10-31 16:32|
|Target Version||2.26.0||Fixed in Version||2.26.0|
|Summary||0032828: TravisCI ' /usr/sbin/sendmail: not found' error after successful test execution|
After PHPUnit tests execution completes successfully, several occurrences of error
They are triggered as the MantisBT core calls email_shutdown_function().
This is not a "real" error and does not actually cause the build to fail, but it could lead someone reviewing the build's log to think that something went wrong, so it should be fixed to avoid confusion.
|Tags||No tags attached.|
sendmail command is not available on TravisCI, to avoid this error the easiest solution is to setup a mail sink / fake sendmail command. PHPMailer does something similar for running their own unit tests. See https://github.com/PHPMailer/PHPMailer/tree/57f994d89eacac82dd0e40e4657eb6054136a7ea/examples#about-testing-email-sending
MantisBT: master 9224acb6
|Use fake sendmail script for TravisCI builds
This avoids 'sh: 1: /usr/sbin/sendmail: not found' error message
displayed after PHPUnit suite execution, as sendmail is not installed on
Note: This is not a "real" error and does not actually cause the build
to fail, but it could lead someone reviewing the build's log to think
that something went wrong, so it should be fixed to avoid confusion.
The fakesendmail.sh script was copied from PHPMailer's test suite .
It will generate a .eml file in /tmp/fakemail directory, each time
the test suite sends an email.
|mod - .travis.yml||Diff File|
|add - tests/fakesendmail.sh||Diff File|