I received a question from my client about how to add an external email warning message in Zimbra when receiving an email from outside. He wants to configure like in Office 365. So, this is how I configure external email warning message in Zimbra.
I am using Zimbra 8.8.15 on CentOS 7 when writing this article.
Create disclaimer-external.conf file
su - zimbra vi /opt/zimbra/conf/disclaimer-external.conf
Fill it with the following lines
use strict;
$altermime='/opt/zimbra/common/bin/altermime';
@altermime_args_disclaimer = qw(--verbose --pretext=/opt/zimbra/data/altermime/_OPTION_.txt --pretext-html=/opt/zimbra/data/altermime/_OPTION_.html --force-for-bad-html);
$defang_maps_by_ccat{+CC_CATCHALL} = ['disclaimer'];
$allow_disclaimers = 1;
@local_domains_maps = (["."]);
@disclaimer_options_bysender_maps = ({
'.' => 'external_domains',
},);
1;
Create external_domains.html and external_domains.txt files
vi /opt/zimbra/data/altermime/external_domains.txt
Fill with the following lines
CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
vi /opt/zimbra/data/altermime/external_domains.html
Fill with the following lines
[code lang=’plain’]
[/code]
Open file amavisd.conf.in
vi /opt/zimbra/conf/amavisd.conf.in
Add the following line above 1; at the end (before the last line)
include_config_files('/opt/zimbra/conf/disclaimer-external.conf');
Save and restart Amavis
zmamavisdctl restart
Below is an example when receiving email from outside/external


NOTE:
1. If you enable the disclaimer in Zimbra by following the Zimbra Wiki: Domain_level_disclaimer_support, your disclaimer text will be put before the message (–pretext). When the default is after the message
2. Please make sure the amavis service is running
Update 2 Dec 2020
If you want to skip adding an external warning for specific domains, create empty files and add to the configuration
Create empty text and html files
touch /opt/zimbra/data/altermime/local_domains.txt touch /opt/zimbra/data/altermime/local_domains.html
Then add local domains in disclaimer_options_bysender_maps and restart Amavis
@disclaimer_options_bysender_maps = ({
'example.com' => 'local_domains',
'.' => 'external_domains',
Update 30 Jun 2021
if DKIM not signed for outgoing message, please try the guide below
Open amavisd.conf.in
vi /opt/zimbra/conf/amavisd.conf.in
put comment (#) on this line “%%uncomment SERVICE:opendkim%% forward_method => ‘smtp:[%%zimbraLocalBindAddress%%]:10030′”. So that like below
## %%uncomment SERVICE:opendkim%% forward_method => 'smtp:[%%zimbraLocalBindAddress%%]:10030',
Save and restart Amavis
zmamavisdctl restart
Ref: How to Add External Email Warning Message – Prevent Email Spoofing in Office 365
Good luck 🙂
How to do this in ZCS 10.1
Hi,
The guidelines are the same