devcybiko / ses-catchall

14 stars 8 forks source link

Not working #4

Open tarun1982 opened 1 year ago

tarun1982 commented 1 year ago

Hello,

All steps are followed as per https://github.com/devcybiko/ses-catchall/ still emails are not forwarded to the catchall account.

Please help.

devcybiko commented 1 year ago

Hello,

All steps are followed as per https://github.com/devcybiko/ses-catchall/ https://github.com/devcybiko/ses-catchall/ still emails are not forwarded to the catchall account.

Please help.

— Reply to this email directly, view it on GitHub https://github.com/devcybiko/ses-catchall/issues/4 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AF2IODAFSFMHOCLFXJYWLFTWFOHJXANCNFSM6AAAAAARQ3FS5Q . You are receiving this because you are subscribed to this thread. https://github.com/notifications/beacon/AF2IODHHPJ3YVR5H7TUHF7LWFOHJXA5CNFSM6AAAAAARQ3FS5SWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHFKDIBYM.gif Message ID: @.***>

tarun1982 commented 1 year ago

defaultEmail and adminEmail are correct.. Checked them multiple times.. Is there any way to check if lambda function call or not when new emails received.

devcybiko commented 1 year ago

You should be able to see any console.log() output in CloudWatch

On Oct 28, 2022, at 10:12 AM, Acentria Technologies Pvt ltd @. @.> > wrote:

defaultEmail and adminEmail are correct.. Checked them multiple times.. Is there any way to check if lambda function call or not when new emails received.

— Reply to this email directly, view it on GitHub https://github.com/devcybiko/ses-catchall/issues/4#issuecomment-1295051216 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AF2IODDYIA3AQ3BFZ7HNMBDWFPNMRANCNFSM6AAAAAARQ3FS5Q . You are receiving this because you commented. https://github.com/notifications/beacon/AF2IODCIBVEHEQCGYHZWEF3WFPNMRA5CNFSM6AAAAAARQ3FS5SWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTSNGDU5A.gif Message ID: @.***>

tarun1982 commented 1 year ago

Thank you for your time and reply.

Below error messages logged in CloudWatch #

2022-10-29T06:08:06.417Z 6c81ad1c-fcf9-4255-984b-0fb7f52194a6 ERROR Invoke Error
{ "errorType": "TypeError", "errorMessage": "Cannot read property 'split' of undefined", "stack": [ "TypeError: Cannot read property 'split' of undefined", " at filterContent (/var/task/index.js:30:25)", " at Runtime.handler (/var/task/index.js:86:26)", " at Runtime.handleOnceNonStreaming (/var/runtime/Runtime.js:73:25)" ] }

How this issue can be fixed?

devcybiko commented 1 year ago

