Problem sending email with exim

chris0147

Well-Known Member
Aug 28, 2015
118
3
68
London
cPanel Access Level
Root Administrator
Hi all,

I need your help. I am currently using exim software that come with cpanel but I am not happy with using exim software because the email goes to spam folder. I have got another server where I have postfix software installed as my email goes to inbox. There are something wrong with exim software that did not set up correctly.

I have pointed the IP in the rDNS with the matched domain. I have configured in the helo, mailips and mail reverse dns and I have also set up dkim, dmarc and spf1 in the dns, but the email still goes to spam. I wonder why and if I do miss something?

If I have miss something, then I want to know what files I need to look at to configure it correct so my email would go inbox?

If I have not miss anything, then I wonder if cpanel would support postfix if I remove the exim software?

Thank you.
 
Last edited:

chris0147

Well-Known Member
Aug 28, 2015
118
3
68
London
cPanel Access Level
Root Administrator
Seriously, did you not read my post?

I have ALREADY pointed the IP in the rDNS with the matched domain. I have configured in the helo, mailips and mail reverse dns and I have also set up dkim, dmarc and spf1 in the dns, but the email still goes to spam.

The IP are new and it have never been used so there are something wrong with my exim software which it need to be look at?
 

rpvw

Well-Known Member
Jul 18, 2013
1,100
477
113
UK
cPanel Access Level
Root Administrator
Seriously, did you not read my post?
Seriously ....yes I did read your post !

You have said you have configured everything, but we have no way of knowing if you have configured everything CORRECTLY

The best advice I have is to check your settings using the guide I pointed you to, and make use of resources like MX Lookup Tool - Check your DNS MX Records online - MxToolbox to establish where your problem might be.

Of course, you can always claim the software is at fault, which is always convenient, and would certainly confuse all the server operators whose mail doesn't end up in the spam box......

