From: Robert Sesek Date: Mon, 3 Sep 2018 00:47:34 +0000 (-0400) Subject: Move the mailbox@ string to a MailboxAccount constant. X-Git-Tag: v2.0.0-beta.1~11 X-Git-Url: https://src.bluestatic.org/?a=commitdiff_plain;h=d922c579375b29ad86e2d45e57971080dbf78614;p=mailpopbox.git Move the mailbox@ string to a MailboxAccount constant. --- diff --git a/config.go b/config.go index a825cd2..1ed9d5a 100644 --- a/config.go +++ b/config.go @@ -14,6 +14,8 @@ type Config struct { Servers []Server } +const MailboxAccount = "mailbox@" + type Server struct { // Domain is the second component of a mail address: . Domain string diff --git a/pop3.go b/pop3.go index 01b753c..ba5fd36 100644 --- a/pop3.go +++ b/pop3.go @@ -98,7 +98,7 @@ func (server *pop3Server) Name() string { func (server *pop3Server) OpenMailbox(user, pass string) (pop3.Mailbox, error) { for _, s := range server.config.Servers { - if user == "mailbox@"+s.Domain && pass == s.MailboxPassword { + if user == MailboxAccount+s.Domain && pass == s.MailboxPassword { return server.openMailbox(s.MaildropPath) } }