Results 1 to 4 of 4

Thread: Adding an extra line to ZimbraNotes

  1. #1
    Join Date
    Sep 2008
    Location
    Belgium
    Posts
    91
    Rep Power
    7

    Question Adding an extra line to ZimbraNotes

    Hi all,

    I'm trying to use the ZimbraNotes field as a history for my script actions. So if an action occurs on an account, it is recorded in the Notes of the account.

    It seems that zmprov can only overwrite the ZimbraNotes entry with a new one and not append to it.

    I could do it by getting the entry from the LDAP but I'd rather use the Zimbra set of tools if they permit it.

    Does anyone have any experience with this?

  2. #2
    Join Date
    Sep 2008
    Location
    Belgium
    Posts
    91
    Rep Power
    7

    Default

    Hi all,

    I'm still trying to figure this one out. Does anyone have a clue how to add a line to the "Notes" field?

    Any information or other ideas are welcome. I just want to use the field as a place to document all my automated actions.

    Thanks.

  3. #3
    Join Date
    Apr 2012
    Posts
    1
    Rep Power
    3

    Default

    Quote Originally Posted by ecobrazim View Post
    Hi all,

    I'm still trying to figure this one out. Does anyone have a clue how to add a line to the "Notes" field?

    Any information or other ideas are welcome. I just want to use the field as a place to document all my automated actions.

    Thanks.
    Hi all,

    create a file and put the lines (in my example file called "mynotes"):

    zmprov ma user@domain.com zimbraNotes "`cat mynotes`"

    or

    zmprov mdl list@domain.com zimbraNotes "`cat mynotes`"

  4. #4
    Join Date
    Sep 2008
    Location
    Belgium
    Posts
    91
    Rep Power
    7

    Thumbs up

    Hi Eric,

    Thanks for your answer. It also gives me the opportunity to post the solution I'd found but never posted.

    I hope it can help someone. The following is the function I use in my bash script:

    Code:
    function lognotes { # Add a note with the actions taken
       notes=$(zmprov ga $email zimbraNotes|grep -v ^#|sed -e 's/zimbraNotes\:\ //g')
    
       case $action in
          create)
             zmprov ma ${email} zimbraNotes "${notes}
    Account creation date: $(date) ($(date +%s))"; exitcode=$?
             logstatus $exitcode "zmprov ma ${email} zimbraNotes \"Account creation date: $(date) ($(date +%s))\""
             ;;
    
          modify)
             zmprov ma ${email} zimbraNotes "${notes}
    Account modified date: $(date) ($(date +%s))"; exitcode=$?
             logstatus $exitcode "zmprov ma ${email} zimbraNotes \"Account modified date: $(date) ($(date +%s))\""
             ;;
    
          close)
             zmprov ma ${email} zimbraNotes "${notes}
    Account close date: $(date) ($(date +%s))"; exitcode=$?
             logstatus $exitcode "zmprov ma ${email} zimbraNotes \"Account close date: $(date) ($(date +%s))\""
             ;;
          *)
             logger -p crit -t zimbra "[error: 4] A Problem was detected in the lognotes logic!"
             exit4
       esac
    }

Similar Threads

  1. Upgrade to Zimbra 7 - Table upgrade required
    By n8bounds in forum Administrators
    Replies: 10
    Last Post: 04-26-2011, 12:07 AM
  2. Replies: 13
    Last Post: 07-20-2007, 04:21 AM
  3. Is it started or not
    By kwelipatton in forum Installation
    Replies: 10
    Last Post: 03-28-2006, 11:11 PM
  4. Replies: 18
    Last Post: 10-30-2005, 09:12 PM
  5. Certify Error on (re)install
    By rodrigoccurvo in forum Installation
    Replies: 4
    Last Post: 09-23-2005, 10:04 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •