Results 1 to 2 of 2

Thread: Unable to script zmprov changes completely

  1. #1
    Join Date
    May 2008
    Location
    Des Moines, IA
    Posts
    89
    Rep Power
    7

    Default Unable to script zmprov changes completely

    Hey all, I'm running a script to normalize a build of our Zimbra product. It's a 1-server-per-small business based on the Zimbra/Samba solution. For additional information on my project click on the link next to my avatar: "todd_dsm's Zimbra Wiki Sandbox Page".

    All works well except when making some zmprov modifications to normalize the install. I've cut the script down to relevant changes in the order of execution:

    Code:
    #!/bin/bash
    export PATH=$PATH:/opt/zimbra/bin
    export PATH=$PATH:/opt/zimbra/libexec
    
    ###---
    ### Turn off Server IMAP "Enable clear text login"
    ###---
    infobreak ${LINENO} "Turning off Server imap clear text logins..."
    zmprov ms zerver.${DOMAIN} zimbraImapCleartextLoginEnabled FALSE
    check_errs $? "imap clear text logins are still enabled"
    zmprov gas -v | grep zimbraImapCleartextLoginEnabled
    
    ###--- 
    ### Insure that the Reverse Proxy Lookup Target is set to false in the Server
    ###---
    infobreak ${LINENO} "Turning off the zimbraReverseProxyLookupTarget in the Server..."
    zmprov ms zerver.${DOMAIN} zimbraReverseProxyLookupTarget FALSE
    check_errs $? "Server zimbraReverseProxyLookupTarget is still on"
    zmprov gas -v | grep -i zimbraReverseProxyLookupTarget
    
    ###--- 
    ### The Global zimbraSmtpHostname is set to localhost on a single server install
    ### Set this variable to another resolvable host if there is more than 1
    ### and you wish to use the other for processing email.
    ### NOTE: This also changes the Server > MTA > 'Web mail MTA Hostname' (zimbraSmtpHostname).
    ###---
    infobreak ${LINENO} "Insure the Global zimbraSmtpHostname resolves to:"
    echo "  Single Server: localhost"
    echo "  Multi Server: hostname of inbound MTA"
    zmprov mcf zimbraSmtpHostname localhost
    check_errs $? "zimbraSmtpHostname is still set to zerver.${DOMAIN}"
    zmprov gcf zimbraSmtpHostname
    
    ###---
    ### Now do the same for the Server 
    ###--- 
    infobreak ${LINENO} "Now setting the Server to localhost as well..."
    zmprov ms zerver.${DOMAIN} zimbraSmtpHostname localhost
    check_errs $? "Server zimbraSmtpHostname is still set to zerver.${DOMAIN}"
    zmprov gas -v | grep zimbraSmtpHostname
    
    ###---
    ### Turn off POP3 access in Global Settings:
    ### NOTE: All POP3 modifications have to be last in this script or else it will fail.
    ###---
    infobreak ${LINENO} "Turning off Global POP3SSL access in Global Settings..."
    zmprov mcf zimbraPop3SSLServerEnabled FALSE
    check_errs $? "POP3SSL is still enabled in Global Settings"
    zmprov gcf zimbraPop3SSLServerEnabled
    infobreak ${LINENO} "Turning off POP3 access in Global Settings..."
    zmprov mcf zimbraPop3ServerEnabled FALSE
    check_errs $? "Pop3 Server is still Enabled in Global Settings"
    zmprov gcf zimbraPop3ServerEnabled
    
    ###---
    ### Turn off POP3 access for clients in COS:
    ###---
    infobreak ${LINENO} "Turning off COS External POP3 access in COS..."
    zmprov mc default zimbraFeaturePop3DataSourceEnabled FALSE
    check_errs $? "POP3 Data Source is still Enabled in COS"
    zmprov gac -v | grep zimbraFeaturePop3DataSourceEnabled
    infobreak ${LINENO} "Turning off COS Internal POP3 access in COS..."
    zmprov mc default zimbraPop3Enabled FALSE
    check_errs $? "POP3 is still Enabled in COS"
    zmprov gac -v | grep zimbraPop3Enabled
    
    ###---
    ### Turn off POP3 access for clients in Server
    ###---
    infobreak ${LINENO} "Turning off POP3SSLServer access in Server..."
    zmprov ms zerver.${DOMAIN} zimbraPop3SSLServerEnabled FALSE
    check_errs $? "Pop3 SSL is still Enabled in Server"
    zmprov gas -v | grep zimbraPop3SSLServerEnabled
    infobreak ${LINENO} "Turning off POP3 access in Server..."
    zmprov ms zerver.${DOMAIN} zimbraPop3ServerEnabled FALSE
    check_errs $? "Pop3 Server is still Enabled in Server"
    zmprov gas -v | grep zimbraPop3ServerEnabled
    NOTE: The script runs without error and the check_errs function looks for a non zero exit status for each issued command. The error is encountered in the Admin UI.

    All tabs in COS and Domain look as you would expect with the changes. The Server shows some odd behaviour though:

    1) General Tab:
    "This server is a reverse proxy lookup target" is highlighted in yellow and displays the [Reset to Global value] button.
    When you click the button, the yellow highlight goes away and the button disappears.
    I would expect the change to have been made per the script and the button not to be displayed.

    2) The MTA Tab:
    "Web mail MTA Hostname" is highlighted in yellow and displays the [Reset to Global value] button.
    When you click the button, the yellow highlight goes away and the button disappears.
    Again, I would expect the change to have been made per the script and the button not to be displayed.

    3) The IMAP Tab:
    "Enable clear text login" is not checked (per the script) it's highlighted in yellow and displays the [Reset to Global value] button, and a message is displayed at the top: Note: Changes to settings requires server restart in order to take effect.
    When you click the button, the yellow highlight goes away and the button disappears.
    I would expect the change to have been made per the script and the button not to be displayed.

    4) The POP Tab:
    "Enable POP3 service" and "Enable SSL for POP3 service" are both unchecked and highlighted in yellow. The [Reset to Global value] button is displayed to the right of "Enable POP3 service", and a message is displayed at the top: Note: Changes to settings requires server restart in order to take effect.
    When you click the button, the yellow highlight and the button disappears for the "Enable POP3 service". Enable SSL for POP3 service is still highlighted in yellow with no button next to it.

    After a reboot most changes are made. The Server IMAP and POP Tabs still display the message: Note: Changes to settings requires server restart in order to take effect. "Enable SSL for POP3 service" is still unchecked but also still highlighted in yellow with no button next to it.

    There's an example of the Admin UI screen elements below.


    Q: When making these changes with zmprov is there a certain order in which the commands should be executed in order to avoid this behaviour?

    Q: What am I missing that I should be aware of?

    Q: OR is this a defect?

    Thanks in advance,
    todd_dsm

    Don't forget to Vote for this RFE:
    RFE: A place To Display the contents of 'My Documents'
    Reasoning: It's new, bold, and cool.
    Attached Images Attached Images
    Last edited by todd_dsm; 10-08-2010 at 09:35 AM.

  2. #2
    Join Date
    May 2008
    Location
    Des Moines, IA
    Posts
    89
    Rep Power
    7

    Default The script...

    I've attached a script that could be used on any test system; only the domain variable needs to be changed. This should display the behaviour.
    Code:
    # chown zimbra.root config_defaults.sh
    # chmod 4774 config_defaults.sh (to setuid bit)

    Thanks in advance,
    todd_dsm

    Don't forget to Vote for this RFE:
    RFE: A place To Display the contents of 'My Documents'
    Reasoning: It's new, bold, and cool.
    Attached Files Attached Files
    Last edited by todd_dsm; 10-08-2010 at 09:36 AM.

Similar Threads

  1. UNAUTHORIZED ACCESS Totally fouled up install
    By Lostin60s in forum Installation Help
    Replies: 0
    Last Post: 08-28-2009, 10:17 PM
  2. Domain alias with zmprov
    By Klug in forum Administrators
    Replies: 2
    Last Post: 03-25-2009, 07:49 AM
  3. Moving to different server
    By AaronW1000 in forum Installation
    Replies: 2
    Last Post: 07-03-2008, 07:39 AM
  4. Ubuntu 6.06LTS init script isn't starting Zimbra completely
    By CarputerTech in forum Installation
    Replies: 9
    Last Post: 04-12-2008, 09:01 AM
  5. zmprov in perl script keeps "stopping"
    By ronnyek in forum Migration
    Replies: 0
    Last Post: 11-30-2007, 02:24 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
  •