2
0
Commit Graph

90 Commits

Author SHA1 Message Date
kolaente
7815690b67 Add golangci (#6418) 2019-06-12 15:41:28 -04:00
zeripath
9ee531f867 Add SUBJECT_PREFIX mailer config option (#6605)
* Add SUBJECT_PREFIX mailer config option

* Add space between subject prefix and subject (Change from Gogs)

Signed-off-by: Andrew Thornton <art27@cantab.net>
2019-04-17 00:56:40 -04:00
mrsdizzie
a44faed78c Add X-Auto-Response-Suppress header to outgoing messages (#6492)
This is a header used to suggest mail servers not to respond to a message
with an auto-responder:

 https://docs.microsoft.com/en-us/openspecs/exchange_server_protocols/ms-oxcmail/ced68690-498a-4567-9d14-5c01f974d8b1

This header is also used by github and gitlab in outgoing messages.

Fixes #6484
2019-04-02 11:45:54 -04:00
zeripath
74d4686043 Better logging (#6038) (#6095)
* Panic don't fatal on create new logger

Fixes #5854

Signed-off-by: Andrew Thornton <art27@cantab.net>

* partial broken

* Update the logging infrastrcture

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Reset the skip levels for Fatal and Error

Signed-off-by: Andrew Thornton <art27@cantab.net>

* broken ncsa

* More log.Error fixes

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Remove nal

* set log-levels to lowercase

* Make console_test test all levels

* switch to lowercased levels

* OK now working

* Fix vetting issues

* Fix lint

* Fix tests

* change default logging to match current gitea

* Improve log testing

Signed-off-by: Andrew Thornton <art27@cantab.net>

* reset error skip levels to 0

* Update documentation and access logger configuration

* Redirect the router log back to gitea if redirect macaron log but also allow setting the log level - i.e. TRACE

* Fix broken level caching

* Refactor the router log

* Add Router logger

* Add colorizing options

* Adjust router colors

* Only create logger if they will be used

* update app.ini.sample

* rename Attribute ColorAttribute

* Change from white to green for function

* Set fatal/error levels

* Restore initial trace logger

* Fix Trace arguments in modules/auth/auth.go

* Properly handle XORMLogger

* Improve admin/config page

* fix fmt

* Add auto-compression of old logs

* Update error log levels

* Remove the unnecessary skip argument from Error, Fatal and Critical

* Add stacktrace support

* Fix tests

* Remove x/sync from vendors?

* Add stderr option to console logger

* Use filepath.ToSlash to protect against Windows in tests

* Remove prefixed underscores from names in colors.go

* Remove not implemented database logger

This was removed from Gogs on 4 Mar 2016 but left in the configuration
since then.

* Ensure that log paths are relative to ROOT_PATH

* use path.Join

* rename jsonConfig to logConfig

* Rename "config" to "jsonConfig" to make it clearer

* Requested changes

* Requested changes: XormLogger

* Try to color the windows terminal

If successful default to colorizing the console logs

* fixup

* Colorize initially too

* update vendor

* Colorize logs on default and remove if this is not a colorizing logger

* Fix documentation

* fix test

* Use go-isatty to detect if on windows we are on msys or cygwin

* Fix spelling mistake

* Add missing vendors

* More changes

* Rationalise the ANSI writer protection

* Adjust colors on advice from @0x5c

* Make Flags a comma separated list

* Move to use the windows constant for ENABLE_VIRTUAL_TERMINAL_PROCESSING

* Ensure matching is done on the non-colored message - to simpify EXPRESSION
2019-04-02 08:48:31 +01:00
zeripath
6e0309a8fb Make log mailer for testing (#5893)
* 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
2019-02-02 21:06:52 -05:00
Lanre Adelowo
e39a3df4e0 Explicitly decide whether to use TLS in mailer's configuration (#5024)
* explicitly decide on using TLS for mail connections

* explicitly decide on using TLS for mail connections

* keep compatibility
2018-11-26 14:21:41 -05:00
Jonas Bröms
2ff6355e0a Add support for extra sendmail arguments (#2731)
* 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
2017-10-25 22:27:25 +03:00
Rémi Saurel
ce523bd17e Fix sending mail with a non-latin display name. #2102 (#2559)
* 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>
2017-09-21 12:29:45 +08:00
Jonas Östanbäck
6229070675 Fix fmt error in mailer (#2490) 2017-09-12 09:04:14 +08:00
Jonas Östanbäck
0dfba54256 Fix slice out of bounds error in mailer (#2479) 2017-09-11 14:33:28 +08:00
Bo-Yi Wu
6b5714b65c fix misspell (#1996)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-06-18 08:30:04 +08:00
Jonas Östanbäck
1eb6004a46 Send mails as HTML as default. Setting for send as plain text. (#1648)
* 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
2017-06-07 09:14:31 +08:00
Ethan Koenig
f027815046 Fix typos in models/ and modules/ (#1248) 2017-03-15 08:52:01 +08:00
Gabriel Jackson
e8c47d9765 Cleanup log messaging
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.
2017-02-02 15:24:18 +01:00
Bo-Yi Wu
f559cae3a5 fix gofmt error
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2016-12-30 20:41:10 +01:00
Philip Couling
aca75f16b0 Implement sendmail (#355)
* 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
2016-12-25 14:55:22 +01:00
Lunny Xiao
46ded1e1bd Golint fixed for modules/mailer 2016-11-25 09:44:04 +08:00
Sandro Santilli
acb138c244 Update import paths from github.com/go-gitea to code.gitea.io (#135)
- Update import paths from github.com/go-gitea to code.gitea.io
- Fix import path for travis

See https://docs.travis-ci.com/user/languages/go#Go-Import-Path
2016-11-10 17:24:48 +01:00
Rémy Boulanouar
61ec6729e6 Change import reference to match gitea instead of gogs (#37) 2016-11-03 10:29:56 -02:00
Unknwon
a6b484f417 Web editor: fix cannot create new file in subdirectory 2016-08-29 00:10:21 -07:00
Unknwon
dcb0a41e41 #2854 fix no mail notification when issue is closed/reopened 2016-07-16 00:36:39 +08:00
Unknwon
21f84bdef4 #2954 minor fix for when to set HTML alternative 2016-05-30 01:50:20 -07:00
Unknwon
8470f67eb6 #2954 use text/plain as default email content format 2016-05-30 01:32:01 -07:00
Sandro Santilli
8bd7fe8431 Do not write HTML in text/plain mail part (#2954)
* 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)
2016-05-30 01:18:49 -07:00
Unknwon
8015d40786 Minor fix for #2660 2016-02-24 23:59:17 -05:00
Josh Frye
4e4d720851 Test mailer button. Addresses #1531 2016-02-24 09:48:05 -05:00
Unknwon
2b66e67625 #2334 strip whitespace for migrate URL
Also fix a possible race condition while install
2016-02-20 17:32:34 -05:00
Unknwon
69f420490d Make markdown as an independent module 2016-02-20 17:10:05 -05:00
Josh Frye
b73ad93c9f Fix issue email formatting. Addresses #2331 2016-02-18 16:08:20 -05:00
Unknwon
4a4d26e8ff make mailer log more verbose 2015-12-19 02:44:34 -05:00
Unknwon
4b54ceb402 fix #1829 and fix #890 2015-12-04 21:30:33 -05:00
Unknwon
677970b18e fix import path, fix #1782 2015-10-15 21:28:12 -04:00
Unknwon
41a27b7e75 #1525 Triggere mailer for admin created accounts 2015-09-25 19:45:44 -04:00
Unknwon
5bcd70e58c finish all new template for current ones 2015-09-17 15:45:36 -04:00
Unknwon
a07249858f finish new auth e-mails 2015-09-17 14:57:24 -04:00
Unknwon
9bea30ac07 user gomail and new activate account email tpl
- #1496: fallback plain text
- #1002: add date header
- #913: fix encoding of header
2015-09-17 01:54:12 -04:00
Unknwon
5ca6821fe5 simplify names 2015-09-16 23:08:46 -04:00
Unknwon
b183cdcad8 #1649 Using commas to delineate emails 2015-09-16 15:04:54 -04:00
Hongcai Deng
efaf45984e fix syntax error 2015-09-07 18:28:56 +08:00
Hongcai Deng
befdff0f32 implemented #1528 2015-09-07 18:25:15 +08:00
Louis Matthijssen
800a869f8f Fix missing space in issue emails subject 2015-08-24 21:05:20 +02:00
Unknwon
7ed456f90e minor fix on #1517 2015-08-20 19:12:55 +08:00
Yixin Hao
f4208e5a98 Added supported of 'AUTH LOGIN'
i've been missing a 'r' in previous, lol~
2015-08-20 13:56:25 +08:00
Unknwon
2d1027ea97 WIP: create PR - choose branch 2015-08-08 22:43:14 +08:00
Unknwon
a885de17db add config options for HELO 2015-07-03 14:08:18 +08:00
Unknwon
bb0250edda #1067: Deleting users should remove them from collaborator lists
- fix delete user but repository watches are not decreased
2015-03-17 21:51:39 -04:00
无闻
dc55bb4cae Merge pull request #943 from diseaz/mailer-client-cert
Use client certificate for SMTP over TLS
2015-02-28 22:25:48 -05:00
Gogs
95b1c32f95 add error for hello func 2015-02-20 10:12:27 +03:00
Gogs
187c114e53 Fix: 504 5.5.2 <localhost>: Helo command rejected 2015-02-19 10:47:05 +03:00
Dmitry Azhichakov
e105193e74 Fix "forcing" client certificate for SMTP 2015-02-13 10:33:55 +03:00