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

Verify throws an error with the SES v3 transport #1254

Closed
2 of 6 tasks
emanuelet opened this issue Mar 1, 2021 · 2 comments
Closed
2 of 6 tasks

Verify throws an error with the SES v3 transport #1254

emanuelet opened this issue Mar 1, 2021 · 2 comments

Comments

@emanuelet
Copy link

Please fill the following questionnaire about your issue:

  1. What kind of issue are you reporting?
  • A bug in Nodemailer
  • A bug in a plugin of Nodemailer (eg. issues with nodemailer-sendgrid)
  • Feature request
  • Looking for help to resolve some kind of problem with Nodemailer
  1. Are you listed as a sponsor of Nodemailer project (see Sponsors button above)?
  • Yes. Sponsors get priority support
  • No. Unless it is a bug in Nodemailer you might find support from public forums like StackOverflow.
  1. State your problem here:

I'm getting

TypeError: this.ses.sendRawEmail is not a function
    at SESTransport.verify (/var/app/current/node_modules/nodemailer/lib/ses-transport/index.js:319:18)

When I try to verify the conneciton before a sending an email with the SES transport.

Looking at the code, is trying to call directly the this.ses.sendRawEmail function without the if statement that has been added at line 262

if (typeof ses.send === 'function' && aws.SendRawEmailCommand) {
                        // v3 API
                        sendPromise = ses.send(new aws.SendRawEmailCommand(sesMessage));
                    } else {
                        // v2 API
                        sendPromise = ses.sendRawEmail(sesMessage).promise();
                    }

Would it be possible to push a correction? Thanks

@guiix-code
Copy link

I second this issue.

verify(callback) calls this.ses.sendRawEmail().
This does not work when this.ses contains the v3 syntax {ses: ... aws: ...}.

The _send function has the required code:
let ses = (this.ses.aws ? this.ses.ses : this.ses) || {};
let aws = this.ses.aws || {};

ognjenjevremovic pushed a commit to ognjenjevremovic/nodemailer that referenced this issue Mar 21, 2021
Add support for the AWS SES v3 API for verying the connection (SES
configuration).

✅ Closes: nodemailer#1254
ognjenjevremovic pushed a commit to ognjenjevremovic/nodemailer that referenced this issue Mar 21, 2021
Add unit tests for the AWS SES configuration / connection verification
for both v2 and v3 APIs.

✅ Closes: nodemailer#1254
andris9 pushed a commit that referenced this issue Mar 22, 2021
Add unit tests for the AWS SES configuration / connection verification
for both v2 and v3 APIs.

✅ Closes: #1254
@guiix-code
Copy link

guiix-code commented Mar 23, 2021

Thanks Andris!

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

2 participants