sSMTP - Simple SMTP
sSMTP es MTA simple para enviar correos desde una computadora a un concentrador de correos (servidor SMTP). sSMTP es sencillo y liviano, no requiere daemons o nada acaparando CPU, únicamente sSMTP. A diferencia de Exim4, sSMTP no recibe correo, expande alias o maneja colas.
Instalación
Al instalar sSMTP se eliminará Exim del equipo. Si no desea esto considere configurar Exim para que envíe correos según desee. Para instalar sSMTP ejecute lo siguiente:
aptitude install ssmtp
Configurando sSMTP
El archivo de configuración principal de sSMTP se ubica en /etc/ssmtp/ssmtp.conf
Este es un archivo de configuración de ejemplo generado por el autor original de este Wiki (en inglés) /etc/ssmtp/ssmtp.conf:
# # Config file for sSMTP sendmail # # The person who gets all mail for userids < 1000 # Make this empty to disable rewriting. root=yourmail@mail.com # The place where the mail goes. The actual machine name is required no # MX records are consulted. Commonly mailhosts are named mail.domain.com mailhub=smtp.yourmail.com # Where will the mail seem to come from? rewriteDomain= # The full hostname hostname=yourserver.example.com # Are users allowed to set their own From: address? # YES - Allow the user to specify their own From: address # NO - Use the system generated From: address FromLineOverride=YES # Username and password for Google's Gmail servers # From addresses are settled by Mutt's rc file, so # with this setup one can still achieve multi-user SMTP AuthUser=username@gmail.com AuthPass=password #### VERY IMPORTANT !!! If other people have access to this computer # Your GMAIL Password is left unencrypted in this file # so make sure you have a strong root password, and make sure # you change the permissions of this file to be 640: # chown root:mail /etc/ssmtp/ssmtp.conf # chmod 640 /etc/ssmtp/ssmtp.conf # # add your user to the group mail # usermod -G mail <yourUserName> # quit all your sessions # login again # send a test mail: # user@yourmachine ~ $ ssmtp "testing ssmtp setup" yourMail@gmail.com
Usar sSMTP con Gmail
Usar sSMTP con Gmail es simple, debe cambiar algunas opciones, añadir encripción TLS y cambiar el puerto del servidor de Google al 587.
UseTLS=YES UseSTARTTLS=YES AuthMethod=LOGIN mailhub=smtp.gmail.com:587
Eso es todo. Ahora sólo indique a su MUA que ejecute /usr/sbin/ssmtp para la salida de correos.
El paramétro ?AuthMethod=LOGIN permite trabajar mejor con los dominios y Google