Extract bounces emails with AES SES Lasso 8

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Extract bounces emails with AES SES Lasso 8

Laurent Gigon
Hi,

I've tried to extract email "[hidden email]" address but
impossible using JSON on Lasso 8.6
It works for "notificationType", but not for the rest of this string, any idea ?

{"notificationType":"Complaint","complaint":{"complainedRecipients":[{"emailAddress":"[hidden email]"}],"timestamp":"2019-02-06T18:37:51.657Z","feedbackId":"00000000-49f532cf-d800-47db-80bd-22f4ff38e0e6-000000","userAgent":"Yahoo!-Mail-Feedback/2.0","complaintFeedbackType":"abuse","arrivalDate":"2019-02-06T17:19:18.000Z"},"mail":{"timestamp":"2019-02-06T17:19:16.000Z","source":"[hidden email]","sourceArn":"arn:aws:ses:us-east-1:914000004:identity/[hidden email]","sourceIp":"0.52.185.0","sendingAccountId":"914385015944","messageId":"01000168c3d228a9-b65c2745-72cc-000-a238-48e006f93650-000000","destination":["[hidden email]"],"headersTruncated":false,"headers":[{"name":"Received","value":"from
email-smtp.us-east-1.amazonaws.com (s4.mydomain.com [0.0.0.0]) by
email-smtp.amazonaws.com with SMTP (SimpleEmailService-4120689079) id
NBJiqiQB3oQjfTBWKhfy for [hidden email]; Wed, 06 Feb 2019
17:19:16 +0000 (UTC)"},{"name":"MIME-Version","value":"1.0"},{"name":"To","value":"[hidden email]"},{"name":"From","value":"mydomain.com
<[hidden email]>"},{"name":"Subject","value":"My
subject"},{"name":"Date","value":"Wed, 06 Feb 2019 17:19:16
+0000"},{"name":"Auto-Submitted","value":"auto-generated"},{"name":"Precedence","value":"list"},{"name":"Content-Type","value":"multipart/alternative;
boundary="--==_mimepart_c9f288acf493f756a216830b29a39fc5";
charset=UTF-8"},{"name":"Content-Transfer-Encoding","value":"8bit"}],"commonHeaders":{"from":[""mydomain.com"
<[hidden email]>"],"date":"Wed, 06 Feb 2019 17:19:16
+0000","to":["[hidden email]"],"subject":"My Subject"}}}

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Extract bounces emails with AES SES Lasso 8

Bil Corry-3
Unpopular opinion, just use regex.

- Bil


On Wed, Feb 6, 2019 at 2:33 PM Laurent G <[hidden email]> wrote:

> Hi,
>
> I've tried to extract email "[hidden email]" address but
> impossible using JSON on Lasso 8.6
> It works for "notificationType", but not for the rest of this string, any
> idea ?
>
>
> {"notificationType":"Complaint","complaint":{"complainedRecipients":[{"emailAddress":"
> [hidden email]
> "}],"timestamp":"2019-02-06T18:37:51.657Z","feedbackId":"00000000-49f532cf-d800-47db-80bd-22f4ff38e0e6-000000","userAgent":"Yahoo!-Mail-Feedback/2.0","complaintFeedbackType":"abuse","arrivalDate":"2019-02-06T17:19:18.000Z"},"mail":{"timestamp":"2019-02-06T17:19:16.000Z","source":"
> [hidden email]
> ","sourceArn":"arn:aws:ses:us-east-1:914000004:identity/
> [hidden email]
> ","sourceIp":"0.52.185.0","sendingAccountId":"914385015944","messageId":"01000168c3d228a9-b65c2745-72cc-000-a238-48e006f93650-000000","destination":["
> [hidden email]
> "],"headersTruncated":false,"headers":[{"name":"Received","value":"from
> email-smtp.us-east-1.amazonaws.com (s4.mydomain.com [0.0.0.0]) by
> email-smtp.amazonaws.com with SMTP (SimpleEmailService-4120689079) id
> NBJiqiQB3oQjfTBWKhfy for [hidden email]; Wed, 06 Feb 2019
> 17:19:16 +0000
> (UTC)"},{"name":"MIME-Version","value":"1.0"},{"name":"To","value":"
> [hidden email]"},{"name":"From","value":"mydomain.com
> <[hidden email]>"},{"name":"Subject","value":"My
> subject"},{"name":"Date","value":"Wed, 06 Feb 2019 17:19:16
>
> +0000"},{"name":"Auto-Submitted","value":"auto-generated"},{"name":"Precedence","value":"list"},{"name":"Content-Type","value":"multipart/alternative;
> boundary="--==_mimepart_c9f288acf493f756a216830b29a39fc5";
>
> charset=UTF-8"},{"name":"Content-Transfer-Encoding","value":"8bit"}],"commonHeaders":{"from":[""
> mydomain.com"
> <[hidden email]>"],"date":"Wed, 06 Feb 2019 17:19:16
> +0000","to":["[hidden email]"],"subject":"My Subject"}}}
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Extract bounces emails with AES SES Lasso 8

Ke Carlton-3
In reply to this post by Laurent Gigon
It's not valid JSON. The quotes by boundary and from have not be escaped.

It should be:

     boundary=\"--==_mimepart_c9f288acf493f756a216830b29a39fc5\"

And:

    "from":["\"mydomain.com\" <[hidden email]>"]

Respectively. I'd raise a ticket / complain to the source of the data.

You could use regex to fix the JSON or just use regex to extract the email
addresses as Bil suggests...

Ke

On Thu, Feb 7, 2019 at 8:33 AM Laurent G <[hidden email]> wrote:

> Hi,
>
> I've tried to extract email "[hidden email]" address but
> impossible using JSON on Lasso 8.6
> It works for "notificationType", but not for the rest of this string, any
> idea ?
>
>
> {"notificationType":"Complaint","complaint":{"complainedRecipients":[{"emailAddress":"
> [hidden email]
> "}],"timestamp":"2019-02-06T18:37:51.657Z","feedbackId":"00000000-49f532cf-d800-47db-80bd-22f4ff38e0e6-000000","userAgent":"Yahoo!-Mail-Feedback/2.0","complaintFeedbackType":"abuse","arrivalDate":"2019-02-06T17:19:18.000Z"},"mail":{"timestamp":"2019-02-06T17:19:16.000Z","source":"
> [hidden email]
> ","sourceArn":"arn:aws:ses:us-east-1:914000004:identity/
> [hidden email]
> ","sourceIp":"0.52.185.0","sendingAccountId":"914385015944","messageId":"01000168c3d228a9-b65c2745-72cc-000-a238-48e006f93650-000000","destination":["
> [hidden email]
> "],"headersTruncated":false,"headers":[{"name":"Received","value":"from
> email-smtp.us-east-1.amazonaws.com (s4.mydomain.com [0.0.0.0]) by
> email-smtp.amazonaws.com with SMTP (SimpleEmailService-4120689079) id
> NBJiqiQB3oQjfTBWKhfy for [hidden email]; Wed, 06 Feb 2019
> 17:19:16 +0000
> (UTC)"},{"name":"MIME-Version","value":"1.0"},{"name":"To","value":"
> [hidden email]"},{"name":"From","value":"mydomain.com
> <[hidden email]>"},{"name":"Subject","value":"My
> subject"},{"name":"Date","value":"Wed, 06 Feb 2019 17:19:16
>
> +0000"},{"name":"Auto-Submitted","value":"auto-generated"},{"name":"Precedence","value":"list"},{"name":"Content-Type","value":"multipart/alternative;
> boundary="--==_mimepart_c9f288acf493f756a216830b29a39fc5";
>
> charset=UTF-8"},{"name":"Content-Transfer-Encoding","value":"8bit"}],"commonHeaders":{"from":[""
> mydomain.com"
> <[hidden email]>"],"date":"Wed, 06 Feb 2019 17:19:16
> +0000","to":["[hidden email]"],"subject":"My Subject"}}}
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Extract bounces emails with AES SES Lasso 8

Laurent Gigon
I've tried the http method, and stil unable to extract the email
address: "[hidden email]"
Unable to use String_ReplaceRegExp Lasso tag...
Here is the http post from Amazon Simple Notification Service :

array: ({
  "Type" : "Notification",
  "MessageId" : "b71b5caa-fc69-58f7-ba2e-000",
  "TopicArn" : "arn:aws:sns:us-east-1:000:ses-bounces-topic",
  "Message" : "{\"notificationType\":\"Bounce\",\"bounce\":{\"bounceType\":\"Permanent\",\"bounceSubType\":\"Suppressed\",\"bouncedRecipients\":[{\"emailAddress\":\"[hidden email]\",\"action\":\"failed\",\"status\":\"5.1.1\",\"diagnosticCode\":\"Amazon
SES has suppressed sending to this address as an invalid address.
\"}],\"timestamp\":\"2019-02-06T20:43:40.095Z\",\"feedbackId\":\"0000-a9b8c93f-767a-42ec-9c6d-e7f944fab365-000000\",\"reportingMTA\":\"dns;
amazonses.com\"},\"mail\":{\"timestamp\":\"2019-02-06T20:43:39.000Z\",\"source\":\"[hidden email]\",\"sourceArn\":\"arn:aws:ses:us-east-1:0000:identity/[hidden email]\",\"sourceIp\":\"0.0.0.0\",\"sendingAccountId\":\"000000\",\"messageId\":\"0-0-da30-4ad9-beec-ccd04135c1ba-000000\",\"destination\":[\"[hidden email]\"],\"headersTruncated\":false,\"headers\":[{\"name\":\"Received\",\"value\":\"from
email-smtp.us-east-1.amazonaws.com (s4.mydomain.com [0.0.0.0]) by
email-smtp.amazonaws.com with SMTP (SimpleEmailService-000) id 000000
for [hidden email]; Wed, 06 Feb 2019 20:43:39 +0000
(UTC)\"},{\"name\":\"MIME-Version\",\"value\":\"1.0\"},{\"name\":\"To\",\"value\":\"[hidden email]\"},{\"name\":\"From\",\"value\":\"mydomain.com
<[hidden email]>\"},{\"name\":\"Subject\",\"value\":\"Processus
Paris\"},{\"name\":\"Date\",\"value\":\"Wed, 06 Feb 2019 20:43:39
+0000\"},{\"name\":\"Auto-Submitted\",\"value\":\"auto-generated\"},{\"name\":\"Precedence\",\"value\":\"list\"},{\"name\":\"Content-Type\",\"value\":\"multipart/alternative;
boundary=\\\"--==_mimepart_e5565bfc7a250184c1c2af1a75f59959\\\";
charset=UTF-8\"},{\"name\":\"Content-Transfer-Encoding\",\"value\":\"8bit\"}],\"commonHeaders\":{\"from\":[\"\\\"mydomain.com\\\"
<[hidden email]>\"],\"date\":\"Wed, 06 Feb 2019 20:43:39
+0000\",\"to\":[\"[hidden email]\"],\"subject\":\"Processus
Paris\"}}}",
  "Timestamp" : "2019-02-06T20:43:40.101Z",
  "SignatureVersion" : "1",
  "Signature" :
"A3+/MmVfF0mB/5zK79hGCqB/omD/0+0+0/mdN/0+2qMZci3hLHLH+0/0/zQF1G/0/0/sh/0/0==",
  "SigningCertURL" :
"https://sns.us-east-1.amazonaws.com/SimpleNotificationService-0000.pem",
  "UnsubscribeURL" :
"https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:0000:ses-bounces-topic:000-000-4db8-00-00"
})

Le mer. 6 févr. 2019 à 16:12, Ke Carlton <[hidden email]> a écrit :

>
> It's not valid JSON. The quotes by boundary and from have not be escaped.
>
> It should be:
>
>      boundary=\"--==_mimepart_c9f288acf493f756a216830b29a39fc5\"
>
> And:
>
>     "from":["\"mydomain.com\" <[hidden email]>"]
>
> Respectively. I'd raise a ticket / complain to the source of the data.
>
> You could use regex to fix the JSON or just use regex to extract the email
> addresses as Bil suggests...
>
> Ke
>
> On Thu, Feb 7, 2019 at 8:33 AM Laurent G <[hidden email]> wrote:
>
> > Hi,
> >
> > I've tried to extract email "[hidden email]" address but
> > impossible using JSON on Lasso 8.6
> > It works for "notificationType", but not for the rest of this string, any
> > idea ?
> >
> >
> > {"notificationType":"Complaint","complaint":{"complainedRecipients":[{"emailAddress":"
> > [hidden email]
> > "}],"timestamp":"2019-02-06T18:37:51.657Z","feedbackId":"00000000-49f532cf-d800-47db-80bd-22f4ff38e0e6-000000","userAgent":"Yahoo!-Mail-Feedback/2.0","complaintFeedbackType":"abuse","arrivalDate":"2019-02-06T17:19:18.000Z"},"mail":{"timestamp":"2019-02-06T17:19:16.000Z","source":"
> > [hidden email]
> > ","sourceArn":"arn:aws:ses:us-east-1:914000004:identity/
> > [hidden email]
> > ","sourceIp":"0.52.185.0","sendingAccountId":"914385015944","messageId":"01000168c3d228a9-b65c2745-72cc-000-a238-48e006f93650-000000","destination":["
> > [hidden email]
> > "],"headersTruncated":false,"headers":[{"name":"Received","value":"from
> > email-smtp.us-east-1.amazonaws.com (s4.mydomain.com [0.0.0.0]) by
> > email-smtp.amazonaws.com with SMTP (SimpleEmailService-4120689079) id
> > NBJiqiQB3oQjfTBWKhfy for [hidden email]; Wed, 06 Feb 2019
> > 17:19:16 +0000
> > (UTC)"},{"name":"MIME-Version","value":"1.0"},{"name":"To","value":"
> > [hidden email]"},{"name":"From","value":"mydomain.com
> > <[hidden email]>"},{"name":"Subject","value":"My
> > subject"},{"name":"Date","value":"Wed, 06 Feb 2019 17:19:16
> >
> > +0000"},{"name":"Auto-Submitted","value":"auto-generated"},{"name":"Precedence","value":"list"},{"name":"Content-Type","value":"multipart/alternative;
> > boundary="--==_mimepart_c9f288acf493f756a216830b29a39fc5";
> >
> > charset=UTF-8"},{"name":"Content-Transfer-Encoding","value":"8bit"}],"commonHeaders":{"from":[""
> > mydomain.com"
> > <[hidden email]>"],"date":"Wed, 06 Feb 2019 17:19:16
> > +0000","to":["[hidden email]"],"subject":"My Subject"}}}
> >
> > #############################################################
> >
> > This message is sent to you because you are subscribed to
> >   the mailing list Lasso [hidden email]
> > Official list archives available at http://www.lassotalk.com
> > To unsubscribe, E-mail to: <[hidden email]>
> > Send administrative queries to  <[hidden email]>
> >
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Extract bounces emails with AES SES Lasso 8

maxwellk2
In reply to this post by Laurent Gigon
By no mean suggesting this is the correct way, but appears to work in Lasso 8.6….


local( 'json' = map );

#json = decode_json( '{"notificationType":"Complaint","complaint":{"complainedRecipients":[{"emailAddress":"[hidden email]"}],"timestamp":"2019-02-06T18:37:51.657Z","feedbackId":"00000000-49f532cf-d800-47db-80bd-22f4ff38e0e6-000000","userAgent":"Yahoo!-Mail-Feedback/2.0","complaintFeedbackType":"abuse","arrivalDate":"2019-02-06T17:19:18.000Z"},"mail":{"timestamp":"2019-02-06T17:19:16.000Z","source":"[hidden email]","sourceArn":"arn:aws:ses:us-east-1:914000004:identity/[hidden email]","sourceIp":"0.52.185.0","sendingAccountId":"914385015944","messageId":"01000168c3d228a9-b65c2745-72cc-000-a238-48e006f93650-000000","destination":["[hidden email]"],"headersTruncated":false,"headers":[{"name":"Received","value":"from
email-smtp.us-east-1.amazonaws.com (s4.mydomain.com [0.0.0.0]) by
email-smtp.amazonaws.com with SMTP (SimpleEmailService-4120689079) id
NBJiqiQB3oQjfTBWKhfy for [hidden email]; Wed, 06 Feb 2019
17:19:16 +0000 (UTC)"},{"name":"MIME-Version","value":"1.0"},{"name":"To","value":"[hidden email]"},{"name":"From","value":"mydomain.com
<[hidden email]>"},{"name":"Subject","value":"My
subject"},{"name":"Date","value":"Wed, 06 Feb 2019 17:19:16
+0000"},{"name":"Auto-Submitted","value":"auto-generated"},{"name":"Precedence","value":"list"},{"name":"Content-Type","value":"multipart/alternative;
boundary="--==_mimepart_c9f288acf493f756a216830b29a39fc5";
charset=UTF-8"},{"name":"Content-Transfer-Encoding","value":"8bit"}],"commonHeaders":{"from":[""mydomain.com"
<[hidden email]>"],"date":"Wed, 06 Feb 2019 17:19:16
+0000","to":["[hidden email]"],"subject":"My Subject"}}}' );

#json -> find( 'complaint' ) -> find( 'complainedRecipients' ) -> first -> find( 'emailAddress' );




> On Feb 6, 2019, at 11:32 AM, Laurent G <[hidden email]> wrote:
>
> Hi,
>
> I've tried to extract email "[hidden email]" address but
> impossible using JSON on Lasso 8.6
> It works for "notificationType", but not for the rest of this string, any idea ?
>
> {"notificationType":"Complaint","complaint":{"complainedRecipients":[{"emailAddress":"[hidden email]"}],"timestamp":"2019-02-06T18:37:51.657Z","feedbackId":"00000000-49f532cf-d800-47db-80bd-22f4ff38e0e6-000000","userAgent":"Yahoo!-Mail-Feedback/2.0","complaintFeedbackType":"abuse","arrivalDate":"2019-02-06T17:19:18.000Z"},"mail":{"timestamp":"2019-02-06T17:19:16.000Z","source":"[hidden email]","sourceArn":"arn:aws:ses:us-east-1:914000004:identity/[hidden email]","sourceIp":"0.52.185.0","sendingAccountId":"914385015944","messageId":"01000168c3d228a9-b65c2745-72cc-000-a238-48e006f93650-000000","destination":["[hidden email]"],"headersTruncated":false,"headers":[{"name":"Received","value":"from
> email-smtp.us-east-1.amazonaws.com (s4.mydomain.com [0.0.0.0]) by
> email-smtp.amazonaws.com with SMTP (SimpleEmailService-4120689079) id
> NBJiqiQB3oQjfTBWKhfy for [hidden email]; Wed, 06 Feb 2019
> 17:19:16 +0000 (UTC)"},{"name":"MIME-Version","value":"1.0"},{"name":"To","value":"[hidden email]"},{"name":"From","value":"mydomain.com
> <[hidden email]>"},{"name":"Subject","value":"My
> subject"},{"name":"Date","value":"Wed, 06 Feb 2019 17:19:16
> +0000"},{"name":"Auto-Submitted","value":"auto-generated"},{"name":"Precedence","value":"list"},{"name":"Content-Type","value":"multipart/alternative;
> boundary="--==_mimepart_c9f288acf493f756a216830b29a39fc5";
> charset=UTF-8"},{"name":"Content-Transfer-Encoding","value":"8bit"}],"commonHeaders":{"from":[""mydomain.com"
> <[hidden email]>"],"date":"Wed, 06 Feb 2019 17:19:16
> +0000","to":["[hidden email]"],"subject":"My Subject"}}}
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>