How to setup an email address for sending only? - amazon-web-services

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.

Related

Sendy External SMTP Bounce Handler

Sendy will not track bounced email address when sending emails via any SMTP server. It only works when if you hook it with AWS SES.
As I'm using SMTP which is hosted on a Linux server along with IMAP, POP3.
I sent thousands of mail using that SMTP and Sendy is not counting Bounced addresses while I checked my mailbox and there was thousands of undelivered mail.
Is there any way to make it count for Sendy SMTP?
I saw this image in Google, Don't know how to make it.
The image you found does not appear to be part of Sendy -- it appears to be from this third party product. It's not entirely clear.
What it seems to do is connect to your mailbox (the one you showed, with the bounces) using the POP3 mail fetching protocol... and read those bounce messages.
The web site seems to imply that this vendor wants access to your server and will install their products for you, which seems like a very dubious practice, so proceed with caution.

"Read" Emails with Django

Currently sending emails with Django, and was wondering if there was any way to periodically check my inbox with Django (or ideally somehow alert the server upon receipt of a new email), and have Django extract the message and save it in the database.
You could use an email service such as SendMail or Mandrill (latter definitely has free accounts, former may have).
Each of these services provide inbound email support via webhooks. You provide them an endpoint to hit (make sure to use HTTPS) and when they receive an email to an address you have registered they will send the data via HTTP POST to you.
It is then just a simple case of storing this data to the database. There are a number of 3rd party packages that can help you with this:
http://djrill.readthedocs.org/en/v1.4/usage/webhooks/
https://github.com/yunojuno/django-inbound-email
https://github.com/jpadilla/mandrill-inbound-python
https://github.com/michaelhelmick/python-mailsnake
Although it's rather simple to roll your own should need be.

How would I know that email has been sent or not via SendGrid in Django

I am working on django and sending emails to multiple users at once. in the given scenario it only tells me that if it has sent or not.
I want to display the report of same page that how many emails has sent to user successfully and how many not. more if i want to get details why email has failed to sent.
How would i do such things via SENDGRID APIs.
There are two options that I know of:
Connect to SendGrid Event Webhooks and start parsing events for every email to flag ones that were not sent. I believe you can configure SendGrid to only send certain events, so if you're interested in bounces you don't need to worry about handling all events.
The second option is to use a service like sendwithus which will connect to your SendGrid account on your behalf and track all bounces/opens/clicks for you and provide a simpler API/UI to view the data. I believe they do this via SendGrid's webhooks, so it's effectively the same solution but written for you.
Happy to elaborate on either, I've used both before.

How to track how many times an email was opened in amazon SES through API?

How will i track how many times email sent through Amazon SES was opened ?Is there any API i will need to consider?I figured out the complain and bounce myself and i figured out we can associate SES with SNS but i need the click rate too.Please assist.
You can't. SES, like any Internet mail sending system, has no idea whether a message is ever opened. It can't even be certain a message was delivered. People who want to know when a message is opened embed image links (often to invisible images) and track how often those images are fetched from their web server.
And even that doesn't work for users who configure their email program to not fetch images.
Amazon Introduces click and open tracking a few months back -
https://aws.amazon.com/blogs/ses/open-and-click-tracking-have-arrived/
Hope this helps.
You can do that using SendGrid. Is not 100% accurate but it's something :)
Sendgrid will post you a JSON message for all the mailing events (open, delivered, bounced, spam).

cfmail, google mail and reply to

I am having problems with google mail with a coldfusion webform, when the form gets sent the reply address is always myemail#myemail.com (substituted). Is this a google mail thing or is there a fix?
<cfmail
from = "#email#"
To = "myemail#myemail.com"
failto="#email#"
server="smtp.gmail.com"
replyto="#email#"
port="465"
useSSL="true"
username="myemail#myemail.com"
password="*****"
Subject = "Confirmation Form"
>
<cfmailparam name="Reply-To" value="#email#">
I don't believe Google Mail allows you to send mail from an address not tied to the account.
I would suggest, regardless of the SMTP server you use, using a real address tied to that domain for the "from" attribute. Set the reply-to and on-behalf-of (I think I got that right) headers to the email of the person "sending" the message.
I will give you one warning about sending lots of automated mail through Google. I was working on a project, and was told to use Google mail to send out a large amount of email. After about a day, they stopped sending out any mail on that account.... but accepted the mail. That is, their SMTP server told CF that the mail had been accepted, then trashed it instead of sending. I'd strongly suggest running your own SMTP server if you send more than a couple dozen emails a day.
I can't remember about personal accounts, but sending mail through Google Apps definitely allows customized Reply To, and this works with replyto attribute of cfmail -- without cfmailparam. Possibly it is the way to handle this problem.