* Create log mailer for testing email settings
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Switch on the log mailer for the integration tests
This ensures that the sending mail process works
Signed-off-by: Andrew Thornton <art27@cantab.net>
* rename the from user for mysql/mssql
* rename log sender to dummy sender
* update the integration tests
* Add support for extra sendmail arguments
* Sendmail args to exec.command should be a list
* Add go-shellquote package
* Use go-shellquote lib for parsing Sendmail args
* Only parse if sendmail is configured
* Fix sending mail with a non-latin display name. #2102
Signed-off-by: Rémi Saurel <contact@remi-saurel.com>
* Take into account the possibility that setting.MailService.From is in `name <email@address>` format. #2102
Signed-off-by: Rémi Saurel <contact@remi-saurel.com>
* Send mails as HTML as default. Setting for send as plain text.
* Add new option SendAsPlainText. remove EnableHTMLAlternative
* Send HTML mails as default
* Add html check if html2text should be performed
* Send only multipart or plain. Add deprication warning for ENABLE_HTML_ALTERNATIVE
* Still use ENABLE_HTML_ALTERNATIVE for backward compatibility
* Changed to not ignore html2text errors
This change corrects a few logging issues:
* Standardized formatting errors with '%v'.
* Standardized failure warning word usage.
* Corrected an instance of using the standard log library when
the gitea log library should be used instead.
* Implemented sendmail. This piggybacks on existing configuration to keep the change simple
* Changed privicy of new sendSMTP and sendSendmail functions
* Fixed Lint errors
* Seperated SMTP and sendmail into their own senders
* Making new structs private as they should not be used externally now
* Added sendmail setting to ini file
* Minor code cleanup
* Do not write HTML in text/plain mail part
Fixes #2928
* Pass text/plain first, text/html second
* Do not send plain/text email if html2text failed (untested)
The User member of a message is not needed anymore.
The from that is send to the server, should always be the "system" from. This is also called the Bounce address http://en.wikipedia.org/wiki/Bounce_address
The SendMail function is rewritten and has the following new functionality:
- It is optional to skip verification of keys. The config option SKIP_VERIFY is added
- If the port is 465, or ending on 465, the TLS(/SSL) connection is started first.