Prerequisites
Step 1: Edit the Postfix Configuration
Step 2: Apply and Reload Configuration
Optimizations, Resources and Best Practices
Prerequisites
Step 1: Edit the Postfix Configuration
1. Access the Zimbra server:
- Log in to your Zimbra server as the root user or a user with appropriate permissions
2. Open the Postfix Configuration File:
- Open the
main.cf
configuration file located in/opt/zimbra/conf/
sudo nano /opt/zimbra/conf/main.cf
3. Modify the smtpd_sender_restrictions
Directive:
- Add the
check_sender_access
directive to include the custom header. You will need to specify a file that contains the access control information. Add the following line to themain.cf
file:
smtpd_sender_restrictions = check_sender_access hash:/opt/zimbra/conf/custom_header
4. Create the Custom Header File:
- Create the
custom_header
file that will include theX-AuthUser
header definition:
sudo nano /opt/zimbra/conf/custom_header
5. Add the Header Rule:
- Add the following line to the
custom_header
file:
PREPEND X-AuthUser: ${authenticated_user}
6. Compile the Hash Database:
- Postfix requires the hash database to be compiled from the text file. Run the following command to create the hash database:
sudo postmap /opt/zimbra/conf/custom_header
Step 2: Apply and Reload Configuration
1. Restart Zimbra MTA:
- Restart the Zimbra MTA service to apply the changes:
sudo /opt/zimbra/libexec/zmmtactl restart
2. Verify the Custom Header:
- Send a test email from a Zimbra user account.
- Check the headers of the received email to verify that the
X-AuthUser
header is present and correctly populated. - Use your Host Console > Outbound > LogSearch to view your transactional log. The senderId (sid=) header should now contain your
${authenticated_user}
value, in the third field.
Optimizations, Resources and Best Practices
Comments
Article is closed for comments.