Change the SMTP Port Number for Email Reports

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

  1. Connect to the appliance via SSH
  2. Make a backup copy of the sendmail configuration file:
    cd /etc/mail/
    cp sendmail.mc sendmail.mc.backup
  3. Edit the sendmail configuration file:
    vi sendmail.mc
  4. Within the configuration file, locate the following lines:
    # SMTP daemon options
    O DaemonPortOptions=Name=
  5. 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!
    
  6. then you have to M4 the file
     m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
  7. Restart the sendmail service:
    service sendmail restart
  8. Send a test email:
    mail <recipient email address>
    Subject: Testing
    Body: Hello world.
  9. Press Ctrl+D to send the test email.

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