public class POP3BouncedEmailReporter extends java.lang.Object implements BouncedEmailReporter
SMTPDistributor
is an example of a class that and delivers a message with such a header.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
Copyright.
|
Constructor and Description |
---|
POP3BouncedEmailReporter(java.lang.String serverpa,
int portpa,
java.lang.String accountpa,
java.lang.String passwordpa,
java.lang.String searchHeaderpa)
Constructor.
|
POP3BouncedEmailReporter(java.lang.String serverpa,
int portpa,
java.lang.String accountpa,
java.lang.String passwordpa,
java.lang.String searchHeaderpa,
boolean ssl)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
BouncedEmailReport[] |
getBouncedEmailReport()
Reports all email addresses that bounced to the address passed in the constructor that contains
the search header that was passed in the constructor.
|
void |
purge()
assigns the private members to new objects
|
void |
setDeleteMessages(boolean delete)
Tells the reporter to delete e-mail messages within the account passed to the contstructor.
|
public static final java.lang.String COPYRIGHT
public POP3BouncedEmailReporter(java.lang.String serverpa, int portpa, java.lang.String accountpa, java.lang.String passwordpa, java.lang.String searchHeaderpa)
server
- the hostname of the SMTP server to which a connection will be attempted.port
- the port through which the connection will be attempted.account
- the account on the SMTP server to use.password
- the password of the account on the server.searchHeader
- the header identifying the origin of the email.public POP3BouncedEmailReporter(java.lang.String serverpa, int portpa, java.lang.String accountpa, java.lang.String passwordpa, java.lang.String searchHeaderpa, boolean ssl)
serverpa
- the hostname of the SMTP server to which a connection will be attempted.portpa
- the port through which the connection will be attempted.accountpa
- the account on the SMTP server to use.passwordpa
- the password of the account on the server.searchHeaderpa
- the header identifying the origin of the email.ssl
- use an SSL connection to the SMTP serverpublic BouncedEmailReport[] getBouncedEmailReport() throws java.net.UnknownHostException, java.io.IOException
setDeleteMessages()
has been set to true).getBouncedEmailReport
in interface BouncedEmailReporter
BouncedEmailReport
objects that represent all bounced email addresses found that contain
the given searchHeader.java.net.UnknownHostException
- thrown when the host cannot be located on the networkjava.io.IOException
- thrown when communication through IO streams/sockets fail.public void purge()
public void setDeleteMessages(boolean delete)
setDeleteMessages
in interface BouncedEmailReporter
delete
- Delete every e-mail message if true; do not delete otherwise. Default is false.2