Mgolfieri- Admin notification emails

Admin email notifications are mostly hot-changeable, they don't need any restart since they are handled by cronjobs on most cases, and settings are sourced at every run. For example:

Creating a local domain for system delivery

It is generally good practice to have a domain called as the zimbra server hostname itself. To find the zimbra hostname:

su - zimbra

If you don't have it already created (it is the default when installing zimbra, unless you change the default options in the installer menu), then create it in the Admin Console, or:

su - zimbra
zmprov cd `zmhostname`

MTA notifications

For any general SMTP-related notification, check:

zmlocalconfig smtp_destination

and if wrong, please change it via:

zmlocalconfig -e

For the AV notifications, check:

zmlocalconfig av_notify_user

and if wrong, please change it via:

zmlocalconfig -e

Backup reports

Regarding backup reports, check:

zimbra@zcs7-ga:~$ zmprov gacf zimbraBackupReportEmailRecipients
zimbra@zcs7-ga:~$ zmprov gs `zmhostname` zimbraBackupReportEmailRecipients
# name

In case they are misconfigured, you can change by first issuing:

zmprov mcf zimbraBackupReportEmailRecipients

Since server settings override global ones, check on every store node:

$ zmprov gs `zmhostname` zimbraBackupReportEmailRecipients

If the above will still report a wrong value, then:

$ zmprov ms `zmhostname` zimbraBackupReportEmailRecipients

Note that the value is multi-valued:

<attr id="459" name="zimbraBackupReportEmailRecipients" type="string" cardinality="multi" optionalIn="globalConfig,server" flags="serverInherited">
  <desc>Backup report email recipients</desc>

