Exim 4.69 con Gmail

Vamos a configurar nuestro servidor Exim 4.69 con Gmail, la configuración es bastante sencilla, y nos permitirá enviar emails sin que sean considerados SPAM.

En primer lugar instalamos exim4:

#apt-get install exim4

Una vez instalado editamos el fichero /etc/exim4/passwd.client

Pegamos las siguientes líneas:

gmail-smtp.l.google.com:MiUserGmail@MiDominioGmail.com:MiClaveGmail
*.google.com:MiUserGmail@MiDominioGmail.com:MiClaveGmail
smtp.gmail.com:MiUserGmail@MiDominioGmail.com:MiClaveGmail

Guardamos y nos aseguramos que tiene los permisos correctos:

ls -l /etc/exim4/passwd.client
-rw-r----- 1 root Debian-exim 343 2008-10-19 19:35 /etc/exim4/passwd.client

Vamos a editar el fichero /etc/exim4/conf.d/transport/30_exim4-config_remote_smtp_smarthost:
Debajo de la línea hosts_try_auth he añadido port=587, os pego el fichero para que veáis donde lo he pegado:

remote_smtp_smarthost:
  debug_print = "T: remote_smtp_smarthost for $local_part@$domain"
  driver = smtp
  hosts_try_auth = <; ${if exists{CONFDIR/passwd.client} \
        {\
        ${lookup{$host}nwildlsearch{CONFDIR/passwd.client}{$host_address}}\
        }\
        {} \
      }
      port=587
.ifdef REMOTE_SMTP_SMARTHOST_HOSTS_AVOID_TLS
  hosts_avoid_tls = REMOTE_SMTP_SMARTHOST_HOSTS_AVOID_TLS
.endif
.ifdef REMOTE_SMTP_HEADERS_REWRITE
  headers_rewrite = REMOTE_SMTP_HEADERS_REWRITE
.endif
.ifdef REMOTE_SMTP_RETURN_PATH
  return_path = REMOTE_SMTP_RETURN_PATH
.endif
.ifdef REMOTE_SMTP_HELO_FROM_DNS
  helo_data=REMOTE_SMTP_HELO_DATA
.endif

Ahora nos queda ejecutar el configurador para exim4:

dpkg-reconfigure exim4-config
  • En el tipo de servidor ponemos mail sent by smarthost; received via SMTP or fetchmail .
  • System mail name: linvx.org
  • IP-addresses to listen on for incoming SMTP connections: 127.0.0.1
  • Other destinations for which mail is accepted: vacio, no ponemos nada
  • Machines to relay mail for: vacio, no ponemos nada
  • IP address or host name of the outgoing smarthost: smtp.gmail.com::587
  • Hide local mail name in outgoing mail? NO
  • Keep number of DNS-queries minimal (Dial-on-Demand)? NO
  • Delivery method for local mail: Maildir format in home directory
  • Split configuration into small files? NO

En este momento terminará y reiniciará el servidor exim4 (no he puesto en la lista los mensajes de ayuda del configurador).

Ahora solo nos quedaría hacer un correo de prueba para ver si nos llega el correo:

#echo "Test mail" | mail -s "Test" MiCorreo@MiDominio.com
# tail /var/log/exim4/mainlog
2008-10-19 10:27:41 1KrTdH-0008E1-AA => linvx@linvx.org R=smarthost T=remote_smtp_smarthost
H=gmail-smtp-msa.l.google.com [216.239.59.109] X=TLS1.0:RSA_ARCFOUR_MD5:16 DN="C=US,ST=California,
L=Mountain View,O=Google Inc,CN=smtp.gmail.com"
2008-10-19 10:27:41 1KrTdH-0008E1-AA Completed
2008-10-19 10:36:53 Start queue run: pid=31722
2008-10-19 10:36:53 End queue run: pid=31722
2008-10-19 10:39:32 exim 4.69 daemon started: pid=32370, -q30m, listening for SMTP on [127.0.0.1]:25
2008-10-19 10:39:33 Start queue run: pid=32371
2008-10-19 10:39:33 End queue run: pid=32371
2008-10-19 10:44:50 1KrTu6-0008QW-26 <= MiUserGmail@MiDominioGmail.com U=root P=local S=340
2008-10-19 10:44:53 1KrTu6-0008QW-26 => MiUserGmail@MiDominioGmail.com R=smarthost
T=remote_smtp_smarthost H=gmail-smtp-msa.l.google.com [216.239.59.109] X=TLS1.0:RSA_ARCFOUR_MD5:16
DN="C=US,ST=California,
L=Mountain View,O=Google Inc,CN=smtp.gmail.com"
2008-10-19 10:44:53 1KrTu6-0008QW-26 Completed

Publicidad Contenido

User login

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.