• Usage of the --formula option

    By Nick M Newton 6 years ago

    I am trying to write a script that searches for mail items created since a given data from a particular person and have tried variations of :-

    --formula='FIELD Received > 01/01/2013'

    --formula='FIELD From contains "UNIX"'

    but each call returns either a java error or no data depending on the specific syntax used.

    Please could you provide some sample searches of a local mail replica

    • formula samples

      By Sami Salkosuo 6 years ago

      Here are couple of samples, based on your use case.

      Mails after certain date:

      --formula="DeliveredDate > @Date(2013,11,1)"

      Mails from certain sender:

      --formula="@Contains(From;\"UNIX\")"

      And both together:

      --formula="DeliveredDate > @Date(2013,11,1) & @Contains(From;\"UNIX\")"

      • The formula query returns no emails

        By Nick M Newton 6 years ago

        Hi,

        Many thanks for the examples provided. The syntax now appears OK, but no emails are returned. I have included below the output from the queries made via clenotes when using the two examples discussed together with a query using the --from function. As can be seen the Formula query returns no data whereas the From query finds emails. 

        I can confirm that the local replica used has been indexed.

        Note, I have echoed out the command line parameters in the clenotes.sh to ensure things are being passed correctly.

        Regards,

        Nick

        [nick@oc4707345106 CLENotes-5.0.0]$ ./clenotes.sh --local --database-name=/home/nick/lotus/notes/data/mail01/GBY9A74H.NSF --password=****** search '--formula="DeliveredDate > @Date(2012;12;12)"'
        --local
        --database-name=/home/nick/lotus/notes/data/mail01/GBY9A74H.NSF
        --password=******
        search
        --formula="DeliveredDate > @Date(2012;12;12)"
        Command Line Email Client for IBM Notes v5.0.0
        Copyright (C) 2002, 2013 by IBM Corporation.
        Licensed under the Apache License v2.0.

        Search returned 0 mails.


        [nick@oc4707345106 CLENotes-5.0.0]$ ./clenotes.sh --local --database-name=/home/nick/lotus/notes/data/mail01/GBY9A74H.NSF --password=****** search --formula='@Contains(From; "UNIX")'
        --local
        --database-name=/home/nick/lotus/notes/data/mail01/GBY9A74H.NSF
        --password=******
        search
        --formula=@Contains(From; "UNIX")
        Command Line Email Client for IBM Notes v5.0.0
        Copyright (C) 2002, 2013 by IBM Corporation.
        Licensed under the Apache License v2.0.

        Search returned 0 mails.


        [nick@oc4707345106 CLENotes-5.0.0]$ ./clenotes.sh --local --database-name=/home/nick/lotus/notes/data/mail01/GBY9A74H.NSF --password=****** search --from='UNIX'
        --local
        --database-name=/home/nick/lotus/notes/data/mail01/GBY9A74H.NSF
        --password=******
        search
        --from=UNIX
        Command Line Email Client for IBM Notes v5.0.0
        Copyright (C) 2002, 2013 by IBM Corporation.
        Licensed under the Apache License v2.0.

        Search returned 15 mails.

        [0] 22/08/2011 11:31:22 GDT
          From:
         
        [1] 16/10/2012 16:16:51 GDT
          From:
         
        [2] 17/10/2012 10:51:04 GDT
          From:
         
        [3] 31/10/2012 18:58:04 GMT
          From:
         
        [4] 09/08/2013 12:43:52 GDT
          From:
         
        [5] 09/08/2013 11:37:38 GDT
          From:
         
        [6] 04/11/2013 16:00:51 GMT
          From:

        [7] 30/10/2013 11:30:19 GMT
          From:
         
        [8] 29/10/2013 13:29:17 GMT
          From:
         
        [9] 04/10/2013 19:47:24 GDT
          From:
         
        [10] 29/10/2013 14:11:57 GMT
          From:
         
        [11] 31/10/2013 16:45:28 GMT
          From:
         
        [12] 09/08/2013 19:57:50 GDT
          From:
         
        [13] 11/12/2013 11:01:30 GMT
          From:
         
        [14] 27/11/2013 17:41:27 GMT
          From:

        • Parameters

          By Sami Salkosuo 6 years ago

          Hi,

          It may be related to shell script and the way Linux/Unix handles script parameters. They may not propagate correctly from shell prompt, to script to CLENotes.

          You could try to use the same commands/options without calling a script, just call java from shell and see if it works.

          stackoverflow has a post about similar issue (http://stackoverflow.com/questions/4824590/propagate-all-arguments-in-a-bash-shell-script) and the suggestion is to use "$@" instead of plain $@ in scripts.

          • Search fields

            By Nick M Newton 6 years ago

            Hi, thanks for your response. I am already using the "$@" for parsing parameters, and to make sure they are being past correctly I have echoed each one out as part of the script. I have however made some progress since yesterday, and am now able to find text strings found in the subject field.

            The particular mails that I wish to process automatically are sent be a group of people with a group alias appearing in the 'who' field on the notes mail gui. This mail alias does not appear to be present in the From field.

            Do you know where I would find the definitions of the field names used within mail, as knowing what fields to search in would be good.

            Regards,

            Nick

            • fields

              By Sami Salkosuo 6 years ago

              I'm using Notes client to check document fields. Open a mail document and use right-click to open document properties. Fields are listed in the second tab from left.

              You can also verify that CLENotes receives arguments correctly by changing write_log to true in config/clenotes.cfg. Log file is written in log-directory and arguments that CLENotes receives are listed there similar to line below

              2013-12-12 15:15:03.292 EET: Argument: --formula=DeliveredDate = @Date(2013;12;10)