Aspegic
Verified User
- Joined
- Aug 4, 2005
- Messages
- 282
Because my provider (Google) is blocking connections to external port 25, I cannot send email the normal way with Exim. So I had no choice but to choose a third-party mail provider. I chose Sendgrid.
I have spend almost a day and a half now trying to get this to work.
I do not understand where it is going wrong.
I started with this:
That didn't work. I tried a zillion different variations. I read all different suggetions I could find searching the net. Not very much information is available b.t.w.. Most is for other control panels.
I downloaded the 3 files from the help.directadmin.com link.
This is what I have in: exim.authenticators.post.conf:
I tried several different alternatives here, with the domain name instead of "apikey", with and without spaces around "apikey" and the key itself. With and without "hide". It all made no difference.
(Don't worry, the key is fake of course.)
This is what I have in: exim.routers.pre.conf
Tried some alternatives here I found in other webpages, for example to use "byname" and puting the route_list between quotes. It all did not matter.
This is what I have in: exim.transports.pre.conf
Tried several different things here as well. With and without a port number (587). With and without hosts = but that did not make a difference either.
I am at a loss. WHAT are the correct settings for these 3 files? Or are there any other files I need to edit maybe? I made sure that the owner/group/permissions are the same as of exim.conf, so that should be correct.
If you want to know what error message I receive? Several different ones.
all depending on which combination of settings I was trying. At one time I did not get an error message, but still no email was delivered. But in most cases the test mails just end up in the mail queue and eventually get frozen.
The domain has been verified in Sendgrid.
The proper CNAME records have been added to the DNS zone of my domain.
A certificate has been created using Letsencrypt and is valid for the domain.
SOLVED: for the solution see the settings in post #3 below.
I have spend almost a day and a half now trying to get this to work.
I do not understand where it is going wrong.
I started with this:
That didn't work. I tried a zillion different variations. I read all different suggetions I could find searching the net. Not very much information is available b.t.w.. Most is for other control panels.
I downloaded the 3 files from the help.directadmin.com link.
This is what I have in: exim.authenticators.post.conf:
auth_login:
driver = plaintext
public_name = LOGIN
client_send = : apikey : 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
I tried several different alternatives here, with the domain name instead of "apikey", with and without spaces around "apikey" and the key itself. With and without "hide". It all made no difference.
(Don't worry, the key is fake of course.)
This is what I have in: exim.routers.pre.conf
smart_route:
driver = manualroute
domains = ! +local_domains
ignore_target_hosts = 127.0.0.0/8
condition = "${perl{check_limits}}"
#use remote_smtp only if you do not need smtp-auth.
#transport = remote_smtp
#use auth_relay if you do need to set the remote smtpauth
transport = auth_relay
route_list = * smtp.sendgrid.net::587
no_more
Tried some alternatives here I found in other webpages, for example to use "byname" and puting the route_list between quotes. It all did not matter.
This is what I have in: exim.transports.pre.conf
auth_relay:
driver = smtp
hosts_require_auth = $host_address
hosts_require_tls = $host_address
headers_add = "${if def:authenticated_id{X-Authenticated-Id: ${authenticated_id}}}"
interface = <; ${if exists{/etc/virtual/domainips}{${lookup{$sender_address_domain}lsearch*{/etc/virtual/domainips}}}}
helo_data = ${if exists{/etc/virtual/helo_data}{${lookup{$sending_ip_address}iplsearch{/etc/virtual/helo_data}{$value}{$primary_hostname}}}{$primary_hostname}}
hosts_try_chunking =
hosts_try_fastopen =
.include_if_exists /etc/exim.dkim.conf
Tried several different things here as well. With and without a port number (587). With and without hosts = but that did not make a difference either.
I am at a loss. WHAT are the correct settings for these 3 files? Or are there any other files I need to edit maybe? I made sure that the owner/group/permissions are the same as of exim.conf, so that should be correct.
If you want to know what error message I receive? Several different ones.
authentication required but authentication attempt(s) failed
535 Authentication failed: The provided authorization grant is invalid, expired, or revoked
535 Authentication failed: Bad username / password
all depending on which combination of settings I was trying. At one time I did not get an error message, but still no email was delivered. But in most cases the test mails just end up in the mail queue and eventually get frozen.
The domain has been verified in Sendgrid.
The proper CNAME records have been added to the DNS zone of my domain.
A certificate has been created using Letsencrypt and is valid for the domain.
SOLVED: for the solution see the settings in post #3 below.
Last edited: