Navigation

    Kopano
    • Register
    • Login
    • Search
    • Categories
    • Get Official Kopano Support
    • Recent
    Statement regarding the closure of the Kopano community forum and the end of the community edition

    Relaying mails for recipients which are not known

    Kopano Groupware Core
    3
    6
    3085
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • FoxholeCommander
      FoxholeCommander last edited by FoxholeCommander

      Hello,

      I have setup a Kopano server like described in the Administration Manual. We are using Active Directory for user management and Postfix for mail delivery.

      The Postfix configuration looks like:

      virtual_mailbox_domains = example.com
      virtual_mailbox_maps = ldap:/etc/postfix/ldap-users.cf
      virtual_alias_maps = ldap:/etc/postfix/ldap-aliases.cf, ldap:/etc/postfix/ldap-groups.cf, ldap:/etc/postfix/ldap-groups-expand.cf
      virtual_transport = lmtp:127.0.0.1:2003

      Now we have some users with the same domain(virtual_mailbox_domains) which are not maintained by Kopano but a other mail system on another place.

      My goal:

      I want to to relay all mails to these users to a specific host. Does anybody know how to setup postfix for that purpose.

      Greetings,

      FoxholeCommander

      fbartels 1 Reply Last reply Reply Quote 0
      • fbartels
        fbartels Kopano @FoxholeCommander last edited by

        Hello @FoxholeCommander ,

        such a configuration can be achieved with transport maps in Postfix (either queried from ldap/ad or with a static map). You basically have to map the external addresses to the external mailserver.

        Regards Felix

        Resources:
        https://kopano.com/blog/how-to-get-kopano/
        https://documentation.kopano.io/
        https://kb.kopano.io/

        Support overview:
        https://kopano.com/support/

        1 Reply Last reply Reply Quote 0
        • FoxholeCommander
          FoxholeCommander last edited by

          Hello @fbartels

          do you mean with the parameter transport_maps in main.cf? I tried it on my test environment yesterday but postfix is ignoring that although the parameter is set in the main.cf

          Greetings,

          Michael

          fbartels 1 Reply Last reply Reply Quote 0
          • fbartels
            fbartels Kopano @FoxholeCommander last edited by

            Hi @FoxholeCommander,

            what exactly did you set in your main.cf? Because its more than just a one line change.

            Something like the following should do the trick for you:

            Add transport_maps = hash:/etc/postfix/transport to you main.cf and create the file with the following content:

            external-user1@my-domain.com smtp:[external.mx.de]
            external-user2@my-domain.com smtp:[external.mx.de]
            

            With every modification of the transport file you have to call postmap /etc/postfix/transport.

            Regards Felix

            Resources:
            https://kopano.com/blog/how-to-get-kopano/
            https://documentation.kopano.io/
            https://kb.kopano.io/

            Support overview:
            https://kopano.com/support/

            1 Reply Last reply Reply Quote 0
            • FoxholeCommander
              FoxholeCommander last edited by

              Hello FBartels,

              in my config it wasn`t that simple and the transport_maps parameter was just a part of the solution. Additionally I had to make a hash table in the config line virtual_mailbox_maps. So now it looks like:

              virtual_mailbox_maps = ldap:/…, has:/…

              Greetings,

              FoxholeCommander

              1 Reply Last reply Reply Quote 0
              • mpraunegger
                mpraunegger last edited by

                Hey,
                I’ve a similar problem: Many users are maintained by our local Kopano server, but as many users will be maintained by an external mailserver. I don’t know all of the external users, but all of my local users are listed in ldap.
                How can I configure this?

                My setup: the local Kopano server maintains three domains: example1.at, example2.at and example3.at … example3.at must be splited into local users (from ldap) and all other unknown users to external

                Fortunately, the MX record for example3.at points to the external server, I use fetchmail to get the mails for my local users.
                I removed example3.at from virtual_mailbox_domains in my postifx config, so every mail to an user *@example3.at will be delieverd to the external server. Is it possible to filter the local users?

                virtual_mailbox_domains = example1.at, example2.at
                #,example3.at
                virtual_mailbox_maps = ldap:/etc/postfix/ldap-users.cf,hash:/etc/postfix/virtual/addresses
                virtual_alias_maps = ldap:/etc/postfix/ldap-aliases.cf,hash:/etc/postfix/virtual/addresses
                virtual_transport = lmtp:127.0.0.1:2003
                
                transport_maps = ldap:/etc/postfix/ldap-transport.cf,hash:/etc/postfix/transport
                

                This does not work: /etc/postfix/ldap-transport.cf

                server_host = localhost 
                search_base = ou=Users,dc=customerxyz,dc=local
                version = 3
                scope = sub
                query_filter = (&(mail=%s)(kopanoAliases=%s)) 
                result_attribute = mail
                result_format = kopano
                

                and /etc/postfix/transport

                example3.at                     smtp:bsmtp.a1.net:587
                
                1 Reply Last reply Reply Quote 0
                • First post
                  Last post