Sorry for bothering to try to help ! I am sure that the cPanel staff will be eager to assist you here on Monday (or you should open a support ticket if you can't wait).
 

chris0147

Well-Known Member
Aug 28, 2015
118
3
68
London
cPanel Access Level
Root Administrator
Seriously ....yes I did read your post !

You have said you have configured everything, but we have no way of knowing if you have configured everything CORRECTLY

The best advice I have is to check your settings using the guide I pointed you to, and make use of resources like MX Lookup Tool - Check your DNS MX Records online - MxToolbox to establish where your problem might be.

Of course, you can always claim the software is at fault, which is always convenient, and would certainly confuse all the server operators whose mail doesn't end up in the spam box......

Sorry for bothering to try to help ! I am sure that the cPanel staff will be eager to assist you here on Monday (or you should open a support ticket if you can't wait).

Oh right, sorry I thought you did not read my post correctly as I thought you was a troll.

Anyway, I have looking into mxtoolbox and I have found there is no problems with dkim, dmarc, spf1 and rdns, but I have found one problem with smtp "SMTP Banner Check Reverse DNS does not match SMTP Banner". Do you know why I get this and how I can resolve it?

Secondly, I sent an email to mail-tester I have found 2 problems. I have had two spf1 in my dns records so I got it removed and I found there is a problem with the header which I believe this is maybe why my email got in spam.
Code:
Received: from [::1] (port=39054 helo=gateway1) by gateway1.mydomain.com with esmtpa (Exim 4.91) (envelope-from <[email protected]>) id 1gVi9R-0001Gg-Gn for [email protected]; Sat, 08 Dec 2018 19:20:33 +0000

The last time I sent an email which it got inbox it was on 21st August.

Here is the old header:
Code:
Received: from [xxx.xxx.xxx.123] (port=49788 helo=xxx.xxx.xxx.123) by server.mydomain.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from <[email protected]>) id 1fsFFG-0000Ky-Tk for [email protected]; Tue, 21 Aug 2018 23:35:26 +0100
Do you know why I have got "Received: from [::1]" without any information?

I think I have turned it off or modify on somewhere in the whm or ssh so I need to take a look into it to find out why and where the problem is coming from.

If you know where I need to look at and what I need to make the change, then please let me know so hopefully I will be able to resolve it.
 
Last edited by a moderator:

rpvw

Well-Known Member
Jul 18, 2013
1,100
477
113
UK
cPanel Access Level
Root Administrator
  • Like
Reactions: cPanelLauren

chris0147

Well-Known Member
Aug 28, 2015
118
3
68
London
cPanel Access Level
Root Administrator
::1 is the same as 127.0.0.1 or localhost

Check out the post from @cPanelMichael here SOLVED - Reverse DNS does not match SMTP Banner

Gotta love a Troll o_O :(
Yeah but it need to be fitting because when I used gmail to send an email it still show ::1 so it need to be fitting. I did not had ::1 in the past so something is not right.

As for the reverse DNS does not match SMTP Banner, what I can see @cPanelMichael's post, do I need to enable or disable for the "Introduce a delay into the SMTP transaction for unknown hosts and messages detected as spam."??
 

rpvw

Well-Known Member
Jul 18, 2013
1,100
477
113
UK
cPanel Access Level
Root Administrator
I have just run some tests for you by sending various test mails to my Gmail account from a variety of sources.

I suspect you are using webmail or a script on your server to send the test message to your Gmail account.

The Horde webmail messages I sent to my Gmail account contained
Code:
Received: from [::1] (port=36656 helo=server.name) by.....
which would make sense, as the message was sent from Horde on localhost.

All the test messages I sent from webmail to Gmail with the ::1 in them, were received into the Gmail inbox with no problems.

One other resource I often use to diagnose email issues is the G Suit Toolbox
G Suite toolbox

Messageheader
Check MX: Check MX and SPF Records.

If you were sending your test emails from a contact form or mailer script on your website, I strongly recommend that you use authenticated SMTP to make a connection to an actual email account on your server and use that to send the messages though.

Personally, I disable the SMTP transaction delay in the exim configuration, it seems to provoke all sorts of delivery issues from some services when enabled (and it should stop any false triggers from mail testing utilities).

Hope this helps
 
  • Like
Reactions: cPanelLauren

chris0147

Well-Known Member
Aug 28, 2015
118
3
68
London
cPanel Access Level
Root Administrator
I have just run some tests for you by sending various test mails to my Gmail account from a variety of sources.

I suspect you are using webmail or a script on your server to send the test message to your Gmail account.

The Horde webmail messages I sent to my Gmail account contained
Code:
Received: from [::1] (port=36656 helo=server.name) by.....
which would make sense, as the message was sent from Horde on localhost.

All the test messages I sent from webmail to Gmail with the ::1 in them, were received into the Gmail inbox with no problems.

One other resource I often use to diagnose email issues is the G Suit Toolbox
G Suite toolbox

Messageheader
Check MX: Check MX and SPF Records.

If you were sending your test emails from a contact form or mailer script on your website, I strongly recommend that you use authenticated SMTP to make a connection to an actual email account on your server and use that to send the messages though.

Personally, I disable the SMTP transaction delay in the exim configuration, it seems to provoke all sorts of delivery issues from some services when enabled (and it should stop any false triggers from mail testing utilities).

Hope this helps
Thank you for letting me to know.

This is very weird because when I sent the email to gmail with the ::1 header, it goes to spam. My domain and IP are not on the blacklisted at all. I sent the email from webmail used a software called roundcude which I getting the ::1. When you sent the email from your gmail via smtp connection, did you get the ::1 header or not?

If not then I need to look at this to find out why I am getting the ::1 header when I send from gmail. I would like you to help me to go through it to find out what the problem is and what changes I need to make so hopefully it will fix the issues.

As I have found the issue with the mxtoolbox, everything is fine but the smtp banner does not match with the smtp banner. I dont know why I am getting this as I have already pointed the IP to the domain and I have added the domain in the rDNS but i still getting the same issue.

I have checked with SMTP transaction delay in the exim configuration, they are disable. Now I need to find something else what settings are enable and disable and what other settings are on and off.

Can you please check on your domains and ips in the exim configuration that if the send mail from ip setting are off and both outgoing for the smtp helo and outgoing SMTP connections are both on?

If they are off and both are on then I need to look for something else. I dont have the smtp connection on my server because I have pointed the mail to a different server IP that I have installed the postfix. So I want to change it back to old settings and then add the smtp513 and pop3 in the DNS to allow me to connect to another server that I have postfix installed so I could use it to send the email using with the same domain name but with a different email address, but I have got no idea how I could do this. Do you know how?
 

rpvw

Well-Known Member
Jul 18, 2013
1,100
477
113
UK
cPanel Access Level
Root Administrator
Both Horde and Roundcube return values of localhost when sending mail from your server - this is expected as they are the same IP as the mailserver.

When you sent the email from your gmail via smtp connection, did you get the ::1 header or not?
No, if I send via an authenticated SMTP session from my PC, eg My home PC >> via an email account on my server >> a Gmail address - it shows the address as being my local public IP address (NOT the server address) - again, entirely as expected.

If your Reverse DNS does not match the SMTP Banner - you might find help in this thread SOLVED - Easy FIX your SMTP banner, SMTP greeting and Reverse DNS for Dedicated IPs

Can you please check on your domains and ips in the exim configuration that if the send mail from ip setting are off and both outgoing for the smtp helo and outgoing SMTP connections are both on?
The settings I use are as follows:
  • Send mail from the account’s IP address OFF default
  • Reference /etc/mailhelo for custom outgoing SMTP HELO OFF default
  • Reference /etc/mailips for custom IP on outgoing SMTP connections OFF default
So I want to change it back to old settings and then add the smtp513 and pop3 in the DNS to allow me to connect to another server that I have postfix installed so I could use it to send the email using with the same domain name but with a different email address, but I have got no idea how I could do this. Do you know how?
You will probably need to use the smarthost options - this thread might help Remote email server configuration
 
  • Like
Reactions: cPanelLauren

chris0147

Well-Known Member
Aug 28, 2015
118
3
68
London
cPanel Access Level
Root Administrator
Both Horde and Roundcube return values of localhost when sending mail from your server - this is expected as they are the same IP as the mailserver.

No, if I send via an authenticated SMTP session from my PC, eg My home PC >> via an email account on my server >> a Gmail address - it shows the address as being my local public IP address (NOT the server address) - again, entirely as expected.

If your Reverse DNS does not match the SMTP Banner - you might find help in this thread SOLVED - Easy FIX your SMTP banner, SMTP greeting and Reverse DNS for Dedicated IPs

The settings I use are as follows:
  • Send mail from the account’s IP address OFF default
  • Reference /etc/mailhelo for custom outgoing SMTP HELO OFF default
  • Reference /etc/mailips for custom IP on outgoing SMTP connections OFF default
You will probably need to use the smarthost options - this thread might help Remote email server configuration

Oh right, well mine still show ::1 when I sent the email from gmail. It's weird because it is supposed to show the public ip but it didn't.

I have looking into the thread of the link you sent me, have you been changed the configuration in the /etc/exim.conf just like this?

Code:
message_id_header_domain = $smtp_active_hostname
smtp_active_hostname = ${lookup{$interface_address}lsearch{/etc/mail_reverse_dns}{$value}{$primary_hostname}}
smtp_banner = ${smtp_active_hostname} ESMTP Exim ${version_number}

I have already tried this:

Code:
Send mail from account’s dedicated IP address: OFF
Reference /etc/mailhelo for outgoing SMTP HELO: ON
Reference /etc/mailips for outgoing SMTP connections: ON

And this:

Code:
Send mail from account’s dedicated IP address: OFF
Reference /etc/mailhelo for outgoing SMTP HELO: OFF
Reference /etc/mailips for outgoing SMTP connections: OFF

It is still the same and I have also tried to modified on /etc/mailhelo and /etc/mail_reverse_dns but it is still the same so I dont really know what to do.

Can you please check on your "Enable Sender Rewriting Scheme (SRS) Support" and " SMTP Restrictions" if they both are enabled or disabled?

As for hostname, I use gateway1.mydomain.com and my smtp is smtp513.mydomain.com so do I need to change the hostname to match it?

And also I have found the issue in the mxtoolbox, the domain is not matching because the other domain are display that pointed to the IP which it show like this:

Code:
Connecting to 216.xxx.xxx.xxxx

220 mail.mydomain1.com ESMTP Exim 4.91 [656 ms]
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,304
363
Houston
Hi @chris0147

The only items that are really relevant for outbound mail being marked as spam are the following:

1. A valid PTR that resolves the IP address mail is being sent from (i.e., any IP addresses on the server) to the hostname of the server.

The one and only exception to this in my personal opinion is when you're dedicating an IP to all of your accounts but this is a complicated process and really not necessary.

2. SPF which includes the domain's MX, the IP of the server as well as the IP mail will be sent from.

3. Valid DKIM record, cPanel will autogenerate this in cPanel>>Email>>Authentication if DNS is hosted on the cPanel server.

Your MTA exim has nothing to do with whether or not your mail is marked as spam, in fact, if you're 110% sure you've configured these three items correctly I would suggest contacting Google's postmaster for information on why they're flagging your mail as spam. They use their own proprietary methodology for spam checking and we have no way to know beyond those three items why they're seeing it as spam.

I'd definitely do this before getting into complicated customizations/workarounds - configuration shouldn't be difficult. I have my own cPanel servers that use minimal customizations to exim (really I don't have any) but I have the above 3 items configured and I have no issues with my mail being flagged as spam.

Furthermore, I want to thank you @rpvw for your awesome assistance in this thread!!