github.com/macaron-contrib/toolbox = commit:acbfe36e16 | github.com/macaron-contrib/toolbox = commit:acbfe36e16 | ||||
github.com/mattn/go-sqlite3 = commit:e28cd440fa | github.com/mattn/go-sqlite3 = commit:e28cd440fa | ||||
github.com/microcosm-cc/bluemonday = commit:fcd0f5074e | github.com/microcosm-cc/bluemonday = commit:fcd0f5074e | ||||
github.com/msteinert/pam = | |||||
github.com/nfnt/resize = commit:53e9ca890b | github.com/nfnt/resize = commit:53e9ca890b | ||||
github.com/russross/blackfriday = commit:6928e11ecd | github.com/russross/blackfriday = commit:6928e11ecd | ||||
github.com/shurcooL/go = commit:bc30a0bd33 | github.com/shurcooL/go = commit:bc30a0bd33 |
; QQ: smtp.qq.com:25 | ; QQ: smtp.qq.com:25 | ||||
; Note, if the port ends with "465", SMTPS will be used. Using STARTTLS on port 587 is recommended per RFC 6409. If the server supports STARTTLS it will always be used. | ; Note, if the port ends with "465", SMTPS will be used. Using STARTTLS on port 587 is recommended per RFC 6409. If the server supports STARTTLS it will always be used. | ||||
HOST = | HOST = | ||||
; Disable HELO operation when hostname are different. | |||||
DISABLE_HELO = | |||||
; Custom hostname for HELO operation, default is from system. | |||||
HELO_HOSTNAME = | |||||
; Do not verify the certificate of the server. Only use this for self-signed certificates | ; Do not verify the certificate of the server. Only use this for self-signed certificates | ||||
SKIP_VERIFY = | SKIP_VERIFY = | ||||
; Use client certificate | ; Use client certificate |
"github.com/gogits/gogs/modules/setting" | "github.com/gogits/gogs/modules/setting" | ||||
) | ) | ||||
const APP_VER = "0.6.1.0327 Beta" | |||||
const APP_VER = "0.6.1.0703 Beta" | |||||
func init() { | func init() { | ||||
runtime.GOMAXPROCS(runtime.NumCPU()) | runtime.GOMAXPROCS(runtime.NumCPU()) |
return err | return err | ||||
} | } | ||||
hostname, err := os.Hostname() | |||||
if err != nil { | |||||
return err | |||||
} | |||||
if !setting.MailService.DisableHelo { | |||||
hostname := setting.MailService.HeloHostname | |||||
if len(hostname) == 0 { | |||||
hostname, err = os.Hostname() | |||||
if err != nil { | |||||
return err | |||||
} | |||||
} | |||||
if err = client.Hello(hostname); err != nil { | |||||
return err | |||||
if err = client.Hello(hostname); err != nil { | |||||
return err | |||||
} | |||||
} | } | ||||
// If not using SMTPS, alway use STARTTLS if available | // If not using SMTPS, alway use STARTTLS if available |
Host string | Host string | ||||
From string | From string | ||||
User, Passwd string | User, Passwd string | ||||
DisableHelo bool | |||||
HeloHostname string | |||||
SkipVerify bool | SkipVerify bool | ||||
UseCertificate bool | UseCertificate bool | ||||
CertFile, KeyFile string | CertFile, KeyFile string | ||||
Host: sec.Key("HOST").String(), | Host: sec.Key("HOST").String(), | ||||
User: sec.Key("USER").String(), | User: sec.Key("USER").String(), | ||||
Passwd: sec.Key("PASSWD").String(), | Passwd: sec.Key("PASSWD").String(), | ||||
DisableHelo: sec.Key("DISABLE_HELO").MustBool(), | |||||
HeloHostname: sec.Key("HELO_HOSTNAME").String(), | |||||
SkipVerify: sec.Key("SKIP_VERIFY").MustBool(), | SkipVerify: sec.Key("SKIP_VERIFY").MustBool(), | ||||
UseCertificate: sec.Key("USE_CERTIFICATE").MustBool(), | UseCertificate: sec.Key("USE_CERTIFICATE").MustBool(), | ||||
CertFile: sec.Key("CERT_FILE").String(), | CertFile: sec.Key("CERT_FILE").String(), |
0.6.1.0327 Beta | |||||
0.6.1.0703 Beta |