public class GreenMailServer extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static org.apache.commons.logging.Log |
log |
| Constructor and Description |
|---|
GreenMailServer() |
| Modifier and Type | Method and Description |
|---|---|
static com.icegreen.greenmail.user.GreenMailUser |
addUser(String email,
String login,
String password)
Add new user to the server
|
static boolean |
checkEmailDeleted(String emailSubject,
String protocol)
Overloaded method to check deletion of mail in the primary user's store
|
static boolean |
checkEmailDeleted(String emailSubject,
String protocol,
com.icegreen.greenmail.user.GreenMailUser user)
Check inbox and make sure a particular email is deleted.
|
static boolean |
checkEmailMoved(String emailSubject,
String protocol)
Overloaded method to check moving of mail in the primary user's store
|
static boolean |
checkEmailMoved(String emailSubject,
String protocol,
com.icegreen.greenmail.user.GreenMailUser user)
Check trash and make sure a particular email is moved to trash.
|
static void |
deleteAllEmails(String protocol)
Overloaded method to delete all the mails in the primary user's store
|
static void |
deleteAllEmails(String protocol,
com.icegreen.greenmail.user.GreenMailUser user)
Delete all emails in the inbox.
|
static com.icegreen.greenmail.user.GreenMailUser |
getPrimaryUser() |
static boolean |
isMailReceived(String protocol,
com.icegreen.greenmail.user.GreenMailUser user,
String subject)
Check whether email received by reading the emails.
|
void |
startServer()
Start the server and add the user.
|
void |
stopServer()
Stop server.
|
public void startServer()
public void stopServer()
public static com.icegreen.greenmail.user.GreenMailUser addUser(String email, String login, String password)
email - user emaillogin - user namepassword - passwordpublic static com.icegreen.greenmail.user.GreenMailUser getPrimaryUser()
public static boolean checkEmailDeleted(String emailSubject, String protocol, com.icegreen.greenmail.user.GreenMailUser user) throws javax.mail.MessagingException, InterruptedException
emailSubject - Email subjectprotocol - protocol used to connect to the serverjavax.mail.MessagingException - if we're unable to connect to the storeInterruptedException - if thread sleep failspublic static boolean checkEmailDeleted(String emailSubject, String protocol) throws javax.mail.MessagingException, InterruptedException
emailSubject - protocol - javax.mail.MessagingExceptionInterruptedExceptionpublic static boolean checkEmailMoved(String emailSubject, String protocol, com.icegreen.greenmail.user.GreenMailUser user) throws javax.mail.MessagingException, InterruptedException
emailSubject - Email subjectprotocol - protocol used to connect to the serverjavax.mail.MessagingException - if we're unable to connect to the storeInterruptedException - if thread sleep failspublic static boolean checkEmailMoved(String emailSubject, String protocol) throws javax.mail.MessagingException, InterruptedException
emailSubject - protocol - javax.mail.MessagingExceptionInterruptedExceptionpublic static void deleteAllEmails(String protocol, com.icegreen.greenmail.user.GreenMailUser user) throws javax.mail.MessagingException
protocol - protocol used to connect to the serverjavax.mail.MessagingException - if we're unable to connect to the storepublic static void deleteAllEmails(String protocol) throws javax.mail.MessagingException
protocol - javax.mail.MessagingExceptionpublic static boolean isMailReceived(String protocol, com.icegreen.greenmail.user.GreenMailUser user, String subject) throws javax.mail.MessagingException
protocol - to connect to the storeuser - whose mail store should be connectedsubject - the subject of the mail to searchjavax.mail.MessagingException - when unable to connect to the storeCopyright © 2018 WSO2. All rights reserved.