So if you want to add other email addresses, after setting the main one as per the instructions above, please do (note the plus sign, it's very important not to leave it out!):

$ zmprov mcf +zimbraBackupReportEmailRecipients

and if you need this to be done on this server only instead of changing it globally:

$ zmprov ms `zmhostname` +zimbraBackupReportEmailRecipients

Likewise, to remove an email address:

$ zmprov ms `zmhostname` -zimbraBackupReportEmailRecipients

Regular notifications scheduling

Check that the cronjobs are set, and at what time they trigger. Usually the following are the default settings:

zimbra@zcs7-ga:~$ crontab -l |grep report
0 1 * * 6 /opt/zimbra/bin/zmbackup -f -a  all --mail-report    
0 1 * * 0-5 /opt/zimbra/bin/zmbackup -i  --mail-report 
0 0 * * * /opt/zimbra/bin/zmbackup -del 1m --mail-report
0 23 * * 7 /opt/zimbra/libexec/zmdbintegrityreport -m
# Daily reports
30 23 * * * /opt/zimbra/libexec/zmdailyreport -m

According to the above times set, you can then check /var/log/zimbra.log accordingly to see if you find any error. You should see entries around this following line for example, coming from the server itself:

Nov 27 23:30:40 zcs7-ga postfix/qmgr[16654]: BF2B020832: from=<>, size=4138, nrcpt=1 (queue active)
Nov 27 23:30:44 zcs7-ga postfix/lmtp[24064]: 8D50320834: to=<>,[]:7025, delay=0.18, delays=0.02/0.02/0.01/0.13, dsn=2.1.5, status=sent (250 2.1.5 Delivery OK)

Troubleshooting the zmdailyreport body content

If you get the emails, but you don't get a proper body content for some reason, manually triggering the commands you see in the crontab without the -m/--mail-report option will produce the same email content on the standard output, this might be useful for troubleshooting:


As you can see, running the other commands seen in the crontab will trigger bigger operations (full/incremental backups, deletion, etc..) so pay extra attention to them should you need to run them for troubleshooting.

Changing the originating hostname

Pierre Chabredier from Reseaunance submitted us a workaround to workaround an issue with a not-so-elastic 3rd party SMTP relay not allowing emails to come from a certain hostname, and this could not be customized due to certain environmental constraints. This is the delivery failure notification being received: #< #5.0.0 smtp; 550-Verification failed for <> 
550-Unrouteable address 550 Sender verify failed> #SMTP#

This the 3rd party SMTP server that doesn't like the zimbra hostname appearing in the Received: from and other fields:

Received: from (LHLO
 ( by with LMTP; Thu, 21 Mar 2013
Message-Id: <>

To workaround this and have the domain name as the real sender domain for the zimbra user (not just the From: field) and make the 3rd party SMTP relay happy, edit the script /opt/zimbra/libexec/zmdailyreport so that you use another mail library “Net::SMTP” instead of “Mail::Mailer”. With that library, emails correctly appear to come from

The change should be so that:

sub sendEmailReport {
   my %arg = @_;

   my $data = $arg{data};    # @Report data for message body

   my $subject      = "Daily mail report for $arg{day}";
   my $from_address = getLocalConfig("smtp_source");
   my $to_address   = getLocalConfig("smtp_destination");
   my $smtphost     = getLdapConfigValue("zimbraSmtpHostname") || "localhost";

   warn("DEBUG: Sending daily report to $to_address via $smtphost\n")
     if ($Debug);

   eval {
       use Net::SMTP;
       my $smtp = Net::SMTP->new("$smtphost") or die $!;
       $smtp->mail( $from_address );
       $smtp->to( $to_address );
       $smtp->datasend("To: $to_address\n");
       $smtp->datasend("From: $from_address\n");
       $smtp->datasend("Subject: $subject\n");
       $smtp->datasend("\n");     # done with header
       $smtp->datasend($data);  # email body
       $smtp->quit();         # all done. message sent.

#       my $mailer = Mail::Mailer->new( "smtp", Server => $smtphost );
#       $mailer->open(
#           {
#               From    => $from_address,
#               To      => $to_address,
#               Subject => $subject,
#           }
#       );
#       print $mailer @$data;
#       $mailer->close();
   if ($@) {
       logError("Failed to email report using SMTP via '$smtphost': $@\n");
   else {
       warn("DEBUG: Email report sent to $to_address\n") if ($Debug);

Now you also need to fix the “Service“ and “Disk” notifications of Zimbra, therefore you need to change:



perlcode 0 sub dosmtp {   my %args = (@_);  print "SMTP notification: $args{MESSAGE}\n"; open (FOO, "|/opt/zimbra/postfix/sbin/sendmail -Am -t"); print FOO "To: $pwc\nFrom: $fr\nSubject: Service $args{SERVICE} $args{STATUS} on $args{HOST}\n\n$args{MESSAGE}\n"; close FOO; }
perlcode 0 sub dodisksmtp {   my %args = (@_);  print "SMTP notification: $args{MESSAGE}\n"; open (FOO, "|/opt/zimbra/postfix/sbin/sendmail -Am -t"); print FOO "To: $pwc\nFrom: $fr\nSubject: Disk $args{DISK} at $args{UTIL}\% on $args{HOST}\n\n$args{MESSAGE}\n"; close FOO; }


perlcode 0 sub dosmtp {   my %args = (@_);  print "SMTP notification: $args{MESSAGE}\n"; open (FOO, "|/opt/zimbra/postfix/sbin/sendmail -Am -t -f $fr"); print FOO "To: $pwc\nFrom: $fr\nSubject: Service $args{SERVICE} $args{STATUS} on $args{HOST}\n\n$args{MESSAGE}\n"; close FOO; }

perlcode 0 sub dodisksmtp {   my %args = (@_);  print "SMTP notification: $args{MESSAGE}\n"; open (FOO, "|/opt/zimbra/postfix/sbin/sendmail -Am -t -f $fr"); print FOO "To: $pwc\nFrom: $fr\nSubject: Disk $args{DISK} at $args{UTIL}\% on $args{HOST}\n\n$args{MESSAGE}\n"; close FOO; }

That is, you need to just add “-f $fr” at the end of the sendmail command. When done, you need to:

su - zimbra
zmswatchctl restart
Jump to: navigation, search