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

    Kopano rules mark mail as "seen"

    Kopano Groupware Core
    3
    9
    1266
    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.
    • jn
      jn last edited by

      Hi,

      how can i mark mails as seen, when it will be moved to a subfolder?

      Jan

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

        Hi @jn ,

        do you mean “mark a mail as seen, when it will be moved to a subfolder by a rule”? Currently there is no option in WebApp to have “mark as read” as an option.

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

          Hi,

          yes i want the moved mail mark as read/seen - and i know, there is no option in the web app. Therefore my question, how can i do that?
          Maybe with a script in the shell, that mark all maila in a subfolder as seen/read !?

          Jan

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

            Hi @jn ,

            you can find the scripting reference for python kopano at https://documentation.kopano.io/kopano_python_kopano/

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

              Hi,

              how can i trigger such script, if new mail will be processed?
              and … this script does not work:

              #!/usr/bin/python
              import kopano
              server = kopano.Server()
              store = server.user('jn').store
              box = store.folder('Inbox/admin')
              count = box.count
              print(count)
              for item in box:
                  if not item.read:
                      print(item.read)
                      item.set_value("read", true)
              

              i got this error:

              # ./jnm.sh
              86
              False
              Traceback (most recent call last):
                File "./jnm.sh", line 18, in <module>
                  item.set_value("read", true)
              AttributeError: 'Item' object has no attribute 'set_value'
              

              Jan

              fbartels bosim 2 Replies Last reply Reply Quote 0
              • fbartels
                fbartels Kopano @jn last edited by

                Hi @jn ,

                not much of a python developer myself, so I cannot directly help on the issue. will forward it internally to see if someone can spot the error.

                If you want immediately execute an action if a folder has changed, then we have a mechanism called incremental change system (ics). For an example of it you can look at kopano-search or the kopano-spamd script.

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

                  Hi Felix,

                  thx for your answer.
                  So i will wait until you get an info from the python developers, because, everything i had tried resolve to the error above.

                  I will try to use the ics … but, i think it is suboptimal, to parse all mails in a folder to catch the one, who is unread.
                  Sometimes, a folder could contain thousends of mails. Maybe your developer has a better method then my script above.

                  Jan

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

                    @jn said in Kopano rules mark mail as “seen”:

                    ./jnm.sh

                    86
                    False
                    Traceback (most recent call last):
                    File “./jnm.sh”, line 18, in <module>
                    item.set_value(“read”, true)
                    AttributeError: ‘Item’ object has no attribute ‘set_value’

                    Just use:

                    item.read = True
                    

                    Here is an example:

                    >>> list(kopano.Server().user("user1").inbox)[0].read
                    False
                    >>> list(kopano.Server().user("user1").inbox)[0].read = True
                    >>> list(kopano.Server().user("user1").inbox)[0].read
                    True
                    

                    Bo

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

                      Hi,

                      ok, thats easy. Very well.
                      Is there a trigger, to start my script and use parameter (like Folder / Mail / …)

                      Jan

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