Can't Send Email From Directadmin to the Gmail

burakdunal

Verified User
Joined
Aug 3, 2023
Messages
25
Hello everyone. I use vps on hostinger.

I installed the directadmin panel. I made ptr records for ip4 and ip6 with server-62-72-22-140.da.direct via Hostinger panel. I added a domain whose NS is in Cloudflare to my directadmin panel. I created email accounts. I added the dkim, dmarc and spf dns records to Cloudflare. I can get email from Gmail but my problem is that I can't send email to gmail. I can send it to Hotmail but it goes to spam folder.

I also set the server's hostname in Directadmin panel (server-62-72-22-140.da.direct)
I modified the /etc/hosts file for server's public ip address and hostname;
ip4
62.72.22.140 server-62-72-22-140.da.direct server-62-72-22-140

ip6
2a02:4780:c:9808::1 server-62-72-22-140.da.direct server-62-72-22-140

You can see there is no issue my dns records;

Also i did a MailAuth Analyzer via https://app.powerdmarc.com/ and no problem there either.

I can't understand this situation.
My ip addresses both (ip4 and ip6) not in blacklist on any rbl.

In Google case;
host gmail-smtp-in.l.google.com [2a00:1450:400c:c00::1a]
SMTP error from remote mail server after end of data:
550-5.7.28 [2a02:4780:c:9808::1 1] Our system has detected an unusual rate
550-5.7.28 of unsolicited mail originating from your IP address. To protect our
550-5.7.28 users from spam, mail sent from your IP address has been blocked.
550-5.7.28 Please visit
550-5.7.28 https://support.google.com/mail/?p=UnsolicitedIPError to review our
550 5.7.28 Bulk Email Senders Guidelines. ay39-20020a05600c1e2700b003fe300c408bsi1932037wmb.42 - gsmtp

In Hotmail case(Email delivered but goes to spam folder)
Can anyone help me?
Thanks.
 

Attachments

  • mailAuthAnalyzer.png
    mailAuthAnalyzer.png
    122.5 KB · Views: 7
All the big email providers have their own internal RBL that cannot be queried by the public. It sounds like your IP is not in the best of shape. You will need to contact all the email providers that are blocking you and plead your case to have them remove you from their RBL or to whitelist your IP until you can fix your reputation. I had to recently do that when I was forced to move data centers. They aren't always cooperative but that is all you can do, short of finding another IP address that is already clean and relaying your email through there.
 
All the big email providers have their own internal RBL that cannot be queried by the public. It sounds like your IP is not in the best of shape. You will need to contact all the email providers that are blocking you and plead your case to have them remove you from their RBL or to whitelist your IP until you can fix your reputation. I had to recently do that when I was forced to move data centers. They aren't always cooperative but that is all you can do, short of finding another IP address that is already clean and relaying your email through there.
I have an another vps on OVH Cloud. I use plesk on there. I don't have any problems with sending or receiving emails on there. I don't know... I will try rebuild my vps and install plesk panel for check the email send. If i can send email on plesk panel on same vps it means this is not an ip address problem. It means Directadmin problem. Am i right?
 
You could try that, it wouldn't hurt but based on what you posted so far, it is blocked at the IP level and changing the email server/control panel won't fix that. If it does go through, it doesn't necessarily mean it was Directadmin, the block could have just expired (assuming they aren't permanent). Assuming the SMTP server is configured correctly (hostname/dns/spf/dkim/dmarc/etc) there should be no difference at all what control panel is installed this is at the email/IP level, and I doubt that DirectAdmin or Plex would configure exim incorrectly by default. Also, I did look at the results of your mxtoolbox.com report and there are a few things you should really fix besides the one RBL you are listed on. They could be the reason your email isn't delivered properly.
 

Attachments

  • Screenshot 2023-08-03 at 9.12.39 AM.png
    Screenshot 2023-08-03 at 9.12.39 AM.png
    257.4 KB · Views: 8
I also set the server's hostname in Directadmin panel (server-62-72-22-140.da.direct)
Why you are using server-62-72-22-140.da.direct as hostname ?
There are several threads on this forum how to setup correctly an hostname, the way you are doing is not right
 
Yes, because i changed the dns record just now :) So you see errors right now. You can see the pic that i attacted on first post. There is no issue on dkim, dmarc or spf records. I don't have a custom configs on plesk or directadmin. I did a snapshot of vps with directadmin. I am install plesk right now, after my tests i will going back to the directadmin. And i'll update this topic.
 
Why you are using server-62-72-22-140.da.direct as hostname ?
There are several threads on this forum how to setup correctly an hostname, the way you are doing is not right
I have checked the forum. I founded https://forum.directadmin.com/threads/hostname-selection-during-install.67124/ this topic. And e few other topics. It was written that using this hostname, which was automatically created by DA during installation, would not be a problem, even more valid. Can you explain me please what is not right?
 
Can you explain me please what is not right?
It's in fact a subdomain of directadmin. It is done this way so users will be able to login via SSL from the start for example.
However, da.direct does not belong to you. Suppose DA goes down for some reason and just at this point you need to create a new ssl certificate for your host, then you can make it.
You can't make working SPF and DKIM records for it. Locally on your server yes, but they will not work as that ip does not belong to DA and the da.direct domain does not belong to you. For this to work they should be copied to the DA DNS which you can't. Maybe DA has some default SPF in place, but if you would add your ipv6 it might already become an issue.

Als long as you don't use php mail via scripts, only smtp mail, you might be able to keep working on it, provided you setup the rDNS/PTR to your hostname. For hobbyists this might be fine, for professional hosters, you should think twice about keeping that as hostname.

would not be a problem, even more valid.
Where did you read that, because it can't be more valid because you don't own the da.direct domain name. So at the very best it can be equal valid.

Maybe @Active8 also knows other arguments.

As for your question, he's right, you're ip has a bad reputation, changing to Plesk won't fix that.
Odd though about that unusual rate of mails. Or were there already loads of mails send to Gmail today?
 
It's in fact a subdomain of directadmin. It is done this way so users will be able to login via SSL from the start for example.
However, da.direct does not belong to you. Suppose DA goes down for some reason and just at this point you need to create a new ssl certificate for your host, then you can make it.
You can't make working SPF and DKIM records for it. Locally on your server yes, but they will not work as that ip does not belong to DA and the da.direct domain does not belong to you. For this to work they should be copied to the DA DNS which you can't. Maybe DA has some default SPF in place, but if you would add your ipv6 it might already become an issue.

Als long as you don't use php mail via scripts, only smtp mail, you might be able to keep working on it, provided you setup the rDNS/PTR to your hostname. For hobbyists this might be fine, for professional hosters, you should think twice about keeping that as hostname.


Where did you read that, because it can't be more valid because you don't own the da.direct domain name. So at the very best it can be equal valid.

Maybe @Active8 also knows other arguments.

As for your question, he's right, you're ip has a bad reputation, changing to Plesk won't fix that.
Odd though about that unusual rate of mails. Or were there already loads of mails send to Gmail today?
Hello Richard. First of all thanks for your reply.

I installed the Plesk on my Hostinger Vps. I used the hostname that plesk's generated. (kind-varahamihira.62-72-22-140.plesk.page)
I configured the hosts file and other things.
I did set the new dns records for mail;
mail A domain.com 62.72.22.140
MX @ mail.domain.com
spf record v=spf1 a mx a:kind-varahamihira.62-72-22-140.plesk.page ip4:62.72.22.140 ip6:2a02:4780:c:9808::1 ~all
And dkim and dmarc records.

According to mxtoolbox everything is fine. But same problem. I can't sent email to the gmail. I think the problem on ip address as your think.

I bought another vps from OVH an hour ago. I installing directadmin panel right now. Than i will check email send is working. Maybe i will need help the set hostname properly.
 
I installed Directadmin panel to my new vps on OVH. This time, DA didn't generate hostname for me. I don't understand the reason.
This time i use OVH's hostname that gaven me. (vps-8358c422.vps.ovh.net) But this hostname doesn't have ssl.

I have domains on cloudflare. Can you help me how i supposed to set hostname my vps?
 
first config dns record at cloudflare like "serv.hostname.com" point to your server IPAddress with grey-clouded

login to your server terminal with "root" access,

execute:
hostnamectl set-hostname serv.hostname.com

then login to directadmin panel:
Admin > Server Management > Admin settings


change hostname in their and save.

then...


execute: ( maybe it not needed )
da build exim_conf


after finish setting hostname, then ask your datacenter/vps provider to config PTR record to your hostname.
 
first config dns record at cloudflare like "serv.hostname.com" point to your server IPAddress with grey-clouded

login to your server terminal with "root" access,

execute:
hostnamectl set-hostname serv.hostname.com

then login to directadmin panel:
Admin > Server Management > Admin settings


change hostname in their and save.

then...


execute: ( maybe it not needed )
da build exim_conf


after finish setting hostname, then ask your datacenter/vps provider to config PTR record to your hostname.
Can i need add the domain to directadmin? As a admin domain?
 
first config dns record at cloudflare like "serv.hostname.com" point to your server IPAddress with grey-clouded

login to your server terminal with "root" access,

execute:
hostnamectl set-hostname serv.hostname.com

then login to directadmin panel:
Admin > Server Management > Admin settings


change hostname in their and save.

then...


execute: ( maybe it not needed )
da build exim_conf


after finish setting hostname, then ask your datacenter/vps provider to config PTR record to your hostname.
I did what you said. I can access the panel but without ssl. I can send mail but it goes to spam.
 
Can i need add the domain to directadmin? As a admin domain?
You can add any domain to admin as admin domain as you wish.

But do -not- use serv.hostname.com as admin domain. You can use hostname.com as domain under admin, no problem.

For serv.hostname.com login as admin, then go to DNS administration and create en entry there. It should contain hostname, ip and both nameservers wich are in use in DA.

After that, you can create an SSL certificate for your hostname via SSH.

Code:
cd /usr/local/directadmin/scripts
./letsencrypt.sh request_single serv.hostname.com 4096

Ofcourse change serv.hostname.com with your own real hostname.

As for mail going to spam, is that smtp mail and from which ip and domain name?
 
it's need to wait until your IP have trusted enought. Just make dkim, spf, PTR and have good population on your server. ( Do not send spam ).
Yes, this vps is new. Waiting can be beneficial. Dkim, spf, dmarc, ptr records are valid. But first i want to solve this hostname problem. After that I'll focus on spam issue.
 
You can add any domain to admin as admin domain as you wish.

But do -not- use serv.hostname.com as admin domain. You can use hostname.com as domain under admin, no problem.

For serv.hostname.com login as admin, then go to DNS administration and create en entry there. It should contain hostname, ip and both nameservers wich are in use in DA.

After that, you can create an SSL certificate for your hostname via SSH.

Code:
cd /usr/local/directadmin/scripts
./letsencrypt.sh request_single serv.hostname.com 4096

Ofcourse change serv.hostname.com with your own real hostname.

As for mail going to spam, is that smtp mail and from which ip and domain name?
Definitely. You mean don't add subdomain for admin domain. I will add my domain name to the panel as admin domain name.
I couldn't understand what you said;
"For serv.hostname.com login as admin, then go to DNS administration and create en entry there. It should contain hostname, ip and both nameservers wich are in use in DA."

Go to DNS Administration and create en entry for serv.domain.com for example;
serv.domain.com A x.x.x.x

But nameservers?
My domain use the Cloudflare's nameservers. Can you explain this for me?

By the way, the email sent to gmail as spam was sent via webmail. I also set up an e-mail account on the iphone and tried it from there. The email I sent from my phone was also in spam. I will focus on this issue after the hostname settings.
 
I want to use ovh-vps135-195.inadayapp.com for the server hostname. On cloudflare i added the DNS record for subdomain.
1691136667629.png

As you said, I added the domain itself as an admin domain from the panel. (inadayapp.com)

1691136871053.png

After that i added the subdomain's dns record to the DirectAdmin DNS Administration. But i said earlier, my domain's NS on Cloudflare.
1691136958352.png
 
Back
Top