22 parent::edit_form($form, $form_state);
23 global $cookie_domain;
40 $ajax_settings = array(
41 'callback' =>
'_mailinglist_mailbox_test',
42 'wrapper' =>
'mailinglist_test_results',
46 'message' => t(
'Please wait - testing connection settings...'),
49 $form[
'connection'][
'settings'][
'domain'] = array(
50 '#type' =>
'textfield',
51 '#title' => t(
'Domain'),
54 '#description' => t(
'The domain of the server used to collect mail.'),
55 '#ajax' => $ajax_settings,
57 $form[
'connection'][
'settings'][
'port'] = array(
58 '#type' =>
'textfield',
59 '#title' => t(
'Port'),
63 '#description' => t(
'The mailbox port number (usually 110 for POP3).'),
64 '#element_validate' => array(
'element_validate_integer_positive'),
66 '#ajax' => $ajax_settings,
68 $form[
'connection'][
'settings'][
'name'] = array(
69 '#type' =>
'textfield',
70 '#title' => t(
'Username'),
73 '#description' => t(
'This username is used while logging into this mailbox during mail retrieval.'),
74 '#ajax' => $ajax_settings,
76 $form[
'connection'][
'settings'][
'pass'] = array(
77 '#type' =>
'textfield',
78 '#title' => t(
'Password'),
80 '#description' => t(
'The mailbox password corresponding to the username above. Consider using a non-vital password, since this field is stored with minimal encryption in the database and displayed here.'),
81 '#ajax' => $ajax_settings,
84 $form[
'connection'][
'settings'][
'results'] = array(
85 '#type' =>
'container',
86 '#attributes' => array(
87 'id' =>
'mailinglist_test_results',
91 $form[
'connection'][
'settings'][
'timeout'] = array(
92 '#type' =>
'textfield',
93 '#title' => t(
'Timeout'),
96 '#default_value' => $this->
get_setting(
'timeout', 10),
97 '#description' => t(
'Timeout (in Sec) to connect to server'),
98 '#element_validate' => array(
'element_validate_number'),
100 '#ajax' => $ajax_settings,
103 $form[
'extra'][
'settings'][
'apop'] = array(
104 '#type' =>
'checkbox',
105 '#title' => t(
'Detect APOP?'),
106 '#default_value' => $this->
get_setting(
'apop', FALSE),
107 '#description' => t(
'Check to enable APOP protocal detection'),
110 $form[
'extra'][
'settings'][
'delete_after_read'] = array(
111 '#type' =>
'checkbox',
112 '#title' => t(
'Delete messages after they are processed?'),
113 '#default_value' => $this->
get_setting(
'delete_after_read', TRUE),
114 '#description' => t(
'Uncheck this box to leave read messages in the mailbox. They will not be processed again unless they become marked as unread. You normallys should check this box.'),
117 $form[
'extra'][
'settings'][
'ipv6'] = array(
118 '#type' =>
'checkbox',
119 '#title' => t(
'IPv6'),
120 '#default_value' => $this->
get_setting(
'ipv6', FALSE),
121 '#description' => t(
'Use IPv6'),
131 parent::edit_form_validate($form, $form_state);
132 if ($form_state[
'values'][
'settings'][
'port'] < 1 || 65535 < $form_state[
'values'][
'settings'][
'port']) {
133 form_set_error(
'port', t(
'Port must be between 1 and 65535'));
136 if ($form_state[
'values'][
'settings'][
'port'] != 110) {
137 drupal_set_message(t(
'Non-standard Pop3 Port: @port', array(
'@port' => (
int)$form_state[
'values'][
'settings'][
'port'])),
'warning');
142 if ( $form_state[
'values'][
'settings'][
'delete_after_read'] == 0) {
143 drupal_set_message(t(
'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.'),
'warning');
152 parent::edit_form_submit($form, $form_state);
get_message_list($max=0)
Overrides/Implements Mailinglist:Retrieve::get_message_list Connect to mailbox and run message retrie...
Class defining the contents of an e-mail message.
edit_form_validate(&$form, &$form_state)
Implements ctools_export_ui::edit_form_validate().
edit_form_submit(&$form, &$form_state)
Implements ctools_export_ui::edit_form_submit().
get_setting($name, $def=NULL)
get_settings()
purge_message($id)
Overrides/Implements MailinglistRetrieve::purge_message();.
close()
Overrides/Implements MailinglistRetrieve::close().
Retrieve messages from a local mailbox file.
get_message($id)
Overrides/Implements MailinglistRetrieve::get_message().
_mailinglist_decode_password($code)
_mailinglist_decode_password
edit_form(&$form, &$form_state)
Implements ctools_export_ui::edit_form().
Retrieve messages from a Mailinglist Mailbox.