doc:appunti:linux:sa:exim
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
doc:appunti:linux:sa:exim [2012/01/19 09:55] – [Cifratura TLS] niccolo | doc:appunti:linux:sa:exim [2019/01/21 12:08] (current) – [Smarthost] niccolo | ||
---|---|---|---|
Line 90: | Line 90: | ||
Per le versioni più vecchie di Exim (es. la 3?) sostituire le variabili consigliate **$auth1**, **$auth2** e **$auth3** con le obsolete **$1**, **$2** e **$3**. Vedere anche questa pagina per un [[authdaemon_problem|problema del Courier authdaemon]]. | Per le versioni più vecchie di Exim (es. la 3?) sostituire le variabili consigliate **$auth1**, **$auth2** e **$auth3** con le obsolete **$1**, **$2** e **$3**. Vedere anche questa pagina per un [[authdaemon_problem|problema del Courier authdaemon]]. | ||
- | Attenzione che in questo caso Exim deve accedere al socket '' | + | Attenzione che in questo caso Exim deve accedere al socket '' |
< | < | ||
- | drwxrwx--- 3 daemon daemon 1024 May 9 14:40 / | + | drwxr-x--- 2 daemon daemon |
- | drwxrwx--- 2 daemon daemon | + | |
</ | </ | ||
- | Sistemati in questo modo, speriamo che non sia troppo permissivo: | + | La soluzione suggerita è aggiungere l' |
- | + | ||
- | < | + | |
- | chmod 755 / | + | |
- | chgrp Debian-exim | + | |
- | </ | + | |
- | + | ||
- | Anche in una installazione Debian più recente (Lenny) | + | |
- | + | ||
- | < | + | |
- | drwxr-xr-x 3 daemon | + | |
- | drwxr-x--- 2 daemon daemon 4096 2006-07-06 16:40 / | + | |
- | </ | + | |
- | + | ||
- | Si può cambiare il mode della directory | + | |
Per abilitare l' | Per abilitare l' | ||
Line 146: | Line 131: | ||
</ | </ | ||
+ | Questa configurazione abilita la cifratura con STARTTLS, cioè la porta di comunicazione è la tradizionale TCP/25 e la cifratura inizia dopo il comando STARTTLS. | ||
+ | |||
+ | ===== Cifratura SSL su porta TCP/465 ===== | ||
+ | |||
+ | Questo metodo sarebbe obsoleto rispetto al TLS su porta TCP/25 (con uso del comando STARTTLS), tuttavia la pessima abitudine di alcuni provider di filtrare la porta 25 in uscita, lo rende ancora interessante. | ||
+ | |||
+ | Anzitutto si deve dire al demone di stare in ascolto sulle due porte: 25 e 465, in **''/ | ||
+ | |||
+ | < | ||
+ | SMTPLISTENEROPTIONS=' | ||
+ | </ | ||
+ | |||
+ | Quindi si deve indicare che sulla porta 465 si vuole usare la cifratura SSL (non il comando STARTTLS come si fa sulla tradizionale porta 25), in **''/ | ||
+ | |||
+ | < | ||
+ | tls_on_connect_ports=465 | ||
+ | </ | ||
===== Utilizzo dei system filter ===== | ===== Utilizzo dei system filter ===== | ||
Line 301: | Line 303: | ||
The only **drawback** is when a legitimate sender send a mail to a non-existent address. If in that moment the primary MX server is unreachable, | The only **drawback** is when a legitimate sender send a mail to a non-existent address. If in that moment the primary MX server is unreachable, | ||
+ | |||
+ | ===== Smarthost ===== | ||
+ | |||
+ | In Debian configurare Exim per utilizzare uno smarthost è semplice, basta modificare il file **''/ | ||
+ | |||
+ | < | ||
+ | dc_eximconfig_configtype=' | ||
+ | dc_smarthost=' | ||
+ | </ | ||
+ | |||
+ | Se non è necessario gestire posta localmente, è più indicata la configurazione // | ||
+ | |||
+ | < | ||
+ | dc_eximconfig_configtype=' | ||
+ | dc_smarthost=' | ||
+ | </ | ||
+ | |||
+ | |||
+ | Dopo la modifica fare un reload di Exim e controllare che il file **''/ | ||
+ | |||
+ | < | ||
+ | DCsmarthost=10.0.1.205 | ||
+ | </ | ||
+ | |||
+ | Per fare un test su quale **transport** viene usato si può usare il comando: | ||
+ | |||
+ | < | ||
+ | exim -bt " | ||
+ | R: smarthost for niccolo@rigacci.org | ||
+ | niccolo@rigacci.org | ||
+ | router = smarthost, transport = remote_smtp_smarthost | ||
+ | host smarthost.texnet.it [62.48.51.128] | ||
+ | </ | ||
+ | |||
+ | In assenza di smarthost invece si ha: | ||
+ | |||
+ | < | ||
+ | exim -bt " | ||
+ | R: dnslookup for niccolo@rigacci.org | ||
+ | niccolo@rigacci.org | ||
+ | router = dnslookup, transport = remote_smtp | ||
+ | host mail.rigacci.org [78.47.114.234] MX=10 | ||
+ | </ | ||
+ | |||
+ | Se lo **smarthost richiede autenticazione**, | ||
+ | |||
+ | < | ||
+ | smarthost.domain.org: | ||
+ | </ | ||
+ | |||
+ | È necessario proteggere il file con permessi **root: | ||
+ | |||
+ | Se un messaggio non è partito (è rimasto in coda, il suo ID è visibile con **mailq**), è possibile chiedere un nuovo invio e tracciare la sessione con: | ||
+ | |||
+ | < | ||
+ | exim -v -M 1glXAU-0000Ig-1n | ||
+ | </ | ||
+ | |||
+ | In questo modo è possibile verificare che lo smarthost annunci correttamente l' | ||
+ | ===== Smarthost per domini privati ===== | ||
+ | |||
+ | Configurare uno smarthost per un dominio privato presenta qualche problema; anzitutto non è detto che si voglia pubblicare sul DNS un' | ||
+ | |||
+ | < | ||
+ | all relevant MX records point to non-existent hosts | ||
+ | lowest numbered MX record points to local host | ||
+ | </ | ||
+ | |||
+ | In effetti Exim ha nella configurazione Debian l' | ||
+ | |||
+ | La soluzione più semplice è aggiungere un router del tipo: | ||
+ | |||
+ | < | ||
+ | |||
+ | ### router/ | ||
+ | ################################# | ||
+ | |||
+ | # Private domains routed manually to a specific smarthost. | ||
+ | # We can use private IP addresses, otherwise prohibited. | ||
+ | |||
+ | private_smarthost: | ||
+ | driver = manualroute | ||
+ | domains = naxos.rigacci.org : naxos.my.rigacci.org | ||
+ | transport = remote_smtp | ||
+ | route_list = \ | ||
+ | naxos.rigacci.org | ||
+ | naxos.my.rigacci.org 172.16.3.78 | ||
+ | </ | ||
+ | |||
+ | ===== Address rewrite ===== | ||
+ | |||
+ | Uno dei casi più utilizzati di address rewrite è modificare l' | ||
+ | |||
+ | Exim onora il file **''/ | ||
+ | |||
+ | < | ||
+ | root: support@domain.it | ||
+ | </ | ||
+ | |||
+ | in questo modo tutte le mail generate dall' | ||
+ | |||
+ | Fare attenzione alle informazioni **[[wp> | ||
+ | |||
+ | Il metodo visto sopra consente di riscrivere solo gli **indirizzi locali** (cioè senza la parte **'' | ||
+ | |||
+ | < | ||
+ | ### rewrite/ | ||
+ | ################################# | ||
+ | |||
+ | # Rewrite the headers: From, Sender, Reply-To and the envelope From | ||
+ | # Test it with: | ||
+ | # exim -brw NAS@192.168.1.254 | ||
+ | |||
+ | NAS@192.168.1.254 | ||
+ | </ |
doc/appunti/linux/sa/exim.1326963307.txt.gz · Last modified: 2012/01/19 09:55 by niccolo