Hello Ray,
Thanks for using Wazuh!
According to
our documentation in order to get Postfix working with Wazuh you need to set next piece of text into the file
/etc/postfix/main.cf:
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/ssl/certs/thawte_Primary_Root_CA.pem
smtp_use_tls = yes
NOTE: Make sure to set proper SMTP server and port in relayhost.
Then configure the email address and password:
echo [smtp.gmail.com]:587 USER...@gmail.com:PASSWORD > /etc/postfix/sasl_passwd postmap /etc/postfix/sasl_passwd
chmod 400 /etc/postfix/sasl_passwd
NOTE: Make sure to set proper SMTP server and port in "echo" command.
Secure the DB password:
chown root:root /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db
chmod 0600 /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db
And finally restart Postfix:
systemctl reload postfix
Once all steps were performed, you should be able to test this running:
Then in Wazuh Manager configuration file (/var/ossec/etc/ossec.conf) you need to set next setttings:
<global>
<email_notification>yes</email_notification>
<smtp_server>localhost</smtp_server>
</global>
Please notice that these settings already exists in the configuration file (almost at the top). Make sure to set them as recommended.
NOTE: I tested this configuration using both a Gmail and a Outlook account. Gmail didn't work but Outlook did without any problem.
Please let me know if you need further assistance!