“Invalid To: address” during Resend
-
Kudos for a fine plugin. Can’t live without it.
The plugin has a bug in the “Resend” capability on the Admin backend whereby if the original email message was presented with an array of addresses, the send process fails due to an “invalid To: address”.
This bug is due to the fact that the original To: address value stored in the message log’s metadata (‘original_to’) is not run through maybe_unserialize(), and is instead using the raw metadata as fetched from the database.
The problem exists in the PostmanEmailLogController.php file, around line 80, in the resendMail() method:
$meta_values = get_post_meta ( $postid ); $success = wp_mail ( $meta_values ['original_to'] [0], $meta_values ['original_subject'] [0], $meta_values ['original_message'] [0], $meta_values ['original_headers'] [0] );
This code should be more like this (the mod we use until a fixed version is published):
$meta_values = get_post_meta ( $postid ); $original_to = $meta_values ['original_to'] [0]; $to_addrs = maybe_unserialize($original_to); $success = wp_mail ( $to_addrs, $meta_values ['original_subject'] [0], $meta_values ['original_message'] [0], $meta_values ['original_headers'] [0] );
We think it’s strange that WP performs a maybe_serialize() on all metadata being stored in the database, and yet doesn’t do the reverse when that same data is fetched, but that’s what appears to be happening in the case of a Postman Resend operation.
Again, great plugin. Very nice job.
- The topic ‘“Invalid To: address” during Resend’ is closed to new replies.