Class Pop3MailReceiver

java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.mail.AbstractMailReceiver
org.springframework.integration.mail.Pop3MailReceiver
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.integration.context.ExpressionCapable, MailReceiver, org.springframework.integration.support.context.NamedComponent

public class Pop3MailReceiver extends AbstractMailReceiver
A MailReceiver implementation that polls a mail server using the POP3 protocol.
  • 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 jakarta.mail.Message[] searchForNewMessages() throws jakarta.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:
      jakarta.mail.MessagingException - Any MessagingException.
    • deleteMessages

      protected void deleteMessages(jakarta.mail.Message[] messages) throws jakarta.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:
      jakarta.mail.MessagingException - in case of JavaMail errors