Filter is invalid
zhoufan1 opened this issue · comments
I used the latest version and the filter is invalid. Did I use it wrong,
example code:
Pop3Server pop3Server = MailServer.create()
.host(host)
.port(995)
.ssl(true)
.auth(userName, userPass).debugMode(true)
.buildPop3MailServer();
ReceiveMailSession session = pop3Server.createSession();
session.open();
ReceivedEmail[] emails = session.receiveEmail(filter()
.flag(Flags.Flag.SEEN, false)
.subject("Hello"));
Hi!
This is what I used for e.g. Gmail:
ReceivedEmail[] mails = session.receive()
.filter(filter().flag(Flags.Flag.SEEN, false))
.fromFolder("INBOX")
.get();
@zhoufan1 would you be so kind to check what exactly is not working for you: the flag
part of the filter or the subject
? In both cases we just use underlying filter implementation.
Working with filters depends much on the target server and its capabilities. I will try to reproduce now.
Please see bd7a4bb - it has a test for your case.
So filters should work, it's just how your server is using them :)