SUMMARY
How to change the SMTP port number for email reports.
ISSUE
The SMTP port needs to be changed due to email server requirements, including local email servers, Gmail, etc.
RESOLUTION
- Connect to the appliance via SSH
- Make a backup copy of the sendmail configuration file:
cd /etc/mail/ cp sendmail.mc sendmail.mc.backup
- Edit the sendmail configuration file:
vi sendmail.mc
- Within the configuration file, locate the following line:
define(`SMART_HOST',`.....
- Add the following line below the SMART_HOST line:
define(`RELAY_MAILER_ARGS', `TCP $h 587')dnl
define(`ESMTP_MAILER_ARGS', `TCP $H 587')dnl Please write quit the file :wq! - then you have to M4 the file
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
- Restart the sendmail service:
service sendmail restart
- Send a test email:
mail <recipient email address> Subject: Testing Body: Hello world.
- Press Ctrl+D to send the test email.