[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kroupware
Subject:    [Kroupware] Postfix routing - elegant solution needed
From:       Stephan Buys <s.buys () codefusion ! co ! za>
Date:       2003-07-18 10:32:02
[Download RAW message or body]

Hi all,

I have a situation whereby the postfix mydomain is set to an organization wide
e-mail address. 

My situation is that sometimes mail gets sent to the server that has the pattern:
unknownuser@mydomain

This user does not exist on the system, but because mydomain is set to the same
domain the mail is handed to lmtp, upon which Cyrus replies with:

550-Mailbox unknown.  Either there is no mailbox associated with this
    550-name or you do not have authorization to see it. 550 5.1.1 User unknown
    (in reply to RCPT TO command)

To resolve this issue I have done the following:

1) Use the canonical rewrite mechanism to rewrite all known and unknown 
addresses from mydomain into a special format:

/kolab/etc/postfix/canonical
@kolabtest.co.za          kolab@unknown.kolabtest.co.za

/kolab/etc/kolab/main.cf.template
recipient_canonical_maps = ldap:ldapsource 
canonical_maps = hash:/kolab/etc/postfix/canonical

ldapsource_search_base = dc=baronny,dc=kolabtest,dc=co,dc=za
ldapsource_query_filter = (mail=%s)
ldapsource_result_attribute = mail
ldapsource_result_filter = %s.known
ldapsource_search_timeout = 2
ldapsource_scope = one
ldapsource_bind = no
ldapsource_version = 3

The result of this step is that any mailbox on my server resolves through ldap
if a user is local or not. 
-If not the user becomes: user@unknown.kolabtest.co.za
-If known the user becomes: user@kolabtest.co.za.known
---

2) All unknown addresses are relayed out to my main router, where the router
rewrites unknown.kolabtest.co.za to kolabtest.co.za and continues merilly.
---

3) All known users are fixed through virtual as follows:

/kolab/etc/postfix/virual.reg
/^(.*)@kolabtest\.co\.za\.known/      $1@kolabtest.co.za

/kolab/etc/kolab/main.cf.template
virtual_maps = regexp:/kolab/etc/postfix/virtual.reg hash:/kolab/etc/postfix/virtual

This fixes the addresses from kolabtest.co.za.known to kolabtest.co.za after which
the addresses are handed to Cyrus through lmtp and delivered.
---

Is there an easier way to do this? This solution works with pretty good performance.

Any postfix gurus out there? ;-)

Regards,
-- 
Stephan 

_______________________________________________
Kroupware mailing list
Kroupware@mail.kde.org
http://mail.kde.org/mailman/listinfo/kroupware
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic