refactor: separate SMTP config from LDAP struct

The LDAP struct was mixing LDAP connection settings with unrelated mail
settings. Extract mail fields into a dedicated SMTPConfig struct with
its own global (mySMTP), keeping concerns cleanly separated.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
nemunaire 2026-03-16 17:02:52 +07:00
commit 3e6b95bf40
3 changed files with 30 additions and 19 deletions

13
ldap.go
View file

@ -21,11 +21,14 @@ type LDAP struct {
BaseDN string
ServiceDN string
ServicePassword string
MailHost string
MailPort int
MailUser string
MailPassword string
MailFrom string
}
type SMTPConfig struct {
MailHost string
MailPort int
MailUser string
MailPassword string
MailFrom string
}
func (l LDAP) Connect() (*LDAPConn, error) {