How to change the SMTP port number for email reports.
The SMTP port needs to be changed due to email server requirements, including local email servers, Gmail, etc.
- 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:
- Within the configuration file, locate the following lines:
# SMTP daemon options O DaemonPortOptions=Name=
- Add the following line below the above two lines:
O DaemonPortOptions=Port=587, Name=MSA, M=E alternately you can add or modify these lines define(`SMART_HOST',`smtp.gmail.com')
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.