.:Hledání:.



odesilani emailu z postfixu ze site kde je blokovan port 25


Hlasování: 3 (187)   +-


Autor: sinker
postup pro odeslani posty pres SMTP SSL (465), v pripade ze je poskytovatelem blokovan port 25.
Vetsina navodu je prevzata + opraveny chybky

Instalace potrebnych balicku
apt-get install postfix stunnel
  
  
Prvotni nastaveni
echo "[127.0.0.1]:11125 user@example.com:password" >>/etc/postfix/sasl_passw
  
  
  
chown root:root /etc/postfix/sasl_passwd chmod 600 /etc/postfix/sasl_passwd
cd /etc/postfix/ postmap hash:/etc/postfix/sasl_passwd
echo "smtp_sasl_auth_enable = yes" >>/etc/postfix/main.cf echo "smtp_sasl_security_options =" >>/etc/postfix/main.cf echo "relayhost = [127.0.0.1]:11125" >>/etc/postfix/main.cf
echo "smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd" >>/etc/postfix/main.cf
vygenerovani certifikatu pro stunnel:
openssl req -new -x509 -days 3650 -nodes -out stunnel.pem -keyout stunnel.pem

Konfigurace stunnelu
nano /etc/default/stunnel

zmena "ENABLED=0" na "ENABLED=1"

pridat do /etc/stunnel/stunnel.conf
[smtp-tls-wrapper]
  
accept = 11125 client = yes
connect = mail.example.com:465
a zkontrolovat jestli certifikat je nastaven spravne (umisteni) pridani do "/etc/hosts.allow" smtp-tls-wrapper: 127.0.0.1
Restart vseho
/etc/init.d/postfix restart
/etc/init.d/stunnel4 restart

# dulzite predevsim pro debian (na ubuntu neni potreba)
doinstalovani knihovny pro SASL
aptitude install libsasl2-modules

chyba v logu vypada takto:
warning: SASL authentication failure: No worthy mechs foundSASL authentication failed; cannot authenticate to server mail.example.com
Zdroje:
http://www.debian-administration.org/articles/604
http://ubuntuforums.org/archive/index.php/t-487843.html