• Jay

    (@uscore713)


    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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi Jay,

    I am facing a similar problem with my woocommerce ‘new order’ emails. One of my customers filled in a wrong emailadress ([email protected]).

    Postman SMTP gives me the following log on my New order notification:

    Invalid “Reply-To” e-mail address “[email protected]

    This is the email header:
    Sender: Bloemen Bezorgen Utrecht <[email protected]>
    Receiver: [email protected]
    Reply to: Matt Mathews <[email protected]>
    Date: 2017-06-29 17:37:39
    Subject: Nieuwe bestelling (7787)
    Aflever-URI: https://api.sendgrid.com:443

    I would expect to receive the ‘New Order’ email on [email protected] even if the reply to email is incorrect.

    Hope to hear what I can do to solve this issue

    Thread Starter Jay

    (@uscore713)

    Hi JeanP,

    Sorry, but I am not one of the plugin authors, but merely one of its many satisfied customers that located a bug and prepared a fix for them to incorporate into the code base, should they elect to do so. (In the meantime, others can make that fix, if they so choose.)

    I tend to agree with your proposition that the email should have been sent regardless of the invalid Reply-To address, but surely others will disagree, citing a position in which all parameters must be valid.

    One of the beautiful (and, and some would argue, dangerous) things about WordPress is that the code is out in the open, available for modification by any Admin at any time. Perhaps you can go in and change the code for your needs?

    Plugin Author Jason Hendriks

    (@jasonhendriks)

    You guys got a patch for me?

    Thread Starter Jay

    (@uscore713)

    You guys? I started this post for a specific problem (and provided a fix), but another user presented a second problem that should be addressed in another post.

    Sorry, I’m still a bit new to the WordPress plugin ecosystem, so when you ask whether I “have a patch” for you, I’m not quite sure what you’re expecting. I presented the simple code fix (that works for me, but you may want something better), but are you asking for something more process-oriented?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘“Invalid To: address” during Resend’ is closed to new replies.