Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-21-2011, 11:57 PM
Loyal Member
 
Posts: 76
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?
Reply With Quote
  #2 (permalink)  
Old 08-01-2011, 11:09 PM
Loyal Member
 
Posts: 76
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.
Reply With Quote
  #3 (permalink)  
Old 04-22-2012, 04:05 AM
Starter Member
 
Posts: 1
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`"
Reply With Quote
  #4 (permalink)  
Old 04-25-2012, 04:43 AM
Loyal Member
 
Posts: 76
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
}
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.