Overview
In this article, we will explore how to set up a Smarthost SMTP relay with Webuzo. Here, we’ll demonstrate the configuration using the SMTP2GO relay host as an example. However, you can adapt these steps to set up any SMTP relay by referring to the provided example.
Set Up smarthost SMTP Relay
1. Go to Webuzo Admin Panel > Email > Mail Settings.
2. Select the custom code option from the Exim Configuration Manager.
3. From the Section Header dropdown, select 'begin authenticators', and from the Rule dropdown, select 'dovecot_login'. Enter the Auth code provided in the SMTP provider's documentation, then click the 'Add Custom Code' button to save.
4. Select the 'begin routers' from the Dropdown List, add router code provided in the SMTP provider's documentation and click on the 'Add Custom Code' button to save the code.
5. Select the 'begin transports' from the Dropdown List, add transport code provided in the SMTP provider's documentation and click on the 'Add Custom Code' button to save the code.
For SMTP2GO, you can refer to the below configuration
1. Add code in the authenticators section.
smtp2go_login:
driver = plaintext
public_name = LOGIN
#specify your smtp2go SMTP username and password below
hide client_send = : smtp_username : smtp_password
2. Add below code in the routers section.
send_via_smtp2go:
driver = manualroute
domains = ! +local_domains
transport = smtp2go_smtp
route_list = * mail.smtp2go.com
host_find_failed = defer
no_more
3. Add below code in the transport section.
smtp2go_smtp:
driver = smtp
port = 25
hosts = mail.smtp2go.com
hosts_require_auth = <; $host_address
message_linelength_limit = 99999999
For MailChannels, you can refer to the below configuration
1. Add code in the authenticators section.
mailchannels_login:
driver = plaintext
public_name = LOGIN
#specify your mailchannels SMTP username and password below
client_send = : smtp_username : smtp_password
2. Add below code in the routers section.
send_via_mailchannels:
driver = manualroute
domains = ! +local_domains
transport = mailchannels_smtp
hosts_randomize = true
route_list = * smtp.mailchannels.net::25 randomize byname
host_find_failed = defer
no_more
3. Add below code in the transport section.
mailchannels_smtp:
driver = smtp
hosts_require_auth = *
hosts_require_tls = *
tls_tempfail_tryclear = true
headers_add = X-AuthUser: ${if match {$authenticated_id}{.*@.*}\
{$authenticated_id} {${if match {$authenticated_id}{.+}\
{$authenticated_id@$primary_hostname}{$authenticated_id}}}}
dkim_domain = $sender_address_domain
dkim_selector = default
dkim_canon = relaxed
dkim_private_key = /var/webuzo-data/mail/dkim/private/${perl{untaint}{${dkim_domain}}}
You can find your SMTP credentials on the MailChannels Dashboard under Account > SMTP Passwords. Click the eye icon to see your username and password..
For turboSMTP, you can refer to the below configuration
1. Add code in the authenticators section.
turbosmtp_login:
driver = plaintext
public_name = LOGIN
#specify your turbosmtp account username and password below
client_send = : smtp_username : smtp_password
2. Add below code in the routers section.
send_via_turbosmtp:
driver = manualroute
domains = ! +local_domains
transport = turbosmtp_smtp
route_list = "* pro.turbo-smtp.com::587 byname"
host_find_failed = defer
no_more
3. Add below code in the transport section.
turbosmtp_smtp:
driver = smtp
hosts = pro.turbo-smtp.com
hosts_require_auth = <; $host_address
hosts_require_tls = <; $host_address
For SendGrid, you can refer to the below configuration
1. Add code in the authenticators section.
sendgrid_login:
driver = plaintext
public_name = LOGIN
#specify your sendgrid apikey below
client_send = : apikey : your_apikey
2. Add below code in the routers section.
send_via_sendgrid:
driver = manualroute
domains = ! +local_domains
transport = sendgrid_smtp
route_list = "* smtp.sendgrid.net::587 byname"
host_find_failed = defer
no_more
3. Add below code in the transport section.
sendgrid_smtp:
driver = smtp
hosts = smtp.sendgrid.net
hosts_require_auth = <; $host_address
hosts_require_tls = <; $host_address
For mailrelay, you can refer to the below configuration
1. Add code in the authenticators section.
mailrelay_login:
driver = plaintext
public_name = LOGIN
#specify your mailrelay's smtp username and password below
client_send = : smtp_username : smtp_password
2. Add below code in the routers section.
send_via_mailrelay:
driver = manualroute
domains = ! +local_domains
transport = mailrelay_smtp
route_list = * smtp1.s.ipzmarketing.com byname
3. Add below code in the transport section.
mailrelay_smtp:
driver = smtp
hosts = smtp1.s.ipzmarketing.com
hosts_require_auth = <; $host_address
hosts_require_tls = <; $host_address
You can find your SMTP settings on the under Settings > SMTP settings.
Please note that to use Mailrelay's SMTP, you need to configure Mailrelay's provided SPF and DKIM records for all domains. Otherwise, you won't be able to enable the SMTP option.