DKIM signatures to Rails application using Amazon SES - ruby-on-rails

We're using the ActionMailer with SMTP as our delivery method and Amazon SES as our outgoing mail provider.
We want to sign the emails with DKIM.
How can we do that?
Thanks

I haven't used DomainKeys Identified Mail (DKIM) via ActionMailer with Amazon SES myself yet, but here's how I'd approach it:
Review Authenticating Email with DKIM and take note of the closing note specifically:
Note
If you are using the Amazon SES SMTP interface to send email, and
your client software automatically performs DKIM signing, you should
check to ensure that your client does not sign any of the headers
listed above. We recommend that you check the documentation for your
software to find out exactly what headers are signed with DKIM.
Checkout John Hawthorn's DKIM signing library (see his Introducing the dkim gem as well); section Usage With Rails shows how to sign all ActionMailer deliveries:
# Configure dkim globally (see above)
Dkim::domain = 'example.com'
Dkim::selector = 'mail'
Dkim::private_key = open('private.pem').read
# UPDATE [John Hawthorn]: SES developer guide recommends against signing these
Dkim::signable_headers = Dkim::DefaultHeaders - \
%w{Message-ID Resent-Message-ID Date Return-Path Bounces-To}
# This will sign all ActionMailer deliveries
ActionMailer::Base.register_interceptor('Dkim::Interceptor')
Update
John Hawthorn has updated the code fragment with the required SES exceptions (see respectively commented line above), confirming that his apparently excellent dkim gem is indeed
If the mentioned SES/DKIM header exception requirements can be met by the dkim gem,this looks like a remarkable easy way to achieve your goal - thanks John!

You can use the dkim project to do that for you :
https://github.com/jhawthorn/dkim

You can take it completely out of your source code and let SES do the DKIM signing for you. Works great.
https://aws.amazon.com/blogs/aws/simple-email-service-easy-domainkeys-identified-mail-support/

Related

Can i send and receive emails using ActionMailer in development env.?

I am trying to design a email confirmation but not able to receive emails in my gmail account. Can anyone help ?
one-step confirmation in gmail does not work;
you must enable 2-step gmail verification and enable app password;
dotenv doesn't load the passwords to production - you have to feed heroku in CLI heroku config:set var1=value1, etc. or at the link https://dashboard.heroku.com/apps/<your_application>/settings (this last tip does not apply to development).
For a specific trouble, please:
a) detail the code and error; or
b) make available your public repository in github.

How to configure Mailgun to be used with Sign in with Apple and Apple's relay service?

I have verified my domain as mentioned in the Apple Docs but I am still unable to send emails to apple relay addresses.
I have also added the sender email id from the Mailgun logs (postmaster#mail.mydomain.com) to the verified addresses.
But no luck.
SendGrid (https://sendgrid.com/docs/ui/account-and-settings/configuring-sign-in-with-apple/) gives you one email address to be added to Apple Dashboard but I don't see a similar solution for MailGun.
If anyone has faced a similar scenario, please share how you overcame the issue.
make sure your mailgun subdomain is verified. If your server is at example.com and your mailgun sending domain is sender.example.com you need to add the file you download from https://developer.apple.com/account/resources/services/configure to your host on https://sender.example.com/.well-known/apple-developer-domain-association.txt after this verification is successful you will see a green tick and mailgun emails to *#privaterelay.appleid.com which are registered against your developer account should be delivered.

Configure Jenkins to send gmail: What am I missing?

Trying to have Jenkins send an email to a Gmail account upon every build. I get:
Failed to send out e-mail
com.sun.mail.smtp.SMTPSendFailedException: 530-5.5.1 Authentication Required. Learn more at
530 5.5.1 https://support.google.com/mail/?p=WantAuthError 9sm5733284oij.25 - gsm
Here's what I tried so far:
Made the gmail account accept emails from less secure apps
Generated an application password from gmail and used it in my Jenkins configuration - got the same error with and without the app password
Looked at at least a dozen answers (yeah) and all the screens showing the Jenkins gmail config look the same as mine
telnet smpt.gmail.com 465 responds as connected
My Jenkins install is localhost using this URL: http://192.168.0.1:8080/
My system admin email address exists and is entered in Jenkins
I've tried filling in the section on Extended E-mail notification and removing the entries - no difference
Turned off Windows Defender, thinking, just maybe???
Also tried to configure Outlook/Hotmail using those smpt parms but that gave different errors
Don't know if this matters but I have that 'It appears that your reverse proxy set up is broken' and I don't recall setting up a reverse proxy!
Any help would be greatly appreciated!
Set up Jenkins email notification as shown below:
To resolve this, create & use app passwords with 2-step verification turned on.
A less secure method is to allow less secure apps without 2-step verification.

Sending email with AWS SES without custom domain

I would like to send email from a Rails 5.1 app with AWS SES through smtp, but without using a custom domain (it's ok if users receive emails with an address from aws). But when searching through AWS documentation or google, I can only find instructions to use custom domains.
Is it possible? And if yes, what email address (mail FROM) should be used to replace the placeholder in config/initializers/devise.rb:
config.mailer_sender = 'please-change-me-at-config-initializers-devise#example.com'
?
You don't need to have a custom domain, but you do need to have at least an email address you can verify following the procedure outlined in https://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-email-addresses.html
AWS doesn't have "default" email addresses to use for sending mails. Note also, that SES require you to handle bounces and such.

Mandrill Inbound email- setting up Sending Domains with an app hosted on Heroku

I am trying to learn the ins and outs of Mandrill, so I created a test app that has no functionality except creating users, signing them in and out, and clicking on a link that sends the user an e-mail through ActionMailer.
So far all of this works fine. I have configured Mandrill to send e-mail in both development and production (Heroku). What I'm trying to do now is configure it to receive e-mails sent from users and do stuff with them. My problem is that I'm not sure what to add as my mail domain in the Sending Domains section of my Mandrill account page.
I've done this before with an app on Heroku using Mailgun. Mailgun gave me a Mailgun subdomain to use for user testing off the bat (app12345678.mailgun.org). I was able to send mail to postmaster#app12345678.mailgun.org and it worked perfectly. With Mandrill it's proven a bit more difficult.
Mandrill doesn't seem to provide a Mandrill subdomain to start with. I suppose my question is: is it at all possible to get a Mandrill subdomain for testing like the one Mailgun provides? If not, how can I go about user testing inbound e-mail with Mandrill if I don't currently own my own custom domain? What can I use as the Sending Domain?
it's not currently possible to use Mandrill's inbound email routing unless you have a domain/subdomain to work with. We don't provide a testing subdomain to use for inbound routing.
Any domains you actually send from in Mandrill will be added to the Sending Domains page. You don't have to manually enter any domains there, since we'll detect any that you use and show them there automatically. If you want to set up SPF and DKIM for your sending domain, you can manually add it in order to validate the records have been added correctly.
If you have other questions specific to your account, our support team is also happy to help if you want to get in touch via the Support button in your account.

Resources