Action: postie_file_added

This action is called after Postie successfully extracts an email attachment and adds it as a media item to the post. At the point it is called there is only a placeholder post, e.g. the content and metadata is not set yet.

add_action('postie_file_added', 'my_fileadded', 10, 3);

function my_fileadded($postid, $attachmentid, $file_array) {
    $fileinfo = wp_check_filetype(get_attached_file($attachmentid));
    $file = $fileinfo['file'];
    $url = $fileinfo['url'];
    $mimetype = $fileinfo['type'];
    //Do something like set featured image
    if (strpos($mimetype, 'image', 0) === 0) { //only if attachment is an image
        set_post_thumbnail($postid, $attachmentid);