Filter: postie_preconnect

This filter is called to determine the connection settings for the email server. This filter is called after postie_session_start.

add_filter('postie_preconnect', 'my_postie_preconnect');

// Force Postie to only fetch 1 email regardless of the setting.
function my_postie_preconnect($connectionInfo) {
 connectionInfo['email_max'] = 1;
 return $connectionInfo;


Setting Description
mail_protocol The protocol to use when communicating with the mail server. One of: pop3, imap, pop3-ssl, imap-ssl (string)
mail_server The domain of the mail server. (string)
mail_port The port to connect on. (integer)
mail_user The user for authenticating to the mail server. (string)
mail_password The password for authenticating to the mail server. (string)
mail_tls Whether to use TLS. (bool)
email_delete_after_processing Should Postie delete each email after retrieving it. (bool)
email_max The maximum number of emails to read. (integer)
email_ignore_state Whether to ignore the read/unread state of the email. (bool)