the problem is on lines 29-30: function filterContent({ content, newFrom, replyTo }) { let lines = content.split("\n");

"content" is 'undefined'

That's because it filterContent() was called on line 86

let newContent = filterContent({ content: sesMsg.content, newFrom: config.adminEmail, replyTo: originalFrom }); log({ newContent });

that's because the sesMsg has no content (eg: sesMsg.content == undefined). 

If this is from a "test" call, your test data is empty. In that case check the 'test' call in the Console. Specifically in the TEST IT part of the README.md 

  1. replace the JSON with the contents of test.json from the repo

If it's from an SNS event, you likely have the wrong event coming in. It's unusual (improbable?) that the content is undefined. If that's the case, double-check the SES and SNS SETUP sections of the README.md.

On Oct 28, 2022, at 4:47 AM, Acentria Technologies Pvt ltd @. @.> > wrote:

Hello,

All steps are followed as per https://github.com/devcybiko/ses-catchall/ https://github.com/devcybiko/ses-catchall/ still emails are not forwarded to the catchall account.

Please help.

— Reply to this email directly, view it on GitHub https://github.com/devcybiko/ses-catchall/issues/4 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AF2IODAFSFMHOCLFXJYWLFTWFOHJXANCNFSM6AAAAAARQ3FS5Q . You are receiving this because you are subscribed to this thread. https://github.com/notifications/beacon/AF2IODHHPJ3YVR5H7TUHF7LWFOHJXA5CNFSM6AAAAAARQ3FS5SWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHFKDIBYM.gif Message ID: @.***>

tarun1982 commented 1 year ago

Already replaced the JSON with the contents of test.json from the repo, and below is the output of the test.. and I think no issue with that.

Test Event Name testing

Response { "disposition": "CONTINUE" }

Function Logs START RequestId: 5ec75e16-cf31-4aab-9170-2bcd5acc1c7e Version: $LATEST 2022-10-29T07:57:37.867Z 5ec75e16-cf31-4aab-9170-2bcd5acc1c7e INFO { "mail": { "headers": [ { "name": "From", "value": "admin@.awsapps.com <admin@.awsapps.com>" } ], "destination": [ "info@.app" ] }, "content": "email content" } 2022-10-29T07:57:37.869Z 5ec75e16-cf31-4aab-9170-2bcd5acc1c7e INFO { originalDestination: 'info@.app' } 2022-10-29T07:57:37.869Z 5ec75e16-cf31-4aab-9170-2bcd5acc1c7e INFO { originalLabel: 'admin@.awsapps.com', originalFrom: 'admin@.awsapps.com' } 2022-10-29T07:57:37.869Z 5ec75e16-cf31-4aab-9170-2bcd5acc1c7e INFO Previously forwarded to default info@.app from info@.app by way of: admin@****.awsapps.com END RequestId: 5ec75e16-cf31-4aab-9170-2bcd5acc1c7e REPORT RequestId: 5ec75e16-cf31-4aab-9170-2bcd5acc1c7e Duration: 41.80 ms Billed Duration: 42 ms Memory Size: 128 MB Max Memory Used: 74 MB Init Duration: 467.23 ms

Request ID 5ec75e16-cf31-4aab-9170-2bcd5acc1c7e

But Below error messages logged in CloudWatch with real emails. #

2022-10-29T06:08:06.417Z 6c81ad1c-fcf9-4255-984b-0fb7f52194a6 ERROR Invoke Error { "errorType": "TypeError", "errorMessage": "Cannot read property 'split' of undefined", "stack": [ "TypeError: Cannot read property 'split' of undefined", " at filterContent (/var/task/index.js:30:25)", " at Runtime.handler (/var/task/index.js:86:26)", " at Runtime.handleOnceNonStreaming (/var/runtime/Runtime.js:73:25)" ] }

devcybiko commented 1 year ago

If this is in "production" then one of two things is true:

  1. You have an email with no content. In which case you'll need to add a condition to filterContent() after line 29 to detect empty content and return immediately.

  2. You have a non SES event. Check the logs (in CloudWatch) to see what the content of the message holds. It is logged on line 69.

I'm interested in what the resolution is. I don't think you should have empty sesMsg.content

On Oct 29, 2022, at 4:01 AM, Acentria Technologies Pvt ltd @. @.> > wrote:

Already replaced the JSON with the contents of test.json from the repo, and below is the output of the test.. and I think no issue with that.

Test Event Name testing

Response { "disposition": "CONTINUE" }

Function Logs START RequestId: 5ec75e16-cf31-4aab-9170-2bcd5acc1c7e Version: $LATEST 2022-10-29T07:57:37.867Z5ec75e16-cf31-4aab-9170-2bcd5acc1c7eINFO{ "mail": { "headers": [ { "name": "From", "value": @. http://awsapps.com @. http://awsapps.com >" } ], "destination": [ @." ] }, "content": "email content" } 2022-10-29T07:57:37.869Z5ec75e16-cf31-4aab-9170-2bcd5acc1c7eINFO{ originalDestination: @.' } 2022-10-29T07:57:37.869Z5ec75e16-cf31-4aab-9170-2bcd5acc1c7eINFO{ originalLabel: @. http://awsapps.com ', originalFrom: @. http://awsapps.com ' } 2022-10-29T07:57:37.869Z5ec75e16-cf31-4aab-9170-2bcd5acc1c7eINFOPreviously forwarded to default @. from @. by way of: admin@****.awsapps.com http://awsapps.com END RequestId: 5ec75e16-cf31-4aab-9170-2bcd5acc1c7e REPORT RequestId: 5ec75e16-cf31-4aab-9170-2bcd5acc1c7eDuration: 41.80 msBilled Duration: 42 msMemory Size: 128 MBMax Memory Used: 74 MBInit Duration: 467.23 ms

Request ID 5ec75e16-cf31-4aab-9170-2bcd5acc1c7e

But Below error messages logged in CloudWatch with real emails. #

2022-10-29T06:08:06.417Z 6c81ad1c-fcf9-4255-984b-0fb7f52194a6 ERROR Invoke Error { "errorType": "TypeError", "errorMessage": "Cannot read property 'split' of undefined", "stack": [ "TypeError: Cannot read property 'split' of undefined", " at filterContent (/var/task/index.js:30:25)", " at Runtime.handler (/var/task/index.js:86:26)", " at Runtime.handleOnceNonStreaming (/var/runtime/Runtime.js:73:25)" ] }

— Reply to this email directly, view it on GitHub https://github.com/devcybiko/ses-catchall/issues/4#issuecomment-1295764433 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AF2IODD7QK3ZNQNPOEQJ6JTWFTKV5ANCNFSM6AAAAAARQ3FS5Q . You are receiving this because you commented. https://github.com/notifications/beacon/AF2IODFSKWYQMIMPU6X2OVLWFTKV5A5CNFSM6AAAAAARQ3FS5SWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTSNHPF5C.gif Message ID: @.***>

tarun1982 commented 1 year ago

I will check for the above and update the support ticket.

But I have one que # When I send email I am getting below response # Delivery has failed to these recipients or groups: tarun123@.app (tarun123@.app) The address you sent your message to wasn't found at the destination domain. It might be misspelled or it might not exist. Try to fix the problem by doing one or more of the following:

Will this setup will handle this?