You are here

function mailhandler_mailbox_ui::edit_form_validate in Mailhandler 6.2

Same name and namespace in other branches
  1. 7.2 plugins/ctools/export_ui/mailhandler_mailbox_ui.class.php \mailhandler_mailbox_ui::edit_form_validate()

Implementation of ctools_export_ui::edit_form_validate().

Overrides ctools_export_ui::edit_form_validate

File

plugins/ctools/export_ui/mailhandler_mailbox_ui.class.php, line 182
Definition of mailhandler_mailbox_ui class.

Class

mailhandler_mailbox_ui
Represents an email mailbox (IMAP, POP3, etc...).

Code

function edit_form_validate(&$form, &$form_state) {
  parent::edit_form_validate($form, $form_state);

  // If POP3 mailbox is chosen, messages should be deleted after processing.
  // Do not set an actual error because this is helpful for testing purposes.
  if ($form_state['values']['settings']['type'] == 'pop3' && $form_state['values']['settings']['delete_after_read'] == 0) {
    mailhandler_report('warning', 'Unless you check off "Delete messages after they are processed" when using a POP3 mailbox, old emails will be re-imported each time the mailbox is processed. You can partially prevent this by mapping Message ID to a unique target in the processor configuration - see INSTALL.txt or advanced help for more information');
  }

  // Dummy library is only for testing.
  if ($form_state['values']['settings']['retrieve'] == 'MailhandlerRetrieveDummy') {
    mailhandler_report('warning', 'Because you selected the dummy retrieval library, Mailhandler will not import any messages. Please select another retrieval library, such as the PHP IMAP library.');
  }
}