14. 11. 2011 Thomas Forrer Uncategorized

Sendmail with external relay (authentication and encryption)

Spesso capita di ritrovarsi a configurare l’invio di email su server relay, che richiede autenticazione e crittazione. Perciò penso che i seguenti passaggi possano essere utili per riuscire in questo intento.

Innanzitutto inserire nel file /etc/mail/sendmail.mc :

define(`SMART_HOST',`smtp.gmail.com')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
FEATURE(`authinfo',`hash /etc/mail/auth/client-info')dnl

in seguito creare la cartella per contenere i dati di autenticazione:

# mkdir /etc/mail/auth

e creare un file client-info

# vim /etc/mail/auth/client-info

con il seguente contenuto:
AuthInfo:smtp.gmail.com "U:root" "I:<USERNAME>@gmail.com" "P:<PASSWORD>"

specificando  "<USERNAME>" e "<PASSWORD>"  del relay server.

Infine eseguire i seguenti comandi per rendere effettive le impostazioni e configurare i permessi corretti:
# cd /etc/mail/auth
# makemap hash client-info < client-info
# chmod 700 /etc/mail/auth
# chmod 600 /etc/mail/auth/*
# /etc/init.d/sendmail restart

Thomas Forrer

Thomas Forrer

Team Leader Research & Development at Würth Phoenix
Hi folks! I began loving computer since 1994, it was still the time of windows 3.1. Immediately I learned starting DOS games from the command promt, and while typing some white text on black background I felt like some hackish dude in a hollywoodian movie. Later during the studies at the university, I discovered the magic world of opensource, and it was love at first sight. Finally I got rid of BSOD's =) I love everything that is connected to some network, especially in a security perspective. My motto is: "With motivation, nothing is impossibile. It only requires more time."

Author

Thomas Forrer

Hi folks! I began loving computer since 1994, it was still the time of windows 3.1. Immediately I learned starting DOS games from the command promt, and while typing some white text on black background I felt like some hackish dude in a hollywoodian movie. Later during the studies at the university, I discovered the magic world of opensource, and it was love at first sight. Finally I got rid of BSOD's =) I love everything that is connected to some network, especially in a security perspective. My motto is: "With motivation, nothing is impossibile. It only requires more time."

Leave a Reply

Your email address will not be published. Required fields are marked *

Archive