Follow the guide below to configure Sendmail to use SocketLabs as the Smart Host and Internet Mail Relay
- Login to your server via SSH
- Sudo to superuser
- Navigate to your Sendmail configuration directory. This config file is typically found at /etc/mail. We recommend making backups of each configuration file before making changes.
mv sendmail.mc sendmail_backup.mc
- Edit Sendmail configuration file /etc/mail/sendmail.mc using a file editor such as ‘nano’ to add the below code after #dnl define('SMART_HOST', 'smtp.your.provider')dnl.
define('RELAY_MAILER_ARGS', 'TCP $h 2525')dnl
Port 587 and 25 can also be used instead of 2525, if necessary.
- To add authorization credentials, edit the file ‘/etc/mail/authinfo’ using your editor and add the following line, replacing ‘SocketLabs_SMTPusername’ and ‘SocketLabs_SMTPpassword’ with your SMTP credentials provided in the Control Panel of your SocketLabs server.
AuthInfo:smtp.socketlabs.com U:SocketLabs_SMTPusername" "P:SocketLabs_SMTPpassword"
- Update your configuration files
m4 sendmail.mc > sendmail.cf
makemap hash authinfo < authinfo
- Restart the Sendmail service
service sendmail restart