Exim LDAP: differenze tra le versioni
Jump to navigation
Jump to search
Nessun oggetto della modifica |
|||
| (6 versioni intermedie di uno stesso utente non sono mostrate) | |||
| Riga 62: | Riga 62: | ||
=Alias= |
|||
<pre> |
<pre> |
||
root@mail1:/etc/exim4/conf.d/router# more 450_exim4-config_ldap_aliases |
root@mail1:/etc/exim4/conf.d/router# more 450_exim4-config_ldap_aliases |
||
| Riga 68: | Riga 68: | ||
# sono definite in /etc/exim4/exim4.conf.localmacros |
# sono definite in /etc/exim4/exim4.conf.localmacros |
||
# ma non funzionano. quindi le ho ridefinite qua |
# ma non funzionano. quindi le ho ridefinite qua |
||
ALIAS_LDAPU = cn=exim-bind-user,dc=emigar,dc=it |
|||
ALIAS_LDAPP = <password> |
|||
ALIAS_LDAPS = ldap://localhost:389/ |
|||
LDAPB = ou=aliases,dc=emigar,dc=it |
ALIAS=LDAPB = ou=aliases,dc=emigar,dc=it |
||
| Riga 82: | Riga 82: | ||
allow_defer |
allow_defer |
||
data = ${lookup ldap { \ |
data = ${lookup ldap { \ |
||
user= |
user=ALIAS_LDAPU \ |
||
pass= |
pass=ALIAS_LDAPP \ |
||
ALIAS_LDAPS\ |
|||
ALIAS_LDAPB\ |
|||
?rfc822mailMember?sub?(&(objectClass=nisMailAlias)(cn=${quote_ldap:$local_part}))}\ |
?rfc822mailMember?sub?(&(objectClass=nisMailAlias)(cn=${quote_ldap:$local_part}))}\ |
||
{$value} fail} |
{$value} fail} |
||
| Riga 99: | Riga 99: | ||
</pre> |
</pre> |
||
=Utenti= |
|||
<pre> |
<pre> |
||
root@mail1:/etc/exim4/conf.d/router# more 899_exim4-config_ldap_user |
root@mail1:/etc/exim4/conf.d/router# more 899_exim4-config_ldap_user |
||
| Riga 112: | Riga 112: | ||
# sono definite in /etc/exim4/exim4.conf.localmacros |
# sono definite in /etc/exim4/exim4.conf.localmacros |
||
# ma non funzionano. quindi le ho ridefinite qua |
# ma non funzionano. quindi le ho ridefinite qua |
||
USER_LDAPU = cn=exim-bind,dc=emigar,dc=it |
USER_LDAPU = cn=exim-bind-user,dc=emigar,dc=it |
||
USER_LDAPP = <password> |
USER_LDAPP = <password> |
||
USER_LDAPS = ldap://localhost:389/ |
USER_LDAPS = ldap://localhost:389/ |
||
| Riga 133: | Riga 133: | ||
#.endif |
#.endif |
||
</pre> |
|||
=Auto Answer= |
|||
Realizzazione di un autorisponditore per avvisare di un cambio imminente di dominio |
|||
<pre> |
|||
auto_answer_router: |
|||
driver = accept |
|||
domains = wildlsearch;/var/spool/exim/domains_autoanswer.list |
|||
condition = ${if or {\ |
|||
{ eq {$sender_address} {} } \ |
|||
{ def:header_X-Cron-Env: } \ |
|||
{ def:header_Auto-Submitted: } \ |
|||
{ def:header_List-Id: } \ |
|||
{ def:header_List-Help: } \ |
|||
{ def:header_List-Unsubscribe:} \ |
|||
{ def:header_List-Subscribe: } \ |
|||
{ def:header_List-Owner: } \ |
|||
{ def:header_List-Post: } \ |
|||
{ def:header_List-Archive: } \ |
|||
{ def:header_Autorespond: } \ |
|||
{ def:header_X-Autoresponse: } \ |
|||
{ def:header_X-Autoreply-From: } \ |
|||
{ def:header_X-eBay-MailTracker: } \ |
|||
{ def:header_X-MaxCode-Template: } \ |
|||
{ match {$header_X-Spam-Flag:} {\N^yes\N} } \ |
|||
{ match {$header_X-Spamc:} {\N^is spam\N} } \ |
|||
{ match {$header_X-Mlf-Threat:} {\N^spam\N} } \ |
|||
{ match {$header_X-MailCleaner-SpamCheck:} {\N^spam\N} } \ |
|||
{ match {$header_from:} {@vecchio-dominio.it} } \ |
|||
{ match {$header_from:} {@nuovo-dominio.it} } \ |
|||
} {0}{1}} |
|||
transport = auto_answer_transport |
|||
unseen |
|||
</pre> |
|||
<pre> |
|||
auto_answer_transport: |
|||
driver = autoreply |
|||
log = /var/log/exim/autoanswer.log |
|||
once = /var/spool/exim/db/once_auto_answer.${local_part}@${domain}.db |
|||
once_repeat = 1d |
|||
to = ${sender_address} |
|||
#from = "${local_part}@${domain}" |
|||
#reply_to = "${local_part}@${domain}" |
|||
from = "${local_part}@nuovo-dominio.it" |
|||
reply_to = "${local_part}@nuovo-dominio.it" |
|||
#subject = "Cambio indirizzo di posta" |
|||
subject = ${if def:h_subject: \ |
|||
{Auto: Re: ${rfc2047:${quote:${escape:${length_60:$h_subject:}} }} }\ |
|||
{Auto: Cambio indirizzo di posta} \ |
|||
} |
|||
headers = \ |
|||
Content-Type: text/plain; charset="utf-8"\n\ |
|||
Content-Transfer-Encoding: 8bit\n |
|||
#text = "prova auto answer ${local_part}@${domain} diventera ${local_part}@nuovo-dominio.it" |
|||
file = VARDIR/spool/mailcleaner/autoanswer_message.txt |
|||
file_expand = true |
|||
</pre> |
</pre> |
||
Versione attuale delle 00:47, 2 mar 2011
Come configurare exim4 per utilizzare LDAP:
HOME_DIR=/var/mail/home ... local_delivery: driver = appendfile delivery_date_add envelope_to_add return_path_add maildir_format create_directory # can't have normal home directory as users don't have them # and this driver does a chdir to $home home_directory = HOME_DIR directory = $home/$local_part/Maildir
Configurazione per i mail alias.
In LDAP creare gli alias nel seguente modo:
dn: cn=all-users,ou=Aliases,dc=RSPPG cn: all-users objectClass: nisMailAlias objectClass: top rfc822MailMember: user1 rfc822MailMember: user2 rfc822MailMember: user3 rfc822MailMember: user4
In exim.conf aggiungere un router per cercare gli indirizzi:
ldap_aliases:
driver = redirect
allow_fail
allow_defer
data = ${lookup ldap { \
user=LDAPU \
pass=LDAPP \
LDAPS\
rfc822mailMember?sub?(&(objectClass=nisMailAlias)(cn=${quote_ldap:$local_part}))}\
{$value} fail}
file_transport = address_file
pipe_transport = address_pipe
Fonte: http://lists.exim.org/lurker/message/20040517.092129.6fe45085.en.html
http://www.wlug.org.nz/EximNotes
Alias
root@mail1:/etc/exim4/conf.d/router# more 450_exim4-config_ldap_aliases
# sono definite in /etc/exim4/exim4.conf.localmacros
# ma non funzionano. quindi le ho ridefinite qua
ALIAS_LDAPU = cn=exim-bind-user,dc=emigar,dc=it
ALIAS_LDAPP = <password>
ALIAS_LDAPS = ldap://localhost:389/
ALIAS=LDAPB = ou=aliases,dc=emigar,dc=it
#.ifdef LDAP_ALIASES
ldap_aliases:
debug_print = "R: ldap_aliases for $local_part@$domain"
driver = redirect
domains = +local_domains
allow_fail
allow_defer
data = ${lookup ldap { \
user=ALIAS_LDAPU \
pass=ALIAS_LDAPP \
ALIAS_LDAPS\
ALIAS_LDAPB\
?rfc822mailMember?sub?(&(objectClass=nisMailAlias)(cn=${quote_ldap:$local_part}))}\
{$value} fail}
# data = ${lookup ldap {LDAP_ALIASES}{${local_part}@${domain}}{:fail: User unknown}}
# file_transport = address_file
# pipe_transport = address_pipe
#.endif
Utenti
root@mail1:/etc/exim4/conf.d/router# more 899_exim4-config_ldap_user
### router/899_exim4-config_ldap_user
#################################
# This router matches ldap user mailboxes.
#.ifdef LDAP_USERS
# sono definite in /etc/exim4/exim4.conf.localmacros
# ma non funzionano. quindi le ho ridefinite qua
USER_LDAPU = cn=exim-bind-user,dc=emigar,dc=it
USER_LDAPP = <password>
USER_LDAPS = ldap://localhost:389/
USER_LDAPB = dc=emigar,dc=it
ldap_user:
debug_print = "R: ldap_user for $local_part@$domain"
driver = accept
domains = +local_domains
condition = ${lookup ldap { \
user=USER_LDAPU \
pass=USER_LDAPP \
USER_LDAPS\
USER_LDAPB\
?uid?sub?(&(objectClass=posixAccount)(uid=${quote_ldap:$local_part}))}}
# retry_use_local_part
transport = dovecot_deliver
#.endif
Auto Answer
Realizzazione di un autorisponditore per avvisare di un cambio imminente di dominio
auto_answer_router:
driver = accept
domains = wildlsearch;/var/spool/exim/domains_autoanswer.list
condition = ${if or {\
{ eq {$sender_address} {} } \
{ def:header_X-Cron-Env: } \
{ def:header_Auto-Submitted: } \
{ def:header_List-Id: } \
{ def:header_List-Help: } \
{ def:header_List-Unsubscribe:} \
{ def:header_List-Subscribe: } \
{ def:header_List-Owner: } \
{ def:header_List-Post: } \
{ def:header_List-Archive: } \
{ def:header_Autorespond: } \
{ def:header_X-Autoresponse: } \
{ def:header_X-Autoreply-From: } \
{ def:header_X-eBay-MailTracker: } \
{ def:header_X-MaxCode-Template: } \
{ match {$header_X-Spam-Flag:} {\N^yes\N} } \
{ match {$header_X-Spamc:} {\N^is spam\N} } \
{ match {$header_X-Mlf-Threat:} {\N^spam\N} } \
{ match {$header_X-MailCleaner-SpamCheck:} {\N^spam\N} } \
{ match {$header_from:} {@vecchio-dominio.it} } \
{ match {$header_from:} {@nuovo-dominio.it} } \
} {0}{1}}
transport = auto_answer_transport
unseen
auto_answer_transport:
driver = autoreply
log = /var/log/exim/autoanswer.log
once = /var/spool/exim/db/once_auto_answer.${local_part}@${domain}.db
once_repeat = 1d
to = ${sender_address}
#from = "${local_part}@${domain}"
#reply_to = "${local_part}@${domain}"
from = "${local_part}@nuovo-dominio.it"
reply_to = "${local_part}@nuovo-dominio.it"
#subject = "Cambio indirizzo di posta"
subject = ${if def:h_subject: \
{Auto: Re: ${rfc2047:${quote:${escape:${length_60:$h_subject:}} }} }\
{Auto: Cambio indirizzo di posta} \
}
headers = \
Content-Type: text/plain; charset="utf-8"\n\
Content-Transfer-Encoding: 8bit\n
#text = "prova auto answer ${local_part}@${domain} diventera ${local_part}@nuovo-dominio.it"
file = VARDIR/spool/mailcleaner/autoanswer_message.txt
file_expand = true