59 Commits (0f54f42646ca08a98b9b07ea069ff8e6236967d4)

Author SHA1 Message Date
mrsdizzie 54c1cb6c5f 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
5 years ago
zeripath 704da08fdc
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
5 years ago
zeripath 3d91bb2f2d 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
5 years ago
Lanre Adelowo 3a1ed82529 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
6 years ago
Jonas Bröms e86a0bf3fe 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
7 years ago
Rémi Saurel 66bc0ac251 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>
7 years ago
Jonas Östanbäck eab4579e17 Fix fmt error in mailer (#2490) 7 years ago
Jonas Östanbäck 01d7189c2d Fix slice out of bounds error in mailer (#2479) 7 years ago
Bo-Yi Wu b7812be33a fix misspell (#1996)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
7 years ago
Jonas Östanbäck d9a8eff2de 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
7 years ago
Ethan Koenig 021904e4e6 Fix typos in models/ and modules/ (#1248) 7 years ago
Gabriel Jackson bf6f61cc69 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.
8 years ago
Bo-Yi Wu 6510e57758 fix gofmt error
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
8 years ago
Philip Couling d4924d45d6 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
8 years ago
Lunny Xiao 2e565bc1c4 Golint fixed for modules/mailer 8 years ago
Sandro Santilli 4247304f5a 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
8 years ago
Rémy Boulanouar 2d68bd1ef9 Change import reference to match gitea instead of gogs (#37) 8 years ago
Unknwon 62b0dc4853 Web editor: fix cannot create new file in subdirectory 8 years ago
Unknwon f1b8d52eb3 #2854 fix no mail notification when issue is closed/reopened 8 years ago
Unknwon 0240f520ab #2954 minor fix for when to set HTML alternative 8 years ago
Unknwon 8df3ba96f3 #2954 use text/plain as default email content format 8 years ago
Sandro Santilli d35a1c30f4 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)
8 years ago
Unknwon 926e75d721 #2334 strip whitespace for migrate URL
Also fix a possible race condition while install
8 years ago
Unknwon 2d3ecbe5b2 make mailer log more verbose 9 years ago
Unknwon 373731f5e8 user gomail and new activate account email tpl
- #1496: fallback plain text
- #1002: add date header
- #913: fix encoding of header
9 years ago
Unknwon e75fd2f783 simplify names 9 years ago
Unknwon b003b18788 #1649 Using commas to delineate emails 9 years ago
Hongcai Deng fbb3486c95 fix syntax error 9 years ago
Hongcai Deng 7b92dc3d9d implemented #1528 9 years ago
Unknwon d7c3c79c00 minor fix on #1517 9 years ago
Yixin Hao d720c92d99 Added supported of 'AUTH LOGIN'
i've been missing a 'r' in previous, lol~
9 years ago
Unknwon c47afdff58 add config options for HELO 9 years ago
无闻 3db80f2c55 Merge pull request #943 from diseaz/mailer-client-cert
Use client certificate for SMTP over TLS
9 years ago
Gogs 2f1369c614 add error for hello func 10 years ago
Gogs 5293ae1221 Fix: 504 5.5.2 <localhost>: Helo command rejected 10 years ago
Dmitry Azhichakov 3aaf292ba8 Fix "forcing" client certificate for SMTP 10 years ago
Dmitry Azhichakov 8a6c86644e New feature: SMTP connection may use client certificate.
New config keys in [mailer] section:
 - CERT_FILE: path to a certificate file.
 - KEY_FILE: path to a key file.
10 years ago
Unknwon bd555551ce fix #801 10 years ago
无闻 030b3d751e Merge pull request #766 from phsmit/correct_from
Correct usage of FROM in email creation
10 years ago
Peter c884ecfea1 Parse the from string to extract the email address 10 years ago
Peter edbe1de026 Remove unused "User" member of Message Struct and fix bounce address
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
10 years ago
Peter 2321b4b272 Change from header in email, fixes #765 10 years ago
Peter 007cf33e88 Remove standard mailer port lines
This lines got committed by accident. They do actually nothing, as SplitHostPort will give an error if port is not given.
10 years ago
Unknwon b231b8c927 update locale and mirror code format 10 years ago
Peter eca42bcb44 Prefer CRAM-MD5 over PLAIN authentication 10 years ago
Peter 5ffeca35e7 Add option to use CRAM-MD5 as authentication method in the mailer 10 years ago
Peter 87be137b88 Rewrite of SendMail function
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.
10 years ago
Alukardd 21081836ba Allow send mail without authentication if SMTP server allow this 10 years ago
mcheng89 b9881d1e7b check for smtp AUTH extension 10 years ago
Unknwon 39931f8e00 Allow mail with self-signed certificates 10 years ago