How do I change the sendmail 'from' address and domain on the appliance emails?


All emails from the Unitrends appliance comes from a non-existent domain. This article will summarize how to change the domain, as well as, how to change the 'from' sender address in sendmail.


For 10.0+ you may be able to use the INI value.  If not, proceed to the detailed section.

Emails from the Unitrends appliance are being refused by the local email server since they come from a non-existent email domain.


For Appliance Versoin 10.0.0-1 and newer

Simply edit the master.ini file on the Unitrends appliance located at /usr/bp/bpinit/

vi /usr/bp/bpinit/master.ini

  ;[email protected]  ; Specify user to send reports as
Remove the comment symbol (the ';' semicolon) from in front of the line that begins with ReportFrom=  and change the email address to the one you want listed as the sender.
[email protected]
Save this file, then restart the sendmail services:  service sendmail restart

--This ONLY works for reports, not tests/sendmail directly --

To test report function after above change run the following
php /usr/bp/bin/genreports.php


STOP! You are done if your appliance is running 10.0.0-1 or newer.

Instructions below are only for systems older than release 10.x, or used for systems requiring more detailed steps:

For the appliance to send email from [email protected] instead of [email protected], your domain name must be configured in

To change the sender for all reports from a Unitrends appliance to a single sender, perform the following:

  • SSH into the appropriate appliance and navigate to /etc/mail
cd /etc/mail
  • Create a backup copy of your and files.
cp /root
  • ​We now have enable the genericstable feature for sendmail and compile our new configuration file.  You will need to add these lines to the file.  Also make sure the smart host that is defined is their relay server.  Once you rebuild the the DS record will be removed if the smart host is not defined.
FEATURE(`genericstable',`hash -o /etc/mail/genericstable.db')dnl 
  • ​ Added these directives to the end of the file just before the MAILER directives.  Original last 10 lines of the
[[email protected] mail]# tail -n 12
dnl #
dnl FEATURE(masquerade_entire_domain)dnl
dnl #
dnl MASQUERADE_DOMAIN(localhost)dnl
dnl MASQUERADE_DOMAIN(localhost.localdomain)dnl
dnl MASQUERADE_DOMAIN(mydomain.lan)dnl
dnl MAILER(cyrusv2)dnl
  • ​ After making the changes:
[[email protected] mail]# tail -n 12
dnl #
dnl MASQUERADE_DOMAIN(localhost)dnl
dnl MASQUERADE_DOMAIN(localhost.localdomain)dnl
dnl MASQUERADE_DOMAIN(mydomain.lan)dnl
FEATURE(`genericstable',`hash -o /etc/mail/genericstable.db')dnl
dnl MAILER(cyrusv2)dnl
define(`MAIL_HUB', `')dnl
define(`LOCAL_RELAY', `')dnl
  • ​ Now lets create the new configuration file:
[[email protected] mail]# m4 >
  • ​Create a /etc/mail/generics-domains file that is just a list of all the domains that should be inspected. Make sure the file includes the domain name used by the Unitrends appliance, which you can obtain using the command:
sendmail -bt -d0.1 </dev/null
  • ​Here is a sample  /etc/mail/generics-domains file:
[[email protected] mail]# cat /etc/mail/generics-domains
  • ​Create your /etc/mail/genericstable file. First sendmail searches the /etc/mail/generics-domains file for a list of domains to reverse map. It then looks at the /etc/mail/genericstable file for an individual email address from a matching domain. The format of the file is linux-username [email protected].  Here is an example:
[[email protected] mail]# cat /etc/mail/genericstable
root            [email protected].gov
reports         [email protected].gov
Failure.Report  [email protected].gov
Schedule.Report [email protected].gov
  • ​If Unitrends release 9.1.1 or earlier, fix the mail_report.php with this sed command
 [[email protected] mail]# sed -i 's/mail(\x27\x27, $subject,\x27\x27,$email);/mail(\x27\x27, $subject,\x27\x27,$email,"-f \x27$from\x27");/g' /usr/bp/bin/mail_report.php
  • Ensure that the domain you're sending from is defined as an alias for the appliance in /etc/hosts and host entry defined for the SMTP relay as your domain with a trailing period.
[[email protected] ~]# cat /etc/hosts      localhost.localdomain localhost UB
  • Ensure that the ReportFrom parameter is defined
[[email protected] ~]  bputil -p "Reports" "ReportFrom" "[email protected].com" /usr/bp/bpinit/master.ini
  • ​The last step is to restart sendmail
service sendmail restart
  • Verify emails are being sent with the proper "from" address. This can be done using telnet and some basic SMTP commands seen below in bold and verifying that you received the email.
[[email protected] ~]# telnet localhost 25
Connected to localhost.
Escape character is '^]'.
220 ESMTP Sendmail 8.14.4/8.14.4; Sat, 5 Aug 2017 11:06:20 -0500
EHLO localhost Hello localhost.localdomain [], pleased to meet you
250 HELP
MAIL FROM: [email protected].gov
250 2.1.0 [email protected].gov... Sender ok
RCPT TO: [email protected].com
250 2.1.5 [email protected].com... Recipient ok
354 Enter mail, end with "." on a line by itself
Test email
250 2.0.0 v75G6KrM031870 Message accepted for delivery
telnet> quit
Connection closed.


DNS and /etc/hosts must agree on the FQDN. There may be issues if there is an internal and an external domain name.

Many of the changes in this KB are made using the program "vi," for more information on how to use this please refer to this documentation

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Contact us