disable email link on Slack so that it stays as a string? - amazon-web-services

I'm working on a chatbot for Slack in AWS Lex, and I need it to collect an email address. While testing in Lex, it works fine because any email address remains as a string. But when it's hooked up to Slack, email address gets converted to mailto:youremail#domain.com format, so Lex fails to recognize it as a valid email address.
Is there any workaround to disable this functionality in Slack?

You can either do the pre-processing of the text received and extract the email address before passing it onto Lex.
Or if you are using Slack api's for sending messages then you can try to set the parse=none to disable the message formatting done by Slack. Message Formatting Api.

You will probably need to write a function to extract the email address from the returned Slack message - check out errbot's sanitize_uris function, which does exactly this.
A similar question

Related

Is there any way to capture body of out of office notifications when using amazon ses?

I work on an app that uses amazon ses to send email and we cannot figure out how to capture bounce messages (SES treats out of office as a bounce) in a useful way - useful meaning that I can capture the text of the out of office message and use the headers to connect it back to the email we sent that it is related to. I need to capture the text so that I can display the out of office message to users if they want to take action based on the info.
SNS topic notifications don't give you any of the email text. SES email feedback forwarding captures the text but overwrites our replyTo header which means I can't connect it back to anything. The only success I've had is using the "From" header like a replyTo, but this makes for an unattractive and suspicious looking address.
I assume this is possible, but am struggling to find much on the topic which makes me think I'm using the wrong language to look for an answer. Any insight is much appreciated!

How to setup an email address for sending only?

My main goal is to setup an email address for my server to use for sending emails only.
I did some research, and it looked like Amazon Simple Email Server and/or Amazon Workmail could provide me with what I needed. I've gotten as far as setting up SES and Workmail so that I can set my server to be able to send emails. However, I saw that once the Workmail inbox is full (50GB), the account would be unable to send emails. Given that this is going to be used by the server and not a human, I didn't want the inbox to get filled with auto replies, spam, or failed to send messages, and then be unable to send emails. So, I went looking for a way to either:
A) prevent emails from being received and stored in the inbox
B) a rule I could setup to delete anything that didn't match the company domain
C) be able to read the inbox and delete email messages using the AWS CLI, and I'd setup my own script to manage how and what was deleted when
So far I haven't had any luck.
Again, I'm not particular how I achieve the goal, but I do preferably need to find a way to have an email address for a server to use exclusively for sending messages. I worry that if I leave it to employees to remember to login and clear the inbox, someone will forget, and then the server will stop sending emails.
Any direction or advice would be greatly appreciated.
I'm not well versed in email protocols; could I setup the address to return a bounce back always, and that would prevent it from receiving emails into it's inbox?
How are you generating these emails? If you are generating them programmatically (via an app/script), you may not need to set up a server. If you just route the outgoing mail through your app to SNS, the emails will be valid, however, there will be no "inbox" for incoming mail and they will just be dumped. This way you don't have to actually worry about an inbox getting full as it will just drop anything coming in.
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email.html
In order to receive emails though SNS, you have to go through the setup linked above, but if you do not set this up, then emails will just bounce. At least, that is how I have been doing it.

Failed to send direct email message via aws Pinpoint

I am trying to send email message to a specific email address via the aws pinpoint. My from email address is verified. However, whenever I try to send the email it gives me an error "Failed to submit email message to ". I don't understand where am I going wrong with this.
#Krishna gave the right clue, however to be precise, all of the following must be true:
Your From email address is verified in Amazon Pinpoint/SES.
Either your To email address(es) is verified, OR you have requested Sending Limit Increase specifically for Amazon Pinpoint, not just SES.
In my case it was problem no. 2, I have increased my sending limit for SES but not Pinpoint yet. Amazon treats them somewhat differently, however the error message it gave me was totally undecipherable:
Message not sent: We weren't able to send your email message to someemail#gmail.com. Request Id 982 : Failed to send message.
Specifically, check the Pinpoint project's right sidebar here:
By default Pinpoint provides an sandbox environment.
In order to send emails you need to white-list your from email address as well. ( i.e. got to SES and verify the from email id as well)
You should them be able to send emails via Pinpoint.
The receiver should acknowledge to terms and condition that AWS can send automated emails.

Testing Mailgun batch sending with gmail '+' aliases

I'm currently trying to integrate Mailgun to send mails in batch. To test the batch sending, I decided to use a list of 10 email aliases to my own address, using a "+" alias.
For example, I'd use a list like this:
myaddress+1#gmail.com
myaddress+2#gmail.com
myaddress+3#gmail.com
etc.
To call mailgun, I'm only using a POST http call, reproducing the curl example from the Mailgun documentation.
The problem is that when I use aliases, I only receive the email once, on a random alias (e.g. myaddress+3#gmail.com). In Mailgun's logs, all the 10 emails appear as delivered.
Is this problem coming from Gmail which would filter similar mails arriving at once ? Has anyone encountered this type of problem before ?
When I add a different address (not an alias), the latter seems to receive the email correctly, but I'd like to understand why the email couldn't be sent several times to the same address.

Get and Send messages through amazon api

My company is working with the amazon MWS api, and we are receiving a lot of messages from the customers about their orders.
Is there any way to get these messages using the web services and reply to them?
As #joshubrown pointed out correctly, there currently is no API to get customer messages or send replies. You can, however set up a separate mail account for that purpose, which (depending on your own server architecture) gives you a whole set of protocols like POP3, IMAP, SMTP or even MAPI. Regular emails sent to the "scrambled" customer email addresses will be relayed to the consumer and will shown up as replies in your Seller Central.
No, there isn't a public API for that.
How I was planning to do this (in the absence of an API) was to set up the email account (that would receive the emails from customers) such that it pipes the email content into a script. The script would then write the content to the database (or do whatever you want with it).
I'm using qmail for mail, and if you edit the .qmail file within an email account's folder you can set where to pipe the email content eg
| php /pathtoscript/emailHandlingScript.php
Other email systems will have a different syntax for this.
Then in your PHP code (if you're using PHP), you can grab the content from the stdin stream:
$fh = fopen('php://stdin')
I'll probably use PHP's mailparse functions (eg mailparse_msg_parse_file, mailparse_msg_get_part etc) to properly extract the data from the stream.
As #Hazzit points out, when you reply to the anonymised email address (eg qwugwquigduwqgiqwdgiuwqdg#amazon.co.uk), Amazon will pass it on to the customer.
I created users on my account, redirected mails and made a script to read and reply.