Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting 'From' doesn't work when sender email has no name element, causing unverified sender failure #114

Open
Todderz opened this issue Nov 14, 2019 · 3 comments

Comments

@Todderz
Copy link

Todderz commented Nov 14, 2019

When the sender is

Bilbo Baggins <[email protected]>

the regex for replacing the From address works. The part between < and > is removed, and the verified From address is added, leaving

From: Bilbo Baggins <[email protected]>

If the sender is just

[email protected]

then the removal of the original fails, leaving

From: [email protected] <[email protected]>

AWS scans the first item in the From header and fails with unverified sender.

message: 'sendRawEmail() returned error.',
  error: 
   { MessageRejected: Email address is not verified. The following identities failed the check in region EU-WEST-1: <[email protected]>

Have been using the function for over 12 months without problem until failures when the sender address is as described, surrounded by others still working correctly with the more usual sender format, so it's not anything to do with sandboxes or other config. The only difference I can see for the failed messages is the sender from address being as discussed.

This line:

fromText = 'From: ' + from.replace(/<(.*)>/, '').trim() +

@kevbarns
Copy link

I have the same issue and no idea to fix it for now. love to hear from others, thanks !

fdaugan pushed a commit to fdaugan/aws-lambda-ses-forwarder that referenced this issue Jan 16, 2020
fdaugan pushed a commit to fdaugan/aws-lambda-ses-forwarder that referenced this issue Jan 16, 2020
fdaugan pushed a commit to fdaugan/aws-lambda-ses-forwarder that referenced this issue Jan 16, 2020
fdaugan pushed a commit to fdaugan/aws-lambda-ses-forwarder that referenced this issue Jan 16, 2020
pixell pushed a commit to pixell/aws-lambda-ses-forwarder that referenced this issue Feb 24, 2020
commit 13548a2
Author: Fabrice Daugan <[email protected]>
Date:   Thu Jan 16 15:14:02 2020 +0100

    Fix arithmetric#114 Sender email without name
@cregkly
Copy link

cregkly commented Jul 7, 2020

This is already fixed by #118

I merged it into my fork and it fixed the problem.

@christoph-kluge
Copy link

christoph-kluge commented Mar 29, 2021

Got the same problem. Going to validate #118 for my usecase.

// Edit#1
I have a slightly modified version but the solution provided in #118 is working 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants