##Postfix 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 for 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_passwdIn /etc/postfix/sender_relay, list addresses that must go through a relay.
@example.com in.mailjet.com
example@example.net in.mailjet.comIn /etc/postfix/sasl_passwd, provide credentials for each address listed in /etc/postfix/sender_relay.
@example.com apikey:secretkey
example@example.net apikey2:secretkey2Don'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
- Desktop email clients (Outlook, Apple Mail, Thunderbird)
- MTA & MDA (exim)
- Frameworks and Languages (Php, Java, Asp.net, Zend, CodeIgniter)
- Webmail (Gmail and Google Apps)
##Custom Headers
When using SMTP relay, you can use the following custom headers to specify how Mailjet will handle your message
###X-Mailjet-Campaign
This header value must be unique for all emails belonging to a specific campaign. This will regroup emails into only one line in your dashboard, and provide cool reports ! It can be an alpha-numeric value of your choice (space, dash and underscore are also accepted), of up to 255 characters in only one line.
###X-Mailjet-DeduplicateCampaign
In combination with X-Mailjet-Campaign, this boolean (true, yes, y, 1) indicates that you do not wish to send a message inside the campaign twice to the same recipient. In this case, we check that the recipient hasn’t been sent the message, or otherwise block any duplicate (only the first message goes through). Please note that this is based on the recipient's email address, it will not block a message sent to the same person on two different email addresses.
###X-MJ-CustomID
This custom value will help you track your message more easily.
###X-MJ-EventPayload
If you need more than an ID, no problem: insert a payload to your messages, using any format (XML, JSON, CSV…)
###X-Mailjet-TrackOpen
This boolean (0 or 1) indicates whether you want to activate or not the open tracking on the concerned message. This option overrides your tracking options set on your user account.
###X-Mailjet-TrackClick
This boolean (0 or 1) indicates whether you want to activate or not the click tracking on the concerned message. This option overrides your tracking options set on your user account.
###X-Mailjet-Prio
This header manages the different types of email by defining up to four priority levels. More information