public final class MailListener extends Object implements org.subethamail.smtp.helper.SimpleMessageListener
MailSaver
object.Constructor and Description |
---|
MailListener(MailSaver saver)
Creates the listener.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(String from,
String recipient)
Accepts all kind of email (always return true).
|
void |
deliver(String from,
String recipient,
InputStream data)
Receives emails and forwards them to the
MailSaver object. |
public MailListener(MailSaver saver)
saver
- a MailServer
object used to save emails and notify components.public boolean accept(String from, String recipient)
Called once for every RCPT TO during a SMTP exchange.
Each accepted recipient will result in a separate deliver() call later.
accept
in interface org.subethamail.smtp.helper.SimpleMessageListener
from
- the user who send the email.recipient
- the recipient of the email.true
public void deliver(String from, String recipient, InputStream data) throws IOException
MailSaver
object.deliver
in interface org.subethamail.smtp.helper.SimpleMessageListener
IOException
Copyright © 2015. All rights reserved.