fix
parent
7bfa368a24
commit
ccadaa12d9
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue