Error in sending Email

Hesaam

Verified User
Joined
Nov 29, 2022
Messages
33
  • Hi,
  • when I want to send Email from directAdmin I get the this error:


  • I disabled the csf, but I had the same problem.
  • port 25, 587 and 465 are open when csf is enabled.
  • I had sent Email to other Email services like Gmail and outlook but nothing happened.
  • My Server's Hostname in directAdmin (Admin -> Server Manager -> Administrator Settings -> Server Settings) is postrategy.co but in the error is "server-65-21-252-222.da.direct", maybe that's why. Really, why should it be different?
  • Thank you so much for your assistance.
  • 1.PNG

  • 2.PNG
 
Last edited:
It could be due to IPv6 settings in your config. Try adding:
disable_ipv6=true
to your /etc/exim.variables.conf.default or /etc/exim.variables.conf.custom
then restart exim.

That should force exim to use IPv4 assuming that is the source of your problem.
 
It could be due to IPv6 settings in your config. Try adding:
disable_ipv6=true
to your /etc/exim.variables.conf.default or /etc/exim.variables.conf.custom
then restart exim.

That should force exim to use IPv4 assuming that is the source of your problem.
Thanks a lot.
I disabled ipv6 in exim.variables.conf.default and exim.variables.conf files, and restart exim with this command:
" systemctl restart exim.service " but nothing happened.
Please help me.
Thanks
 
but in the error is "server-65-21-252-222.da.direct", maybe that's why. Really, why should it be different?
Have seen the same issue recently with somebody else, and with the same cause if I remember correctly.

You are causing some issues yourself.

You should never use mail as hostname. At this moment mail.postrategy.co is your hostname. Mail is reserved for mail.

So if I'm correct, you can fix like this.

1.) Change your hostname to a decent FQDN hostname, so not mail or www or whatever, use for example server.postrategy.co or something else.
2.) It is wise for some reasons (so not obligated but advised) to create this hostname in DNS via the DNS manager too
3.) Login via SSH and use this command to create a new certificate for your hostname
cd /usr/local/directadmin/scripts ./letsencrypt.sh request_single server.postrategy.co 4096
4.) Login into your control panel in Hetzner and create the correct rDNS/PTR record for your hostname.
At this moment it points to static.222.252.21.65.clients.your-server.de but that is not your hostname. Set it to your hostname.
If you want to keep using ipv6 then do this for both ipv4 and ipv6 ipadresses used for the hostname.
5.) Just to be sure you could reboot your server and see if things (like hostname) are as should be.
 
Have seen the same issue recently with somebody else, and with the same cause if I remember correctly.

You are causing some issues yourself.

You should never use mail as hostname. At this moment mail.postrategy.co is your hostname. Mail is reserved for mail.

So if I'm correct, you can fix like this.

1.) Change your hostname to a decent FQDN hostname, so not mail or www or whatever, use for example server.postrategy.co or something else.
2.) It is wise for some reasons (so not obligated but advised) to create this hostname in DNS via the DNS manager too
3.) Login via SSH and use this command to create a new certificate for your hostname
cd /usr/local/directadmin/scripts ./letsencrypt.sh request_single server.postrategy.co 4096
4.) Login into your control panel in Hetzner and create the correct rDNS/PTR record for your hostname.
At this moment it points to static.222.252.21.65.clients.your-server.de but that is not your hostname. Set it to your hostname.
If you want to keep using ipv6 then do this for both ipv4 and ipv6 ipadresses used for the hostname.
5.) Just to be sure you could reboot your server and see if things (like hostname) are as should be.
Thanks Richard.
At this moment my hostname is postrategy.co, not mail.postrategy.co .
My previous hostname was server.postrategy.co which caused the SSL of subdomains to be incorrect.
In fact, SSL was created, but it only was working for the main domain(postrategy.co), not for the subdomains and said "Your connection to this site is not secure" and "certificate is not valid".
It was showing that certificate was issued to: server.postrategy.co that is not for subdomains like api.postrategy.co:
"This server couldn't prove that it's api.postrategy.co; its security certificate is from server.postrategy.co. This may be caused by a misconfiguration or an attacker intercepting your connection."
For these reasons, I had to change the hostname to postrategy.co and got a new SSL certificate that works correctly even for subdomains.
( I think this is a bug for directadmin.)
let's move on, I changed the hostname for server.postrategy.co According to your suggestion but now I have new errors.
1. I can't go to the page "Email Accounts" in direct admin, it is showing this error:
2.JPG

2. When I want to go webmail manager from directadmin (Admin --> Extra Features --> Webmail:Roundcube) the new address (https://server.postrategy.co/roundcube) is opening in the new tab that is not reachable.

after changing the address "https://server.postrategy.co/roundcube" to "https://postrategy.co/roundcube" manually, the logging page of Roundcube Webmail is loading but only with admin Email account can login it, not for example with no-reply ([email protected]).

1673698419972.png
1673698508932.png


Regarding number 4:
I changed the reverse DNS to server.postrategy.co from my Hetzner dashboard.
I checked it from my windows, and it is ok.
1673699240695.png


I also updated Exim configuration files with ./build exim_conf and rewritet WEB server configuration files with ./build rewrite_confs .
***********************
With all these things,
1. I still can't send email.
2. I still can't login to Roundcube Webmail with other email accounts except admin account.
3. the https://server.postrategy.co/roundcube address is not reachable.
4. I don't know the reverse dns is correct?

Please help me.
 
Last edited:
At this moment my hostname is postrategy.co, not mail.postrategy.co .
That will also cause issues as this is a domain name and not a FQDN hostname.
I checked when loggin in to your mailserver and then I got mail.postrategy.co as answer and normally Exim takes over the hostname. So that's why I thought your hostname was mail.postrategy.co.

You missed point 2. You did not create a DNS entry for your hostname via the DNS manager.
So the reverse DNS is correct now, but an nslookup at server.postrategy.co will result to nothing, which is causing the roundcube issue.

To fix this, please create a seperate DNS record in DNS manager (so NO subdomain record!!! but seperate entry as if you would create a new domain) with server.postrategy.co als "domain name" and fill in the ip and nameservers.
Then that part should be fine and roundcube should start working again too if that is synced.

My previous hostname was server.postrategy.co which caused the SSL of subdomains to be incorrect.
Then that would be caused by some other issue, maybe because the domain was created differently, can't say now. You cuold have send in a ticket for this one.
Is api.postrategy.co really a subdomain? Because normally those are used for api calls, not for subdomains.
However, maybe that would be caused by hostname not being setup properly. Hard to say.

1.) We have to look at that if you fixed the rest.
2.) That should be fixed once you created the hostname record in DA DNS as described
3.) Same.
4.) If your hostname is now server.postrategy.co then the reverse DNS is correct at the moment.

After you fixed the above things, please recompile everything from mail, so like this as root via SSH:
Code:
cd /usr/local/directadmin/custombuild
./build update
./build exim
./build exim_conf
./build dovecot
./build dovecot_conf
./build roundcube
./build rewrite_confs

This should take care of things. Please let us know the results.
 
You created those automatically, you don't need those in DA, you best remove them.

First screenshot is good, the one which I liked. Only reverse did not need to be checked.
after creating in first screen shot, the second screenshot was added automatically.
1673711467971.png

although I had been written "server.postrategy.co" in "Domain Name:" in first screenshot, DA was added 222.252.21.65.in-addr.arpa as a domain name and when clicking on it, the second screenshot is showing.
1673711770658.png
1673711814441.png
 
Back
Top