From ccadaa12d9274e57f241e11dac0bd27645859b7c Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Sun, 9 Jan 2022 22:56:37 -0500 Subject: [PATCH] fix --- contact/email.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contact/email.go b/contact/email.go index b1ce6de..213e7f4 100755 --- a/contact/email.go +++ b/contact/email.go @@ -19,6 +19,7 @@ type Emailer struct { POP3 string IMAP string Password string + Limit int } func (e *Emailer) Read() (chan *mail.Message, error) { @@ -39,6 +40,9 @@ func (e *Emailer) ReadIMAP() (chan *mail.Message, error) { } from := uint32(1) to := mbox.Messages + if e.Limit > 0 && to > uint32(e.Limit) { + to = uint32(e.Limit) + } seqset := new(imap.SeqSet) seqset.AddRange(from, to) emails := make(chan *mail.Message)