This filter is called just before Postie starts making changes.
Parameters:
- $parsedEmail
The $parsedEmail parameter is an array describing the email.
You must return the $parsedEmail array from your function.
Example
add_filter('postie_post_pre', 'my_postie_post_pre');
function my_postie_post_pre($email) {
//Do something
$email['headers']['subject'] .= ' processed by postie_post_pre';
return $email;
}
The email value is an associative array containing information about the message. The array will always include the following keys:
uid: The UID of the messagereceived: The date the message was received by the serverheaders: An associative array of mail headers, the keys being the lowercase header names. By default the values are a string, but the following headers are further parsed:received: An array of theRecievedheadersto: An array of parsed addressees, each being an associative array in the format:mailbox: The part before the@host: The part after the@personal: The addressee’s name optional
cc: An array of parsed addressees, in the same format astobcc: An associative array of the bcc address, in the same format astofrom: An associative array of the from address, in the same format astosender: An associative array of the sender address, in the same format astoreply-to: An associative array of the address to reply to, in the same format astocontent-type: An associative array in the format:value: The main header valuefields: An associative array of the;separated key=value pairs after the main value
content-disposition: An associative array in the same format ascontent-type
And one or more of the following keys:
text: The plaintext bodyhtml: The HTML bodyattachment: An array of attachments, each containing:filename: The name of the filemimetype: The mimetype of the filedata: The raw contents of the file
inline: An array of inline files, each containing:filename: The name of the filemimetype: The mimetype of the filedata: The raw contents of the file
related: An associative array of related files, such as embedded images, with the keycid:{content-id}and an array value containing:mimetype: The mimetype of the filedata: The raw contents of the file
verified: If the message contents were verified via an S/MIME certificate – if not verified thesmime.p7sfile will be listed as an attachmentdecrypted: If the message contents were decrypted via an S/MIME private key – if not decrypted thesmime.p7mfile will be listed as an attachment
All values in headers, text and body will have been decoded to UTF-8. Files in the attachment, inline and related array will all retain their original encodings.