Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: zmtrainsa doesn't accept spaces in folder name

Hybrid View

  1. #1
    phoenix is offline Zimbra Consultant & Moderator
    Join Date
    Sep 2005
    Location
    Vannes, France
    Posts
    23,587
    Rep Power
    58

    Default zmtrainsa doesn't accept spaces in folder name

    As per title. If I run zmtrainsa with a folder name of 'company/fred jones' it asks for a password and never goes any further. It doesn''t accept any single or double quotes, all folder names mut be without spaces. If I run it with a folder of 'company/fredjones' it works fine. Is this a bug?
    Regards


    Bill


    Acompli: A new adventure for Co-Founder KevinH.

  2. #2
    Join Date
    Oct 2005
    Posts
    96
    Rep Power
    10

    Default

    Quote Originally Posted by phoenix
    As per title. If I run zmtrainsa with a folder name of 'company/fred jones' it asks for a password and never goes any further. It doesn''t accept any single or double quotes, all folder names mut be without spaces. If I run it with a folder of 'company/fredjones' it works fine. Is this a bug?
    Have you tried putting a back slash in front of the space to remove any special meaning to the shell interpretor? 'this folder' becomes 'this\ folder' Same goes for single and double quotes. If preceded by the slash it then becomes a regular character.

  3. #3
    phoenix is offline Zimbra Consultant & Moderator
    Join Date
    Sep 2005
    Location
    Vannes, France
    Posts
    23,587
    Rep Power
    58

    Default

    I guess that's one of those linux 'tricks' I need to remember, unfortunately it didn't seem to work in this case.

    I forgot to post earlier that I also get a message with this problem: 'zmtrainsa: Line 38: Too many arguments'.

    So, if I understand you correctly I should try "company/fred\ jones" as the directory? Again, I tried that with double & single quotes and also in the format \"company/fred\ jones\" just in case the quotes caused the problem but no go, any other suggestions or have I missed something?
    Regards


    Bill


    Acompli: A new adventure for Co-Founder KevinH.

  4. #4
    Join Date
    Oct 2005
    Posts
    96
    Rep Power
    10

    Default

    don't use the quotes

    "company/fred\ jones" should read company/fred\ jones

  5. #5
    phoenix is offline Zimbra Consultant & Moderator
    Join Date
    Sep 2005
    Location
    Vannes, France
    Posts
    23,587
    Rep Power
    58

    Default

    Quote Originally Posted by agnOstos
    don't use the quotes

    "company/fred\ jones" should read company/fred\ jones
    Same result I'm afraid.
    Regards


    Bill


    Acompli: A new adventure for Co-Founder KevinH.

  6. #6
    Join Date
    Oct 2005
    Posts
    96
    Rep Power
    10

    Default

    Hrmm, that's what I would've tried. Are you getting the too many arguments complaint when running it that way?

  7. #7
    Join Date
    Sep 2005
    Posts
    2,103
    Rep Power
    14

    Default quoting

    I'm pretty sure this is due to bad quoting in the script on my part - I'll take a look at it tomorrow, and post a fix.

  8. #8
    Join Date
    Sep 2005
    Posts
    2,103
    Rep Power
    14

    Default patch

    I've attached a patch.

    su - root
    cd ~zimbra/bin
    cp zmtrainsa zmtrainsa.BAK
    patch -p0 < patchfile
    Attached Files Attached Files

  9. #9
    phoenix is offline Zimbra Consultant & Moderator
    Join Date
    Sep 2005
    Location
    Vannes, France
    Posts
    23,587
    Rep Power
    58

    Default

    Thanks for the patch, I applied it and got these messages:

    Code:
    patching file zmtrainsa
    Reversed (or previously applied) patch detected!  Assume -R? [n] y
    Hunk #1 succeeded at 39 with fuzz 1 (offset 4 lines).
    Hunk #2 succeeded at 58 with fuzz 2.
    That still produced the error when I ran zmtrainsa.
    I copied the original file back and tried 'n' in answer to the 'Assume -R' I got this:

    Code:
    patching file zmtrainsa
    Reversed (or previously applied) patch detected!  Assume -R? [n]
    Apply anyway? [n] y
    Hunk #1 FAILED at 39.
    Hunk #2 succeeded at 50 with fuzz 2 (offset -4 lines).
    1 out of 2 hunks FAILED -- saving rejects to file zmtrainsa.rej
    and the .rej file contained:
    Code:
    ***************
    *** 39,48 ****
             exit 1
      fi
      
    - if [ x$FOLDER != "x" ]; then
    -        FOLDER="-r $FOLDER"
    - fi
    - 
      if [ x`whoami` != xzimbra ]; then
          echo Error: must be run as zimbra user
             exit 1
    --- 39,44 ----
             exit 1
      fi
      
      if [ x`whoami` != xzimbra ]; then
          echo Error: must be run as zimbra user
             exit 1
    Sorry, I wasn't sure which one to try so I did both.
    Regards


    Bill


    Acompli: A new adventure for Co-Founder KevinH.

  10. #10
    Join Date
    Sep 2005
    Posts
    2,103
    Rep Power
    14

    Default new script

    Yeah, should have patched the M2 version, not my local copy.

    Here's the entire script - just drop it in to replace the current version.

    I named it .txt so the forums would accept it - you'll want to rename it zmtrainsa, with 755 permissions.
    Attached Files Attached Files

Similar Threads

  1. zmtrainsa recure Inbox folder
    By reza225 in forum Administrators
    Replies: 3
    Last Post: 07-26-2007, 12:13 PM
  2. zmmailbox and spaces in folder names
    By badrian in forum Administrators
    Replies: 2
    Last Post: 06-28-2007, 11:26 AM
  3. Replies: 42
    Last Post: 08-11-2006, 09:50 AM
  4. Replies: 20
    Last Post: 05-07-2006, 11:34 PM

Posting Permissions

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