[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: mail = mailRoutingAddress



On Wed, Mar 27, 2002 at 01:16:18PM +0100, Turbo Fredriksson wrote:
> >>>>> "David" == David Wright <ichbin@shadlen.org> writes:
> So if I have
> 
>         mail: turbo@bayour.com
>         mailRoutingAddress: turbo@tripnet.se
> 
> All mails to turbo@bayour.com would be forwarded by my mail server to
> turbo@tripnet.se. If I would realy do this live, I would cause a mail
> loop, but as an example it holds...

ofcourse, it depends on how your mail-server is setup, i.e. what
attributes it uses when looking up adresses.

For example, my setup looks like this (using sendmail):

Kldap_alias ldap -z, -v rfc822mailmember -h db -k (&(objectClass=nismailalias)(uid=%0))

Kldapmh ldap -1 -v mailHost -k (&(objectClass=inetLocalMailRecipient)(mailLocalAddress=%0))

Kldapmra ldap -1 -v mailRoutingAddress -k (&(objectClass=inetLocalMailRecipient)(mailLocalAddress=%0))

O AliasFile=/etc/aliases,sequence:ldap_alias

F{LDAPRoute}/etc/mail/LDAProute

In .mc format, this is

FEATURE(ldap_routing)
define(confLDAP_DEFAULT_SPEC, -h db -b `dc=acme')
LDAPROUTE_DOMAIN_FILE(/etc/mail/LDAProute)
Kldap_alias ldap -z, -v rfc822mailmember -h db -k (&(objectClass=nismailalias)(uid=%0))
define(`ALIAS_FILE', `/etc/aliases,sequence:ldap_alias')dnl


So, if there is an incoming email to some@dude.com, and the dude.com
exists in the LDAPRoute file (similar to sendmail.cw), ldap is searched
for this address, by using the ldapmra rule.

The search is done for mailLocalAddress=some@dude.com, and the value for
mailRoutingAddress is used to determine where the mail is sent. On my
system, mailRoutingAddress equals the userid of the user.

Then, the mailRoutingAddress is expanded via the alias map. As you can
see above, I have accomodated for both /etc/aliases and an ldap-based
"aliases" ... essentialy, it can be thought of as a way of storing
.forward in ldap.

This is an example LDIF entry:

# acn1040p1,pop,users,dc=acme
dn: uid=acn1040p1,ou=pop,ou=users,dc=acme
objectClass: top
objectClass: posixAccount
objectClass: account
objectClass: popaccount
objectClass: inetlocalmailrecipient
objectClass: nismailalias
mailRoutingAddress: acn1040p1
gecos: POP konto till acn1040
cn: acn1040:acn1040p1
ou: pop
ou: users
uid: acn1040p1
homeDirectory: /home/popusers/acn1040p1
loginShell: /bin/no_shell_access
uidNumber: 2034
gidNumber: 200
owner: uid=acn1040,ou=users,dc=acme
mailLocalAddress: @adt.nu
mailLocalAddress: some@dude.com
mailLocalAddress: info@acme.com
rfc822mailmember: stefan@alfredsson.org
vacationUntil: 2002-2-8
onVacation: TRUE
vacationMessage: Jag e pa semester


In this example, all email bound for *@adt.nu, some@dude.com and
info@acme.com will be forwarded to stefan@alfredsson.org

I also have support for "vacation" auto-replies through a helper-program
invoked by /etc/procmailrc, checking if vacation is enabled and within
certain date bounds, and in that case replies with the text contained
in "vacationMessage" (these attributes nonstandard, added by myself)

> So 'mail' and 'mailRoutingAddress' are used for two different purposes...

yep, as pointed out in another posting, mail describes where the person
in the entry may be reached, and is not used in the routing process
(not by me anyway :)

Also; some security issues are to be noted if this system is used in an
environment where users themself can change mailLocalAddress ..
there is no stopping them from using a domain which "belongs" to another
user.

/Stefan