Filter: postie_filter_email2

This filter is called when Postie extracts the “from” email address. Typically you would use this filter if you wanted to decide between the “from”, “to” and “reply-to” email addresses.
At the point the filter is called there is no post created. If the “to” or “reply-to” headers do not exist in the source email the values will be a 0 length string (”).
The parameters are each single email address.
add_filter('postie_filter_email2', 'my_filterEmail2', 10, 3);

function my_filterEmail2($fromEmail, $toEmail, $replytoEmail) {
    //do some email validation logic
    return $fromEmail;

Remember that $toEmail and $replytoEmail may be blank (empty string).

See also: