Mail Forwarding broken

Daniel Hoffend dh at dotlan.net
Wed Jan 15 21:48:26 CET 2014


I'll try to summarize the mail forwarding setup. It's important to pay 
attenation to the little details and even more on the order of the 
configuration.

1) Correct User Type

Check that your user_type "Mail Forwarding" or whatever is called only 
contains the following object classes
* inetOrgPerson
* mailRecipient
* organizationalPerson
* person
* top

It's important that kolabInetOrgPerson is not enabled!
The following 2 attributes are important
* mail
* mailForwardingAddress

The mail attribute "can" be of the field-type: "list" to allow multiple 
mail addresses forwarded to the mailForwardingAddress


2) Check the filter for (not) creating new users (aka imap folders)

root at kolab:~# grep kolab_user_filter /etc/kolab/kolab.conf
kolab_user_filter = (objectclass=kolabinetorgperson)
This filter makes sure that kolabd only creates imap folders for users 
that match the given filter. When we now create mail forwarding entries 
they don't contain the kolabInetOrgPerson objectclass therefore there's 
no imap folder created (which is the intention).


3) Check the order of postfix:virtual_alias_maps

Pay attention to the order (cause the first match will be the 
destination). I only list the most important ones.

* /etc/postfix/ldap/virtual_alias_maps.cf
* /etc/postfix/ldap/virtual_alias_maps_mailforwarding.cf
* /etc/postfix/ldap/virtual_alias_maps_catchall.cf

My personal list is a bit longer (mostly not used, but good for 
explanation and to be complete).
virtual_alias_maps > mailforwarding > sharedfolders > distgroups > 
dynamic_distgroups > catchall

Let's take a closer look at the ldap filter and result attribute in the 
virtual alias maps

# virtual_alias_maps.cf

query_filter = (&(|(mail=%s)(alias=%s))(objectclass=kolabinetorgperson))
result_attribute = mail
This will find all kolab mail users (those with folders) that matches 
mail or alias address. If it founds a match it will return the mail 
address. (then local_recipient table and transport are coming into 
affect). If **no match** could be found, postfix will proceed with the 
next given configuration virtual_alias_maps which in our case is 
mailforwarding.

# virtual_alias_maps_mailforwarding.cf

query_filter = (&(mail=%s)(objectclass=inetorgperson))
result_attribute = mailForwardingAddress

Now postfix is searching for mail address that have the objectclass 
inetorgperson. It's important that this config comes after the one with 
kolabinetperson, cause all kolab users have inetorgperson as well! 
Postfix will then return the mailForwardingAddress attribute to the main 
process. If it's a local address it will still try to deliver it, but 
when it's an external address postfix will directly push it out again.

# virtual_alias_maps_catchall.cf

query_filter = (&(alias=catchall@%d)(objectclass=kolabinetorgperson))
result_attribute = mail

If one of the previous filter rules hasn't matched yet the filter will 
search for any use that have the alias "catchall@<domain>" and returns 
the mail attribute for local delivery.

--

that's it. I hope this explains the postfix+ldap process pretty much.


4) Appendix (to be complete):

But what if you want to have a real kolab account to take benefit of the 
kolab services or the webmail but still forward all incoming mails?

Well then you just have to create a real kolab user account, log into 
the webmail interface go to options, then filter an create a rule the 
will either forward all mails or send a copy to your remote address.


--
Kind Regards
Daniel Hoffend






------ Originalnachricht ------
Von: "Torsten Grote" <torsten at kolab.org>
An: users at lists.kolab.org
Gesendet: 15.01.2014 17:07:39
Betreff: Re: Mail Forwarding broken

>On Wednesday 15 January 2014 17:01:28 Christian Hügel wrote:
>>  Are you also using Timotheus multidomain script?
>
>No, my personal setup is simple enough to work without it.
>Btw. Daniel should also know the technical details of how the Mail 
>Forwarding
>user works.
>
>Kind Regards,
>Torsten
>
>--
>Torsten Grote
>Kolab.org Community Manager
>
>e: torsten at kolab.org
>w: https://Kolab.org
>
>pgp: 274D 4F97 Torsten Grote
>_______________________________________________
>users mailing list
>users at lists.kolab.org
>https://lists.kolab.org/mailman/listinfo/users



More information about the users mailing list