Class Pop3MailReceiver

All Implemented Interfaces:
Aware, BeanFactoryAware, BeanNameAware, DisposableBean, InitializingBean, ApplicationContextAware, ExpressionCapable, MailReceiver, NamedComponent

public class Pop3MailReceiver extends AbstractMailReceiver
A MailReceiver implementation that polls a mail server using the POP3 protocol.
Author:
Arjen Poutsma, Mark Fisher
  • Field Details

  • Constructor Details

    • Pop3MailReceiver

      public Pop3MailReceiver()
    • Pop3MailReceiver

      public Pop3MailReceiver(String url)
    • Pop3MailReceiver

      public Pop3MailReceiver(String host, String username, String password)
    • Pop3MailReceiver

      public Pop3MailReceiver(String host, int port, String username, String password)
  • Method Details

    • searchForNewMessages

      protected javax.mail.Message[] searchForNewMessages() throws javax.mail.MessagingException
      Description copied from class: AbstractMailReceiver
      Subclasses must implement this method to return new mail messages.
      Specified by:
      searchForNewMessages in class AbstractMailReceiver
      Returns:
      An array of messages.
      Throws:
      javax.mail.MessagingException - Any MessagingException.
    • deleteMessages

      protected void deleteMessages(javax.mail.Message[] messages) throws javax.mail.MessagingException
      Deletes the given messages from this receiver's folder, and closes it to expunge deleted messages.
      Overrides:
      deleteMessages in class AbstractMailReceiver
      Parameters:
      messages - the messages to delete
      Throws:
      javax.mail.MessagingException - in case of JavaMail errors