Mail coming from localhost being blocked

elyday

Member
Apr 29, 2018
5
1
1
Germany
cPanel Access Level
Root Administrator
hello

I have the problem the email of the password forgotten function does not go out, because a blocking service blocks our IP address. I found out that the mail server uses the domain "localhost.localdomain" and the IP "127.0.0.1" as sender and not the correct domain and e-mail. I'm currently desperate as to how I can solve this. I am very happy about help.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,911
2,234
363
Hello @elyday,

Support for changing the "from" address in system notifications is not offered at this time, however I encourage you to vote and add feedback on the following feature request:

Send cPanel Notifications via Authenticated SMTP Connection

In the meantime, one potential workaround is to setup SPF and DKIM records for the server's hostname using the instructions from the following thread:

DKIM for main server hostname

Another potential workaround is to set the cPanel account's contact address to a local email address created under the account's domain name (e.g. [email protected]), and then setup a forwarder for the newly created email account to direct the notifications to the preferred remote email address (e.g. Gmail).

Thank you.
 

elyday

Member
Apr 29, 2018
5
1
1
Germany
cPanel Access Level
Root Administrator
Hey, thanks for the answer.
I tried to generate a dkim key for the hostname but i failed:

warn [dkim_keys_install] Cpanel::DnsUtils::_add_error: Empty dns zone server.hostname.tld
Cpanel::DnsUtils:563: Empty dns zone server.hostname.tld at /usr/local/cpanel/bin/dkim_keys_install line 27.

Now i dont know where i need to create a dns zone for the hostname.
I dont use the dns system of cpanel and dont want to use it, is this a problem?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,911
2,234
363
Now i dont know where i need to create a dns zone for the hostname.
Hello,

You can add the DNS zone using "WHM >> Add a DNS Zone". This will the script to generate the DKIM record, which you can then the TXT record for using "WHM >> Edit DNS Zone". At that point, you'd need to manually add that TXT record at the DNS hosting provider of the parent domain name associated with your server's hostname. Keep in mind that setting up a DKIM and SPF record for the server's hostname won't necessarily solve the issue you reported. It's only a viable workaround if it's the reason the remote mail server detected the message as SPAM.

Thank you.