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

    Connection to Postfix

    Kopano Groupware Core
    3
    6
    3466
    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.
    • mcdaniels
      mcdaniels last edited by mcdaniels

      Hi,
      as far as I understood right (and as it works for me) Postfix uses virtualtransport for moving incoming mails to the Kopano dagent, which listens on Port 2003 (default).

      So, in Posfix main.cf I have the following settings concerning the virtual users / transport.

      virtual_mailbox_maps = hash:/etc/postfix/virtual
      virtual_alias_maps = hash:/etc/postfix/virtual
      virtual_transport = lmtp:127.0.0.1:2003
      

      As you can see, I only use flatfile (virtual) for my mailboxes and aliases.

      How does Kopano know, where incoming emails have to be assigned to? Does it check the kopano-users in kopano-db -> looking up the emailaddresses -> then assigns the incoming mail to the user with the matching emailaddress?

      (I am using users which are added via kopano-admin. The users are stored in die Kopano-db)

      Thanks for your answers!

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

        Hello @mcdaniels ,

        dagent can accept deliveries either to the primary email address of the user, or the username of a user.

        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
        • bosim
          bosim last edited by

          Personally I am using the following config with postfix to validate kopano db users:

          virtual_alias_maps = hash:/etc/postfix/virtual
          virtual_mailbox_domains = mysql:/etc/postfix/kopano-domains.conf
          virtual_mailbox_maps = mysql:/etc/postfix/kopano-users.conf
          virtual_transport = lmtp:localhost:2003
          

          And kopano-domains.conf

          user = <db user>
          password = <db pass>
          hosts = <db host>
          dbname = <db name>
          query = select value from objectproperty where objectid=(select objectid from objectproperty where value LIKE '%%@%s' and propname='emailaddress' limit 1) and propname='loginname';
          

          kopano-users.conf with the same except for query

          query = select value from objectproperty where objectid=(select objectid from objectproperty where value='%s' and propname='emailaddress' limit 1) and propname='loginname';
          

          They are modified from the documentation since I need to check for the e-mail address (different domains on the system) and not the userrname.

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

            Hello,
            @fbartels - Thanks!

            @bosim Thank you for the examples.
            It seems like that I know, what Postfix/Kopano is doing if I use this config:

            virtual_mailbox_maps = hash:/etc/postfix/virtual
            virtual_alias_maps = hash:/etc/postfix/virtual
            

            Mail comes in, Postfix checks the maps -> hands it over to dagent (with the emailaddress) -> so it is assigned to the correct kopano-db-user.

            Your SQL query for the kopano-domains deliver only the username. (If I use it the right way):

            select value from objectproperty where objectid=(select objectid from objectproperty where value LIKE '%%@%s' and propname='emailaddress' limit 1) and propname='loginname';
            

            Output is a Username, but should be the domain?

            I am sure I have a wrong understanding of it…

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

              Good morning,
              …just playing around a little bit with mysql-queries.

              I wonder if the following query would be enough for postfix to check if a mailaddress is existing in kopano-db.

              SELECT value FROM objectproperty where propname = 'emailaddress' and value = '%s'
              

              edit: the query seems to work.

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

                Great you got it working. The wierd %s@%s logic is to take out the domains not the users.

                Bo

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post