Allow to send mail from domain with SPF record - google-apps

I have question concerning SPF records.
The website (eg www.example.com) of one of my clients has a contact form that sends mails to contact#example.com.
We only provide the hosting of the website so we do not manage email accounts, DNS records, etc .. only webspace. So my clients manages the DNS settings, nameservers, mail servers, etc..
The mails are sent using PHP but they are never received by contact#example.com
When I change contact#example.com to an email address outside the domein eg contact#test.com, I do receive the contact email.
My conclusion is that their mailserver blocks mails from our IP address because PHP sends mails to an email address that has the same domain but has another IP.
Also, my client uses Google Apps for email so the MX records on their DNS server point to Google.
How can I fix this issue? Does my client need to add an SPF record that accepts our IP address? If so, whats the correct SPF syntax for this?

If your the domain has SPF records defined then you need to add the address of the web server to the SPF records.
You can check the SPF records of the domain on this website: http://spf.myisp.ch
The best way would be to check the log files on the web server or on the server of the receiver to find out what the problem is.

Make sure cpanel does not have any MX records since you are not hosting the dns

Related

SPF through any relay

I'm using PHP mail() to send an email from my server to two different accounts, one which is my Gmail account, which SPF passes with, and one to an account hosted by my domain provider, which is then forwarded to my Gmail account. That causes SPF to fail because the originating IP is different.
But, there's no way to tell if the email address you send emails to is the recipient, or forwards them elsewhere. So is there any way to allow SPF to pass through any (unknown) relay?
It's unclear exactly what you mean here. Are you using arbitrary From addresses?
Generally, SPF control over email sources is handled in a few different ways:
Authorise your domain provider's servers to send from your domain (i.e. add them to your SPF record)
Hope that your hosting provider's mail servers support SRS, the Sender Rewriting Scheme, which they should
Allow any IP to be a source of email for your domain by adding +all to your SPF record (clearly a bad idea!)

Mailgun: '550 Requested action not taken error' when sending to certain domains

I am using mailgun to send mail and am receiving this error message:
550 Requested action not taken: mailbox unavailable invalid DNS MX or A/AAAA resource record
when I send mail to certain domains. An example of a problematic domain is web.de
Sending to other domains via mailgun works just fine and in fact I am able to send mail to the problematic domain just fine from my own account (gmail).
In terms of DNS records, Mailgun indicates that my domain has been verified using TXT DNS records.My MX records point to another email provider that I am using to receive e-mail.
In case anyone was following this, it turns out the solution is to add MX records in your DNS to identify the Mailgun server. These are the records you'll want to associate with the subdomain mg.yourdomain.com:
mxa.mailgun.org 10
mxb.mailgun.org 10
The idea is that certain email servers do an MX lookup on the domain of the sender of the email (in this case mg.yourdomain.com). If those MX records do not exist, the server will reject the mail.
Note: in my case I already had separate MX records associated with my base domain (yourdomain.com) which were pointed to a different email client (not mailgun) that I was using to receive mail. So I was initially confused as to how/why I needed to add others, and whether it was valid. It turns out it is indeed valid (and this case, necessary) to have separate MX records for separate subdomains.

Spam mails Joe-Job via Amazon AWS

since a few days our internal email info#ourdomain.com seems to go bananas and sends out emails to all sort of email addresses. Some of those emails bounce and we receive Mail Delivery Failed emails every minute.
Here is our setup:
Domain hosted at Germany's 1und1 provider
Nameserver configured on Amazon Route 53
MX server mx01.kundenserver.de and mx00.kundenserver.de
Rails application hosted on heroku
I called the support at 1und1 and they told me to set a SPF record which I did:
"v=spf1 a mx ~all"
after researching the topic via http://www.spf-record.de/
Unfortunately this did not resolve the problem.
Honestly I am cluesless now what to do to prevent this random email sending.
Our account could have been hacked but the password was already changed.
Any of your email account or script/code compromise can cause outgoing spam emails. If outgoing emails are originating from particular email account and you find large outgoing email account from particular email account, you should consider to reset the password of that email account immediately. Also, compromised email sending script/code can can cause outgoing spam.
If "from" email address on spam email is none of your existing account then "From" email address is getting authenticated from any of your existing email account for which you should inspect SMTP logs of mail server(you should have administrative access of mail server)
Mail server IP address should not be blacklisted,please check IP here :- http://mxtoolbox.com/blacklists.aspx
If IP address is blacklisted, you can request IP whitelist after you identify and fix the outgoing spam source as RBL keeps IP address blacklisted until they find the spamming activity relaxed.
SPF and PTR record should be correct so that email recipient server can trust the sender mail server.
Bounce back email and spam email header can help to identify the issue more preciously.
This happened to me before, I had a "refer a friend" feature on my website and someone use an automated script to send emails to a ton of people. My server wasn't comprised, it was just bad coding in the feature that I installed that allowed my mail server to send mail to different people on my behalf.
Since the email is coming from you, your SPF/DKIM will check out just fine.
So thing about all the points on your website that can send email and see if any of them can be compromised.
Also you'll want to do a blacklist scan, I use this service it does more then 200+ blacklist: https://www.unlocktheinbox.com/blacklist/bl/
Make sure you scan both your domain name and IP address. But before you take any action to remove yourself, you should wait 24 hours until after you fix the exploit on your system. Requesting removal and popping up again can get you permanently listed.

