View Issue Details

IDProjectCategoryView StatusLast Update
0032828mantisbttoolspublic2023-10-31 16:32
Reporterdregad Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Target Version2.26.0Fixed in Version2.26.0 
Summary0032828: TravisCI ' /usr/sbin/sendmail: not found' error after successful test execution
Description

After PHPUnit tests execution completes successfully, several occurrences of error sh: 1: /usr/sbin/sendmail: not found are reported in the TravisCI job log.

They are triggered as the MantisBT core calls email_shutdown_function(). /usr/sbin/sendmail is the default set by PHPMailer, when sendmail is not found on path

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.

Additional Information

Example job https://app.travis-ci.com/github/mantisbt/mantisbt/jobs/607675572#L608

.........................................................       372 / 372 (100%)

Time: 13.13 seconds, Memory: 52.00 MB

OK (372 tests, 1601 assertions)

sh: 1: /usr/sbin/sendmail: not found
sh: 1: /usr/sbin/sendmail: not found
sh: 1: /usr/sbin/sendmail: not found
sh: 1: /usr/sbin/sendmail: not found

The command "./build/travis_script.sh" exited with 0.
TagsNo tags attached.

Relationships

related to 0032810 closeddregad Ugrade to PHPUnit 8.5 and adapt test suite 

Activities

dregad

dregad

2023-08-15 04:34

developer   ~0067984

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

dregad

dregad

2023-08-15 04:35

developer   ~0067985

PR https://github.com/mantisbt/mantisbt/pull/1903

Related Changesets

MantisBT: master 9224acb6

2023-08-14 11:26

dregad


Details Diff
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
Travis.

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 [1].
It will generate a .eml file in /tmp/fakemail directory, each time
the test suite sends an email.

Fixes 0032828

[1]: https://github.com/PHPMailer/PHPMailer/blob/v6.8.0/test/fakesendmail.sh
Affected Issues
0032828
mod - .travis.yml Diff File
add - tests/fakesendmail.sh Diff File