Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Make log mailer for testing #5893
Multiple users have noticed in problems in 1.7.0 with issues to do with sending email. This is because there are code paths to do with emailing that are not tested in the integrations test due to gitea requiring a valid email configuration.
This PR creates a simple log mailer that can be used to test what kind of emails gitea would send.
Of note cherry-picking this and placing it on the v1.7 release master reveals the underlying bug in #5891.
Shortened log after cherry-picking this and placing it on releases/v1.7:
Revealing immediately the bug described in #5891
@@ Coverage Diff @@ ## master #5893 +/- ## ========================================== + Coverage 37.98% 38.22% +0.24% ========================================== Files 329 329 Lines 48406 48423 +17 ========================================== + Hits 18385 18508 +123 + Misses 27379 27249 -130 - Partials 2642 2666 +24
referenced this pull request
Jan 29, 2019
Ok, I can understand that. I did wonder if we should make an internal channeled debug mailer myself - one that would just create a list of mail objects sent so you could query it in integration tests.
There may still be a point to having this sort of log mailer though. You can have it set on your development machine and test what is going to come out of Gitea without having to set up other servers. (Although you can kind of do this with the sendmail interface this would be built in unless we wanted to provide an appropriate sendmail proxy script.)
In any case, the point was to spur us to sort this out. We went live with a fairly major version and server 500s happened as soon as people turned on email notifications.