Sending emails from my domain with SendGrid

I have a question that I guess is not just related to SendGrid.
Say, I own the mydomain.com domain, and I want to be able to send emails from, for example, team#mydomain.com.
Right now, when I go and manage my domain, I can see that I have added some MX record values added there. By doing this, I am able to send email using Gmail.
However, with Sendgrid I find this a little bit more confusing. I have read through the documentation, but I fail to see what should I do. I am using NameCheap, and all it comes to my mind is the following:
If I want to use Sendgrid to send emails from my application (Ruby on Rails), will I still be able to access my Gmail account and send emails using the same address (team#mydomain.com)? Is it compatible to have both (Gmail and Sendgrid) configuration in my domain?
Why don't I need to add any MX records for SendGrid?
First and foremost, the MX records for your domain are used only to specify the hostnames of the servers to handle INCOMING mail for your domain - i.e. the MX records have nothing to do with the servers that are used to send outgoing mail. You can use both Gmail's outgoing mail servers and Sendgrid's outgoing mail servers (and any other outgoing SMTP servers for that matter) to send outgoing mail for you domain. The only caveat to this is if you have an SPF record setup for your domain, but you didn't mention one so I won't elaborate.
MX records, as stated previously, are for specifying a server that handles INCOMING emails. You can use Sendgrid to send outgoing emails together with an email account service like Gmail. With Gmail, you would both send and receive emails. With Sendgrid, you would only send emails.
the MX records for the domain would be specified as those for Gmail/Google. The trick is in correctly configuring the SPF records, which is a TXT type record in the domain name. In the SPF record, you would include both Gmail/Google info as well as Sendgrid info on the same line.
So, say you only used Gmail for sending and receiving email, your SPF record would look something like this:
v=spf1 include:_spf.google.com ~all
However, if you add another server from another service, say Sendgrid, in order to also send verified emails for that domain, the SPF would be altered to something like this:
v=spf1 include:_spf.google.com include:u826348.wl.sendgrid.net -all
In both of these examples, only the GMail/Google MX records would be added to the DNS records.

What should I use for SPF record of my domain?

I have example1.com hosted on host.example2.com. Typical cpanel scenario. And:
And example1.com is installed with Magento which sends many sorts of emails to the users from host.example2.com.
And I also set up example1.com with Google Apps with its MX entries as required by them.
Very typical. So I came up with this SPF record for example1.com:
v=spf1 a mx include:host.example2.com include:_spf.google.com -all
Is this correct?
It seems not because when I used the on-site contact form on example1.com to send a test visitor message (which was sent to my Google Apps email from host.example2.com), the email I received in Google Apps inbox was still with a 'via' field (via host.example2.com). I figure this means Google email takes this message to be not sent by example1.com ITSELF?
This record has been created since 2 days ago and the 'via' field was still present when example1.com tries to send a message from the server of host.example2.com.
If anyone could enlighten me on this that'd be really appreciated! Thanks!
The SPF record has nothing to do with the way the receiving server identifies the transmitting server.
The receiving server identifies the transmitting server by its IP address, a reverse DNS lookup on that IP address, and the HELO name it gives at the start of the mail session.
On the other hand SPF is used to determine if the transmitting server is authorized to use the envelope reverse-path address and HELO name.