Comment on page
Enabling Email Notifications
Get Email notifications with the completion status of backup jobs by pointing Zmanda to your SMTP server.
You must have an operational SMTP server as well as its credentials. Zmanda, itself, will not act as the SMTP server.
You will use the SMTP server information to configure the mailx/postfix tools in the following steps.
- 1.Install mailx package using yum or dnf
sudo dnf install mailx
- 2.Create a soft link to mailx from mail.
ln -s /bin/mailx /bin/mail
- 3.Update the /etc/mail.rc configuration as below:
//append the following line in mail.rc
//set smtp=smtp://smtp.server.tld:<port_number>
set smtp=smtp.office365.com:25
//tell mailx that it needs to authorise
set smtp-auth=login
set smtp-use-starttls
//set the user for SMTP
//set [email protected]
set [email protected] //user account
set [email protected] //user account
//set the password for authorization
set smtp-auth-password= <PASSWORD of user account>
set nss-config-dir=/etc/pki/nssdb/
set ssl-verify=ignore
- 4.Test to make sure that everything works as expected:
echo "Your message" | mail -s "Message Subject" [email protected]
- 1.Install the utility
apt-get install postfix mailutils
- 2.In /etc/postfix/main.cf, append the following lines. Use a text editor tool like vi or nano. eg. vi /etc/postfix/main.cf
relayhost = [smtp.office365.com]:25
mynetworks = 127.0.0.0/8
inet_interfaces = loopback-only
smtp_use_tls = yes
smtp_always_send_ehlo = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous
smtp_tls_security_level = encrypt
smtp_generic_maps = hash:/etc/postfix/generic
- 3.Configure the postfix SASL credentials by appending the following info within /etc/postfix/sasl_passwd:
[smtp.office365.com]:25 user@domainname:password
- 4.A Postfix lookup table must now be generated from the sasl_passwd text file by running the following commands.
postmap /etc/postfix/sasl_passwd
//Change permissions and ownership for this file
chown root:postfix /etc/postfix/sasl_passwd
chmod 640 /etc/postfix/sasl_passwd
- 5.Next, we need to configure generic file in order to be able to send emails as a valid user (this is required for Office365). vi or nano into /etc/postfix/generic and append the following info:
@hostname [email protected]
- 6.Save and exit the file and run the following commands.
chown root:root /etc/postfix/generic
chmod 0600 /etc/postfix/generic
postmap /etc/postfix/generic
- 7.Now Change alias root to your email address. Use vi or nano to make the following changes to /etc/aliases
- 8.Save and exit, and run the newaliases command for the changes to take effect.
newaliases
systemctl restart postfix.service
- 8.Send a test email using the command below:
echo "This is the body of the email" | mailx -s "This is the subject line" [email protected] -a "FROM: [email protected]"
Last modified 4mo ago