1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-18 01:57:02 +00:00

POP3 is working

Added pop3.domain config option (for APOP greeting)
Implemented CAPA command
Implemented APOP "encrypted" authorization
Updated all sample config files to include [pop3] section
Closes #8
This commit is contained in:
James Hillyerd
2013-09-12 22:07:24 -07:00
parent 06ce860435
commit aa7b760385
7 changed files with 100 additions and 14 deletions

View File

@@ -25,6 +25,7 @@ type SmtpConfig struct {
type Pop3Config struct {
Ip4address net.IP
Ip4port int
Domain string
MaxIdleSeconds int
}
@@ -109,6 +110,7 @@ func LoadConfig(filename string) error {
requireOption(messages, "smtp", "store.messages")
requireOption(messages, "pop3", "ip4.address")
requireOption(messages, "pop3", "ip4.port")
requireOption(messages, "pop3", "domain")
requireOption(messages, "pop3", "max.idle.seconds")
requireOption(messages, "web", "ip4.address")
requireOption(messages, "web", "ip4.port")
@@ -262,6 +264,13 @@ func parsePop3Config() error {
return fmt.Errorf("Failed to parse [%v]%v: '%v'", section, option, err)
}
option = "domain"
str, err = Config.String(section, option)
if err != nil {
return fmt.Errorf("Failed to parse [%v]%v: '%v'", section, option, err)
}
pop3Config.Domain = str
option = "max.idle.seconds"
pop3Config.MaxIdleSeconds, err = Config.Int(section, option)
if err != nil {