ThatOtherAndrew
ThatOtherAndrew
CDCloudflare Developers
Created by ThatOtherAndrew on 12/1/2023 in #workers-help
[Workers] How to receive emails and get attachment
that's Good Enough™️ for me then, I'm considering this solved!
56 replies
CDCloudflare Developers
Created by ThatOtherAndrew on 12/1/2023 in #workers-help
[Workers] How to receive emails and get attachment
perfect, thank you!
56 replies
CDCloudflare Developers
Created by ThatOtherAndrew on 12/1/2023 in #workers-help
[Workers] How to receive emails and get attachment
I see, thank you! Then if I'm understanding this correctly, my above method should actually be secure, right?
56 replies
CDCloudflare Developers
Created by ThatOtherAndrew on 12/1/2023 in #workers-help
[Workers] How to receive emails and get attachment
Honestly I'll just attempt this and hope and pray for the best
56 replies
CDCloudflare Developers
Created by ThatOtherAndrew on 12/1/2023 in #workers-help
[Workers] How to receive emails and get attachment
Goodness, this is confusing
56 replies
CDCloudflare Developers
Created by ThatOtherAndrew on 12/1/2023 in #workers-help
[Workers] How to receive emails and get attachment
Would something like this be secure?
message.headers.get('from').endsWith('<[email protected]>')
message.headers.get('from').endsWith('<[email protected]>')
56 replies
CDCloudflare Developers
Created by ThatOtherAndrew on 12/1/2023 in #workers-help
[Workers] How to receive emails and get attachment
I'm hoping that I can take a shortcut given the fact that I know for certain emails from my inbox will take the format of "Display name" <[email protected]>
56 replies
CDCloudflare Developers
Created by ThatOtherAndrew on 12/1/2023 in #workers-help
[Workers] How to receive emails and get attachment
56 replies
CDCloudflare Developers
Created by ThatOtherAndrew on 12/1/2023 in #workers-help
[Workers] How to receive emails and get attachment
I'm aware that it's very unlikely someone will figure that out, but I don't like the idea of security through obscurity
56 replies
CDCloudflare Developers
Created by ThatOtherAndrew on 12/1/2023 in #workers-help
[Workers] How to receive emails and get attachment
My only concern with that is, does the email protocol allow for someone to just insert angle brackets into their display name, therefore tricking the worker into thinking it's a legitimate address?
56 replies
CDCloudflare Developers
Created by ThatOtherAndrew on 12/1/2023 in #workers-help
[Workers] How to receive emails and get attachment
Or rather, not me changing it - it'd be my organisation changing it
56 replies
CDCloudflare Developers
Created by ThatOtherAndrew on 12/1/2023 in #workers-help
[Workers] How to receive emails and get attachment
yep, the latter
56 replies
CDCloudflare Developers
Created by ThatOtherAndrew on 12/1/2023 in #workers-help
[Workers] How to receive emails and get attachment
I'd rather not hardcode the name part of it because then that means that the system would break if I changed my display name in my email client
56 replies
CDCloudflare Developers
Created by ThatOtherAndrew on 12/1/2023 in #workers-help
[Workers] How to receive emails and get attachment
Is it Good Enough™️ to just check for the part between the angle brackets or no?
56 replies
CDCloudflare Developers
Created by ThatOtherAndrew on 12/1/2023 in #workers-help
[Workers] How to receive emails and get attachment
right... I'm still a bit lost then
56 replies
CDCloudflare Developers
Created by ThatOtherAndrew on 12/1/2023 in #workers-help
[Workers] How to receive emails and get attachment
Would message.from be the correct attribute for me to access in this case?
56 replies
CDCloudflare Developers
Created by ThatOtherAndrew on 12/1/2023 in #workers-help
[Workers] How to receive emails and get attachment
To summarise: - I want to only accept emails from a specific inbox - I control the sending inbox - I want this to be secure enough that no other inbox would be able to pass the filter
56 replies
CDCloudflare Developers
Created by ThatOtherAndrew on 12/1/2023 in #workers-help
[Workers] How to receive emails and get attachment
Oh, right
56 replies
CDCloudflare Developers
Created by ThatOtherAndrew on 12/1/2023 in #workers-help
[Workers] How to receive emails and get attachment
Or maybe I should have the worker forward all email, and instead have the safe validation be handled on my server side
56 replies
CDCloudflare Developers
Created by ThatOtherAndrew on 12/1/2023 in #workers-help
[Workers] How to receive emails and get attachment
So what would your advice be if I want a worker which only accepts emails from a specific inbox I control? Should I look for the parsing library you mentioned above?
56 replies