#1620 add allowed domains for SMTP auth

This commit is contained in:
Unknwon committed 2015-09-11 13:32:33 -04:00
1 parent 373ef5d15e
commit 362d64df04
7 files changed
+39 -13

No files matched your search

+2
View File
@@ -829,6 +829,8 @@ auths.ms_ad_sa = Ms Ad SA
auths.smtp_auth = SMTP Authentication Type auths.smtp_auth = SMTP Authentication Type
auths.smtphost = SMTP Host auths.smtphost = SMTP Host
auths.smtpport = SMTP Port auths.smtpport = SMTP Port
auths.allowed_domains = Allowed Domains
auths.allowed_domains_helper = Leave it empty to not restrict any domains. Multiple domains should be separated by comma ','.
auths.enable_tls = Enable TLS Encryption auths.enable_tls = Enable TLS Encryption
auths.skip_tls_verify = Skip TLS Verify auths.skip_tls_verify = Skip TLS Verify
auths.pam_service_name = PAM Service Name auths.pam_service_name = PAM Service Name
+18 -6
View File
@@ -67,11 +67,12 @@ func (cfg *LDAPConfig) ToDB() ([]byte, error) {
} }
type SMTPConfig struct { type SMTPConfig struct {
Auth string Auth string
Host string Host string
Port int Port int
TLS bool AllowedDomains string `xorm:"TEXT"`
SkipVerify bool TLS bool
SkipVerify bool
} }
func (cfg *SMTPConfig) FromDB(bs []byte) error { func (cfg *SMTPConfig) FromDB(bs []byte) error {
@@ -383,6 +384,16 @@ func SMTPAuth(a smtp.Auth, cfg *SMTPConfig) error {
// Create a local user if success // Create a local user if success
// Return the same LoginUserPlain semantic // Return the same LoginUserPlain semantic
func LoginUserSMTPSource(u *User, name, passwd string, sourceId int64, cfg *SMTPConfig, autoRegister bool) (*User, error) { func LoginUserSMTPSource(u *User, name, passwd string, sourceId int64, cfg *SMTPConfig, autoRegister bool) (*User, error) {
// Verify allowed domains.
if len(cfg.AllowedDomains) > 0 {
idx := strings.Index(name, "@")
if idx == -1 {
return nil, ErrUserNotExist{0, name}
} else if !com.IsSliceContainsStr(strings.Split(cfg.AllowedDomains, ","), name[idx+1:]) {
return nil, ErrUserNotExist{0, name}
}
}
var auth smtp.Auth var auth smtp.Auth
if cfg.Auth == SMTP_PLAIN { if cfg.Auth == SMTP_PLAIN {
auth = smtp.PlainAuth("", name, passwd, cfg.Host) auth = smtp.PlainAuth("", name, passwd, cfg.Host)
@@ -394,7 +405,8 @@ func LoginUserSMTPSource(u *User, name, passwd string, sourceId int64, cfg *SMTP
if err := SMTPAuth(auth, cfg); err != nil { if err := SMTPAuth(auth, cfg); err != nil {
if strings.Contains(err.Error(), "Username and Password not accepted") { if strings.Contains(err.Error(), "Username and Password not accepted") {
return nil, ErrUserNotExist{u.Id, u.Name} fmt.Println(err)
return nil, ErrUserNotExist{0, name}
} }
return nil, err return nil, err
} }
+1
View File
@@ -28,6 +28,7 @@ type AuthenticationForm struct {
SMTPAuth string SMTPAuth string
SMTPHost string SMTPHost string
SMTPPort int SMTPPort int
AllowedDomains string
TLS bool TLS bool
SkipVerify bool SkipVerify bool
AllowAutoRegister bool AllowAutoRegister bool
+2 -2
View File
@@ -4364,7 +4364,7 @@ func confLocaleLocale_deDeIni() (*asset, error) {
return a, nil return a, nil
} }
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xc4\xbd\xeb\x72\xdc\xc8\x8e\x27\xfe\x9d\x4f\xc1\xee\x09\xff\xdd\x1d\x21\x97\xa3\xbb\xff\x7b\x89\x0e\xdb\xbd\xb2\xd4\xbe\xcc\x58\x96\xc6\x52\x9f\xb3\x67\x1d\x8e\x6a\x56\x91\xaa\xe2\x71\x15\x59\x4d\xb2\x2c\xeb\x4c\x4c\xc4\xbe\xc6\xbe\xde\x3e\xc9\x02\x3f\x00\x79\x23\x4b\xb2\xcf\x99\xd8\xfd\x22\xb1\x32\x91\x37\x24\x12\x09\x20\x91\xc8\x62\xb7\x9b\x97\x55\xbf\xcc\x9f\xe6\xc7\xf9\xae\xa8\x9b\x4d\xd5\xf7\x79\x5f\x6d\xae\x1f\xad\xdb\x7e\xa8\xca\xfc\x65\x3d\xd0\xef\xee\x53\xbd\xac\xb2\x6c\xdd\x6e\x2b\x02\x7d\x45\xff\xb2\xb2\xe8\xd7\x8b\xb6\xe8\x4a\x4a\x38\xb5\xef\xac\xfa\xbc\xdb\xb4\x1d\x03\xfd\x2a\x5f\xd9\xba\xda\xec\xb8\x0c\xfd\xcb\xfa\x7a\xd5\xcc\xeb\x86\x7e\x5e\xd2\x57\xfe\xba\xc9\xfa\x76\x59\x17\x9b\x79\x90\x81\x04\xcb\xff\x39\xff\xb1\x29\xf3\xcb\xa1\xda\xe5\x4f\xfa\x6d\xb1\xd9\x3c\x2b\x7a\x14\x19\xaa\xbc\x58\x2e\xdb\x7d\x33\x3c\x79\x2c\x19\x52\x79\xbb\x1f\xac\xf6\xf3\xfd\x20\x69\xfb\x9d\x25\xfd\xb6\xcb\xba\x6a\x55\xd3\xc0\x3a\x4a\x7a\xa7\x9f\xd9\x4d\xb5\xe8\xeb\x81\x3b\xfd\x67\xf9\xca\x3e\x55\x5d\x5f\xb7\xdc\x9f\x3f\xc9\x57\xb6\x2b\x56\x0c\x70\x41\xff\xb2\xa1\xda\xee\x36\x05\x0a\x5c\xe9\x67\xb6\x29\x9a\xd5\x5e\x60\xde\xe8\x67\xb6\xec\x2a\xca\x9a\x37\xd5\x0d\xa5\x9e\xe0\xc7\x6c\x36\xcb\xf6\x84\xcf\xf9\xae\x6b\xaf\xeb\x4d\x35\x2f\x9a\x72\xbe\x15\x8c\xfd\x46\xe9\xb9\xa6\xe7\x94\x9e\x73\x3a\x86\x50\x95\x84\x9c\x79\xd1\xeb\x38\x68\x5a\x08\x57\x45\x9f\xa1\xaa\xa6\xd8\x5a\x69\xfe\xcc\xaa\x6d\x51\x6f\x78\x02\x1e\xf1\x07\x75\xbc\xef\x6f\x5a\x4c\xd3\x85\x7e\x12\x12\xe6\xc3\xed\xae\x02\x0e\x1e\x5d\xd1\x57\xb6\x2c\x76\xc3\x72\x5d\x70\x3f\xe5\x2b\x23\xa0\x5d\x4b\xc8\x68\xbb\x5b\xc0\xd9\x8f\xac\xed\x56\x45\x53\xff\xad\x18\x04\x41\xe7\xc1\xcf\x6c\x5b\x77\x5d\xcb\xb8\x3d\xc3\x47\x46\x43\x9f\x73\x3d\x94\xf2\x96\xb0\x10\xd4\xc2\x39\xdb\x7a\xd5\x09\x1a\x39\xf3\x0c\xbf\xb8\x16\xce\xbb\x6e\xbb\x8f\x9a\xf1\x82\x3f\x93\xa2\xd4\x09\xcd\x8d\xdb\x2f\x1a\x42\xbc\xe6\x9e\xe1\x47\x04\xd0\x67\x45\xb9\x25\x54\xee\x8a\xa6\x62\x1c\x1d\xf3\x2f\xc2\x0b\xfd\xca\x94\x9e\xe6\x7d\x35\x0c\x75\xb3\x62\x64\x1f\x4b\x52\x7e\xa9\x49\x59\x90\xe7\xd2\x6e\xdb\xbd\x9b\x4e\x4a\xff\x0b\xfd\xcc\x2f\xe4\xa7\xe4\x05\x85\x90\xe9\x4a\xf2\x48\xfa\xf9\x75\x55\x95\x32\x96\x3e\x7f\x41\xdf\xd9\x6e\xbf\xd9\x10\xd6\xfe\xd8\x57\xfd\xc0\x85\x2e\xe8\x37\x8d\x5f\x7e\x67\x75\xdf\xd3\x07\x25\xbf\xc6\x47\x46\x53\xd7\x2c\x31\x98\x13\x7c\x64\xd9\xfb\xbe\x2a\xba\xe5\xfa\x43\x26\xff\xd1\x57\xfe\x60\xda\x3b\x34\xa9\x4c\x48\x4a\x44\xd2\x82\x35\x90\x2d\xdb\x92\x7f\x9c\xd0\x3f\xaa\xba\x6e\xfa\x81\x56\xdb\x87\x4c\x3f\x18\x4c\xbe\x64\x02\x86\x7a\x00\x16\x34\x11\x4b\xb7\xe7\x19\xcc\x5f\xd4\x5d\x3f\x3c\x1a\x6a\x22\xd6\x77\xfb\x26\xe3\xf1\xd1\x4a\x9b\x97\x0b\x63\x40\x2f\x5b\x42\x11\x92\x3b\x1a\xdf\xd9\xed\xe5\xbf\xbe\x39\xca\x2f\x88\x0b\xad\xba\x8a\xbe\x73\xaa\x83\xfe\x51\x99\x9f\x66\x19\x95\xb2\x96\x4e\x8b\xa1\x58\x14\x7d\xe5\xd1\xca\x99\x42\xdd\x2e\x0f\x34\xce\x1c\x0d\xdc\xab\x1f\xa2\xf1\x4e\xad\x10\xaa\x43\xd7\x95\xab\xe3\x2d\x2f\x2e\x4a\x67\x86\x86\xc2\x17\x9b\x8a\xd3\xa9\xaa\xfc\xf5\xdb\xb7\xe7\xa7\xcf\xf3\xaa\x59\xd5\x4d\x95\xdf\xd4\xc3\x3a\xdf\x0f\xd7\xff\x75\xbe\xaa\x9a\xaa\x23\xfe\xb6\xac\x73\x5a\x53\x1d\x51\x42\x4e\x84\x2d\x83\x9b\x65\x7d\xbf\xa1\xb5\x0f\xf4\x5e\x5e\xbe\xc9\xcf\x18\xc5\xbb\x62\x58\xa3\x23\xc3\x3a\xeb\xff\xd8\x30\x8a\x5c\x83\x57\xeb\x2a\x07\x95\x01\xa8\xbd\x36\x7c\xe4\xa5\xf6\x71\x96\x55\x5d\x37\x27\x96\x34\xdc\xce\xb5\xb0\xd6\x97\x42\x4a\x15\x44\x3a\x4d\x3b\xe4\x8b\x2a\x47\x99\x59\x96\x59\x87\x0d\xbb\xc7\xbb\xdd\xa6\x5e\xca\x5a\x7f\x29\x79\x1e\xd1\xbc\x7b\x28\x96\x42\x38\x20\xca\xf2\x02\x74\x11\x6b\xe6\xf5\x90\x47\x0c\x04\xe5\xd7\x15\x31\xc0\xf5\x7e\x25\x6c\x6f\xd3\xee\xcb\x6f\x40\xa9\xd6\x7b\x4f\xa8\xf9\xbb\x96\x3a\x0c\xec\x38\x00\xdf\xc4\x31\x51\x1c\x6f\x58\x5d\xb5\x6d\x89\xaf\x38\x62\xaf\x89\xa0\x6e\x6a\xca\xa4\x91\xf6\xc5\x27\x5a\x6f\x43\x9b\x0f\xeb\xba\xcf\x4b\x22\xb6\x25\x57\x4c\x4b\x63\x4f\x5b\x85\x90\x05\x11\xa8\x90\x86\xa5\xc5\x73\x00\xa8\xed\x9e\xa8\x69\x4d\x95\xf1\x46\xc4\xbb\x26\x55\x39\xd5\x4f\x0c\x89\xea\x01\x7d\x13\xe5\xb6\xc4\x95\x99\x6f\x9e\xe2\x43\x7f\x87\xf5\x53\xaf\x8a\xeb\x6b\xea\x55\x4f\x54\xf1\x2a\x5f\x6e\x5a\x22\xa9\xdf\xde\xbd\xe9\x99\x60\xd6\xf3\x5d\xdb\x61\x8b\xa3\xac\x0b\xfa\x74\x69\x01\xa2\x19\xa2\xd9\x6f\x17\xf4\xeb\x66\x5d\x13\x07\x00\xda\xb9\x04\xef\xe4\x94\x4a\x4d\xec\x7b\x9a\xc2\xa3\x9c\x48\x98\x46\x40\x28\x03\x01\xf0\x18\xca\xba\x2f\x16\x34\xf7\x0c\x7e\x4d\x5b\xd6\xbe\x23\xb2\x5a\x0f\xc3\xce\x5a\x7e\x75\x75\x75\x21\x4d\xbb\xd4\xbb\xda\x2e\x02\xca\xc0\x1c\x6c\x78\xd3\x6d\xf2\xb6\x99\x81\x48\xf6\xdd\x26\xa1\x1f\x1a\xab\xe5\x1c\xc0\x0b\x77\xe1\x31\xff\xb9\xf4\xe8\x01\x9e\x7b\x92\x4c\x6e\x40\x4d\x84\xe3\x0a\x1b\x20\x11\x75\xbb\xe3\x7a\x03\xaa\x3e\xd7\x04\x4f\xca\xd8\x34\x5d\xbe\x6c\x9d\x94\x0b\xb9\x27\x60\xff\x5b\x1a\xb0\xb2\x91\xcb\x33\x42\x03\x78\x09\x52\xaf\xbb\x76\x4b\xa9\x2f\xe8\x9f\x4f\xf0\xdd\x3f\xe3\xfa\x00\x53\x94\x25\xf1\xb7\xfe\x28\x7f\xf7\xe2\x24\xff\x4f\x3f\xfd\xf8\xe3\x2c\x7f\x3d\xf0\x4a\x64\xe2\xfc\x2b\x13\x15\x7d\xca\x1e\xee\x40\x89\x65\x0Line truncated var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xc4\xbd\xeb\x72\xdc\xc8\x8e\x27\xfe\x9d\x4f\xc1\xee\x09\xff\xdd\x1d\x21\x97\xa3\xbb\xff\x7b\x89\x0e\xdb\xbd\xb2\xd4\xbe\xcc\x58\x96\xc6\x52\x9f\xb3\x67\x1d\x8e\x6a\x56\x91\xaa\xe2\x71\x15\x59\x4d\xb2\x2c\xeb\x4c\x4c\xc4\xbe\xc6\xbe\xde\x3e\xc9\x02\x3f\x00\x79\x23\x4b\xb2\xcf\x99\xd8\xfd\x22\xb1\x32\x91\x37\x24\x12\x09\x20\x91\xc8\x62\xb7\x9b\x97\x55\xbf\xcc\x9f\xe6\xc7\xf9\xae\xa8\x9b\x4d\xd5\xf7\x79\x5f\x6d\xae\x1f\xad\xdb\x7e\xa8\xca\xfc\x65\x3d\xd0\xef\xee\x53\xbd\xac\xb2\x6c\xdd\x6e\x2b\x02\x7d\x45\xff\xb2\xb2\xe8\xd7\x8b\xb6\xe8\x4a\x4a\x38\xb5\xef\xac\xfa\xbc\xdb\xb4\x1d\x03\xfd\x2a\x5f\xd9\xba\xda\xec\xb8\x0c\xfd\xcb\xfa\x7a\xd5\xcc\xeb\x86\x7e\x5e\xd2\x57\xfe\xba\xc9\xfa\x76\x59\x17\x9b\x79\x90\x81\x04\xcb\xff\x39\xff\xb1\x29\xf3\xcb\xa1\xda\xe5\x4f\xfa\x6d\xb1\xd9\x3c\x2b\x7a\x14\x19\xaa\xbc\x58\x2e\xdb\x7d\x33\x3c\x79\x2c\x19\x52\x79\xbb\x1f\xac\xf6\xf3\xfd\x20\x69\xfb\x9d\x25\xfd\xb6\xcb\xba\x6a\x55\xd3\xc0\x3a\x4a\x7a\xa7\x9f\xd9\x4d\xb5\xe8\xeb\x81\x3b\xfd\x67\xf9\xca\x3e\x55\x5d\x5f\xb7\xdc\x9f\x3f\xc9\x57\xb6\x2b\x56\x0c\x70\x41\xff\xb2\xa1\xda\xee\x36\x05\x0a\x5c\xe9\x67\xb6\x29\x9a\xd5\x5e\x60\xde\xe8\x67\xb6\xec\x2a\xca\x9a\x37\xd5\x0d\xa5\x9e\xe0\xc7\x6c\x36\xcb\xf6\x84\xcf\xf9\xae\x6b\xaf\xeb\x4d\x35\x2f\x9a\x72\xbe\x15\x8c\xfd\x46\xe9\xb9\xa6\xe7\x94\x9e\x73\x3a\x86\x50\x95\x84\x9c\x79\xd1\xeb\x38\x68\x5a\x08\x57\x45\x9f\xa1\xaa\xa6\xd8\x5a\x69\xfe\xcc\xaa\x6d\x51\x6f\x78\x02\x1e\xf1\x07\x75\xbc\xef\x6f\x5a\x4c\xd3\x85\x7e\x12\x12\xe6\xc3\xed\xae\x02\x0e\x1e\x5d\xd1\x57\xb6\x2c\x76\xc3\x72\x5d\x70\x3f\xe5\x2b\x23\xa0\x5d\x4b\xc8\x68\xbb\x5b\xc0\xd9\x8f\xac\xed\x56\x45\x53\xff\xad\x18\x04\x41\xe7\xc1\xcf\x6c\x5b\x77\x5d\xcb\xb8\x3d\xc3\x47\x46\x43\x9f\x73\x3d\x94\xf2\x96\xb0\x10\xd4\xc2\x39\xdb\x7a\xd5\x09\x1a\x39\xf3\x0c\xbf\xb8\x16\xce\xbb\x6e\xbb\x8f\x9a\xf1\x82\x3f\x93\xa2\xd4\x09\xcd\x8d\xdb\x2f\x1a\x42\xbc\xe6\x9e\xe1\x47\x04\xd0\x67\x45\xb9\x25\x54\xee\x8a\xa6\x62\x1c\x1d\xf3\x2f\xc2\x0b\xfd\xca\x94\x9e\xe6\x7d\x35\x0c\x75\xb3\x62\x64\x1f\x4b\x52\x7e\xa9\x49\x59\x90\xe7\xd2\x6e\xdb\xbd\x9b\x4e\x4a\xff\x0b\xfd\xcc\x2f\xe4\xa7\xe4\x05\x85\x90\xe9\x4a\xf2\x48\xfa\xf9\x75\x55\x95\x32\x96\x3e\x7f\x41\xdf\xd9\x6e\xbf\xd9\x10\xd6\xfe\xd8\x57\xfd\xc0\x85\x2e\xe8\x37\x8d\x5f\x7e\x67\x75\xdf\xd3\x07\x25\xbf\xc6\x47\x46\x53\xd7\x2c\x31\x98\x13\x7c\x64\xd9\xfb\xbe\x2a\xba\xe5\xfa\x43\x26\xff\xd1\x57\xfe\x60\xda\x3b\x34\xa9\x4c\x48\x4a\x44\xd2\x82\x35\x90\x2d\xdb\x92\x7f\x9c\xd0\x3f\xaa\xba\x6e\xfa\x81\x56\xdb\x87\x4c\x3f\x18\x4c\xbe\x64\x02\x86\x7a\x00\x16\x34\x11\x4b\xb7\xe7\x19\xcc\x5f\xd4\x5d\x3f\x3c\x1a\x6a\x22\xd6\x77\xfb\x26\xe3\xf1\xd1\x4a\x9b\x97\x0b\x63\x40\x2f\x5b\x42\x11\x92\x3b\x1a\xdf\xd9\xed\xe5\xbf\xbe\x39\xca\x2f\x88\x0b\xad\xba\x8a\xbe\x73\xaa\x83\xfe\x51\x99\x9f\x66\x19\x95\xb2\x96\x4e\x8b\xa1\x58\x14\x7d\xe5\xd1\xca\x99\x42\xdd\x2e\x0f\x34\xce\x1c\x0d\xdc\xab\x1f\xa2\xf1\x4e\xad\x10\xaa\x43\xd7\x95\xab\xe3\x2d\x2f\x2e\x4a\x67\x86\x86\xc2\x17\x9b\x8a\xd3\xa9\xaa\xfc\xf5\xdb\xb7\xe7\xa7\xcf\xf3\xaa\x59\xd5\x4d\x95\xdf\xd4\xc3\x3a\xdf\x0f\xd7\xff\x75\xbe\xaa\x9a\xaa\x23\xfe\xb6\xac\x73\x5a\x53\x1d\x51\x42\x4e\x84\x2d\x83\x9b\x65\x7d\xbf\xa1\xb5\x0f\xf4\x5e\x5e\xbe\xc9\xcf\x18\xc5\xbb\x62\x58\xa3\x23\xc3\x3a\xeb\xff\xd8\x30\x8a\x5c\x83\x57\xeb\x2a\x07\x95\x01\xa8\xbd\x36\x7c\xe4\xa5\xf6\x71\x96\x55\x5d\x37\x27\x96\x34\xdc\xce\xb5\xb0\xd6\x97\x42\x4a\x15\x44\x3a\x4d\x3b\xe4\x8b\x2a\x47\x99\x59\x96\x59\x87\x0d\xbb\xc7\xbb\xdd\xa6\x5e\xca\x5a\x7f\x29\x79\x1e\xd1\xbc\x7b\x28\x96\x42\x38\x20\xca\xf2\x02\x74\x11\x6b\xe6\xf5\x90\x47\x0c\x04\xe5\xd7\x15\x31\xc0\xf5\x7e\x25\x6c\x6f\xd3\xee\xcb\x6f\x40\xa9\xd6\x7b\x4f\xa8\xf9\xbb\x96\x3a\x0c\xec\x38\x00\xdf\xc4\x31\x51\x1c\x6f\x58\x5d\xb5\x6d\x89\xaf\x38\x62\xaf\x89\xa0\x6e\x6a\xca\xa4\x91\xf6\xc5\x27\x5a\x6f\x43\x9b\x0f\xeb\xba\xcf\x4b\x22\xb6\x25\x57\x4c\x4b\x63\x4f\x5b\x85\x90\x05\x11\xa8\x90\x86\xa5\xc5\x73\x00\xa8\xed\x9e\xa8\x69\x4d\x95\xf1\x46\xc4\xbb\x26\x55\x39\xd5\x4f\x0c\x89\xea\x01\x7d\x13\xe5\xb6\xc4\x95\x99\x6f\x9e\xe2\x43\x7f\x87\xf5\x53\xaf\x8a\xeb\x6b\xea\x55\x4f\x54\xf1\x2a\x5f\x6e\x5a\x22\xa9\xdf\xde\xbd\xe9\x99\x60\xd6\xf3\x5d\xdb\x61\x8b\xa3\xac\x0b\xfa\x74\x69\x01\xa2\x19\xa2\xd9\x6f\x17\xf4\xeb\x66\x5d\x13\x07\x00\xda\xb9\x04\xef\xe4\x94\x4a\x4d\xec\x7b\x9a\xc2\xa3\x9c\x48\x98\x46\x40\x28\x03\x01\xf0\x18\xca\xba\x2f\x16\x34\xf7\x0c\x7e\x4d\x5b\xd6\xbe\x23\xb2\x5a\x0f\xc3\xce\x5a\x7e\x75\x75\x75\x21\x4d\xbb\xd4\xbb\xda\x2e\x02\xca\xc0\x1c\x6c\x78\xd3\x6d\xf2\xb6\x99\x81\x48\xf6\xdd\x26\xa1\x1f\x1a\xab\xe5\x1c\xc0\x0b\x77\xe1\x31\xff\xb9\xf4\xe8\x01\x9e\x7b\x92\x4c\x6e\x40\x4d\x84\xe3\x0a\x1b\x20\x11\x75\xbb\xe3\x7a\x03\xaa\x3e\xd7\x04\x4f\xca\xd8\x34\x5d\xbe\x6c\x9d\x94\x0b\xb9\x27\x60\xff\x5b\x1a\xb0\xb2\x91\xcb\x33\x42\x03\x78\x09\x52\xaf\xbb\x76\x4b\xa9\x2f\xe8\x9f\x4f\xf0\xdd\x3f\xe3\xfa\x00\x53\x94\x25\xf1\xb7\xfe\x28\x7f\xf7\xe2\x24\xff\x4f\x3f\xfd\xf8\xe3\x2c\x7f\x3d\xf0\x4a\x64\xe2\xfc\x2b\x13\x15\x7d\xca\x1e\xee\x40\x89\x65\x0Line truncated
func confLocaleLocale_enUsIniBytes() ([]byte, error) { func confLocaleLocale_enUsIniBytes() ([]byte, error) {
return bindataRead( return bindataRead(
@@ -4379,7 +4379,7 @@ func confLocaleLocale_enUsIni() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 42724, mode: os.FileMode(420), modTime: time.Unix(1441986383, 0)} info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 42890, mode: os.FileMode(420), modTime: time.Unix(1441992331, 0)}
a := &asset{bytes: bytes, info: info} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
+6 -5
View File
@@ -88,11 +88,12 @@ func parseLDAPConfig(form auth.AuthenticationForm) *models.LDAPConfig {
func parseSMTPConfig(form auth.AuthenticationForm) *models.SMTPConfig { func parseSMTPConfig(form auth.AuthenticationForm) *models.SMTPConfig {
return &models.SMTPConfig{ return &models.SMTPConfig{
Auth: form.SMTPAuth, Auth: form.SMTPAuth,
Host: form.SMTPHost, Host: form.SMTPHost,
Port: form.SMTPPort, Port: form.SMTPPort,
TLS: form.TLS, AllowedDomains: form.AllowedDomains,
SkipVerify: form.SkipVerify, TLS: form.TLS,
SkipVerify: form.SkipVerify,
} }
} }
+5
View File
@@ -101,6 +101,11 @@
<label for="smtp_port">{{.i18n.Tr "admin.auths.smtpport"}}</label> <label for="smtp_port">{{.i18n.Tr "admin.auths.smtpport"}}</label>
<input id="smtp_port" name="smtp_port" value="{{$cfg.Port}}" required> <input id="smtp_port" name="smtp_port" value="{{$cfg.Port}}" required>
</div> </div>
<div class="field">
<label for="allowed_domains">{{.i18n.Tr "admin.auths.allowed_domains"}}</label>
<input id="allowed_domains" name="allowed_domains" value="{{$cfg.AllowedDomains}}">
<p class="help">{{.i18n.Tr "admin.auths.allowed_domains_helper"}}</p>
</div>
{{end}} {{end}}
<!-- PAM --> <!-- PAM -->
+5
View File
@@ -103,6 +103,11 @@
<label for="smtp_port">{{.i18n.Tr "admin.auths.smtpport"}}</label> <label for="smtp_port">{{.i18n.Tr "admin.auths.smtpport"}}</label>
<input id="smtp_port" name="smtp_port" value="{{.smtp_port}}"> <input id="smtp_port" name="smtp_port" value="{{.smtp_port}}">
</div> </div>
<div class="field">
<label for="allowed_domains">{{.i18n.Tr "admin.auths.allowed_domains"}}</label>
<input id="allowed_domains" name="allowed_domains" value="{{.allowed_domains}}">
<p class="help">{{.i18n.Tr "admin.auths.allowed_domains_helper"}}</p>
</div>
</div> </div>
<!-- PAM --> <!-- PAM -->