Problem zmmailbox folder with spaces in the bash script

Whether you are a current user, former user, a Zimbra employee, or anyone with experience using any of our products, we welcome your feedback. Please include a specific product name and version when relevant.
Post Reply
rrenedo
Posts: 3
Joined: Fri Feb 05, 2016 11:46 am

Problem zmmailbox folder with spaces in the bash script

Post by rrenedo »

Hi,

I created a script to clear previous post on a specific date. In my case (01/01/2015)

I founf the following problem is that when collected by variant the name of the folder, does not recognize what's after the spaces.

 zmmailbox search -m $USER -z -l 1000 "in:$FOLDER (before: 01/01/2015)" | grep conv | sed -e "s / ^ s s * //" | sed -e "s / s s * / / g" | cut -d "" -f2`
This command fails because it says it does not recognize the folder "/ emailed"
Really the folder called "/ Emailed Contacts"

If you show the value of $ FOLDER with unn miss the result is "/Emailed Contacts". So the variant isn´t a problem but I Think  the "zmmailbox" that puts a carriage return when he sees a space command.
If I put:
 zmmailbox search -m $USER -z -l 1000 "in:/Emailed Contacts (before: 01/01/2015)" | grep conv | sed -e "s / ^ s s * //" | sed -e "s / s s * / / g" | cut -d "" -f2`
It´s working fine!!
But I need do it by script because the users have a lot of folders...

Please, someone who can help me. I need a respuesa ASAP.

Thank you very much in advance!!
rrenedo
Posts: 3
Joined: Fri Feb 05, 2016 11:46 am

Problem zmmailbox folder with spaces in the bash script

Post by rrenedo »

I'm sorry, this is the command that works for me



zmmailbox -z -m $USUARIO search -l 1000 'in:"/Emailed Contacts" (before:10/10/2016)'



But



zmmailbox -z -m $USUARIO search -l 1000 'in:"$FOLDER" (before:10/10/2016)'

Not found!! Detect /Emailed, And this folder does not exist

In the script I do a echo $FOLDER and show correctly "/Emailed Contacts"



Please, someone who can help me!! Thanks!!
Post Reply