Skip to content
Last updated

To route your emails through Mailjet’s SMTP server you will only have to modify your SMTP settings using our hostname, port and your SMTP credentials.

SMTP hostname

Mailjet’s host name is in-v3.mailjet.com.

SMTP Ports

Here’s the list of ports that Mailjet is supporting:

PortTLSSSL
25OptionalNo
80OptionalNo
465NoYes
587/588OptionalNo
2525OptionalNo

Read our blogpost for details on the supported SMTP ports.

SMTP Credentials

Access your Mailjet account and go to the [SMTP section(https://app.mailjet.com/account/relay) to find your SMTP credentials.

Poatfix Installation

You can configure your Postfix to send via in.mailjet.com relay, depending on the sender, by following these steps:

In this example, all outgoing emails are sent directly to Mail eXchangers (MX), except when From is *@example.com or example@example.net, which are going through Mailjet.

Caution: for Postfix, a sender is not the From: but the sender envelope passed to sendmail (in the 5th mail() argument: -fexample@example.com or in PHP config php.ini : sendmail_path = /path/to/sendmail -t -i -fexample@example.com).

In /etc/postfix/main.cf (remove relayhost).

smtp_sender_dependent_authentication = yes
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

In /etc/postfix/sender_relay, list addresses that must go through a relay.

@example.com in.mailjet.com
example@example.net in.mailjet.com

In /etc/postfix/saslpasswd, provide credentials for each address listed in /etc/postfix/senderrelay.

@example.com apikey:secretkey
example@example.net apikey2:secretkey2

Don't forget the following commands.

cd /etc/postfix
chmod 600 sasl_passwd
chown root:root sasl_passwd
postmap sasl_passwd sender_relay
postfix reload

Other Configurations