From d922c579375b29ad86e2d45e57971080dbf78614 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 2 Sep 2018 20:47:34 -0400 Subject: [PATCH] Move the mailbox@ string to a MailboxAccount constant. --- config.go | 2 ++ pop3.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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) } } -- 2.22.5