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.
sudo su
cd /etc/mail
  • Edit Sendmail configuration file /etc/mail/ using a file editor such as ‘nano’ to add the below code after #dnl define('SMART_HOST', 'smtp.your.provider')dnl.


define('SMART_HOST', '')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.
nano authinfo
/etc/mail/authinfo U:SocketLabs_SMTPusername" "P:SocketLabs_SMTPpassword"
  • Update your configuration files
cd /etc/mail
m4 >
makemap hash authinfo < authinfo
  • Restart the Sendmail service
/etc/init.d/sendmail restart


service sendmail restart