Email message "from" field not available

Hi all,

I'm experimenting with email as a quick and easy way to send messages to my system. I want to do some basic validation so checking the sender's address is a good start, but although the docs for the email node say that "msg.from" should work, it appears to be undefined in the emails I'm receiving.

I have a work-around by checking "msg.header.from.text" at the moment, but this could be email-provider dependent. I'd prefer to use a simpler "msg.from" style accessor but can't see how to enable this. The email node doesn't have any other options for message formatting or content.

I haven't found any other posts in the forum relating to this, so I'm guessing it's something odd in my email setup or message handling. If there's an extra email processing node, or something else I need, please let me know.

For reference, my typical received email message looks like :

object
payload: "More nonsense"
topic: "Test message"
date: "2019-09-21T15:24:09.000Z"
header: object
    received: array[3]
    dkim-signature: object
    x-originating-ip: "[...my IP...]"
< skip various header items >
    reply-to: object
    from: object
        value: array[1]
        html: "<span class="mp_address_group"><a href="mailto:...my email..." class="mp_address_email">...my email...</a></span>"
        text: "...my email..."
    to: object
        value: array[1]
        html: "<span class="mp_address_group"><a href="mailto:...my target sys..." class="mp_address_email">...my target sys...</a></span>"
        text: "...my target sys..."
    references: false
    subject: "Test message"
    date: "2019-09-21T15:24:09.000Z"

etc.

(I'm sure there are better ways to format the above, but I can't figure it out at the mo')

Thanks for spotting that - the from field moved slightly... will be fixed shortly.

1 Like

Excellent! Thanks for taking the trouble to do that.

pushed update to npm - so please test and let me know.

Brilliant, thanks. My server's shut down at the moment (well, being used for other things) but I'll update and give it a try tomorrow evening.

Hi @dceejay - I just updated it, and the new version works a treat! Thanks for fixing this.

My plans for world domination home automation are coming together nicely :slightly_smiling_face:

1 Like