Ajcody-Notes
This page holds a Table of Contents of all my pages but each main Subject is an actual link to another page. I'm hoping this gives the best of both worlds. One long page with all topics as well as pages that contain details to a specific subject.
Done by way of putting something like this on this page:
{{:Ajcody-Apple-Mac-Issues}}
And on the target page:
===Actual Apple/Mac Issues Homepage=== Please see [[Ajcody-Apple-Mac-Issues]]
Enjoy, Adam
Contents
- 1 General Notes
- 2 Logging
- 2.1 Actual Logging Homepage
- 2.2 Server
- 2.2.1 RFE's Related To Better Logging And Historical Data Of Systems
- 2.2.2 Debugging
- 2.2.3 Syslog Items
- 2.2.4 Log Rotation and Removal
- 2.2.5 What's up with all the logs?
- 2.2.5.1 Other Logging Page Resources
- 2.2.5.2 The Bread And Butter Logs
- 2.2.5.2.1 /opt/zimbra/log/mailbox.log - where most of your mailbox store activity is logged
- 2.2.5.2.2 /opt/zimbra/log/zmmailboxd.out - mailboxd/jvm output log
- 2.2.5.2.3 /opt/zimbra/log/stacktrace.<pid> - stacktrace logs
- 2.2.5.2.4 /opt/zimbra/db/data/YOURHOSTNAME.err - errors for MySQL - ZCS 4.x & ZCS 5.x
- 2.2.5.2.5 /var/log/zimbra.log - mta and system status log, postfix, amavisd
- 2.2.5.2.6 /var/log/messages - mta and OS related log events
- 2.2.5.2.7 /opt/zimbra/log/mysql_error.log - problems with MySQL
- 2.2.5.2.8 /opt/zimbra/log/myslow.log - slow db/MySQL queries
- 2.2.5.3 Other Logs
- 2.2.5.3.1 /opt/zimbra/log/audit.log - authentication events
- 2.2.5.3.2 /opt/zimbra/log/clamd.log - antivrius db
- 2.2.5.3.3 /opt/zimbra/log/convertd.log - attachment conversion
- 2.2.5.3.4 /opt/zimbra/log/freshclam.log - clam antivirus updates
- 2.2.5.3.5 /opt/zimbra/log/spamtrain.log - spam/ham training details
- 2.2.5.3.6 /opt/zimbra/log/sync.log - zimbra mobile and activesync
- 2.2.5.3.7 /opt/zimbra/log/synctrace.log - zimbra mobile and activesync
- 2.2.5.3.8 /opt/zimbra/log/syncstate.log - no description found
- 2.2.5.3.9 /opt/zimbra/log/wbxml.log - no description found
- 2.2.5.3.10 /opt/zimbra/log/zmlogswatch.out -
- 2.2.5.3.11 /opt/zimbra/log/zmmtaconfig.log -
- 2.2.5.3.12 /opt/zimbra/log/zmmyinit.log -
- 2.2.5.3.13 /opt/zimbra/log/zmsetup.`date`-'pid'.log -
- 2.2.5.3.14 /tmp/install.log -
- 2.2.5.3.15 /tmp/zmsetup.log -
- 2.2.5.3.16 /opt/zimbra/httpd_access.log -
- 2.2.5.3.17 /opt/zimbra/httpd_error.log -
- 2.2.5.4 New Data Directory In ZCS6+
- 2.2.6 Increase Logging
- 2.2.7 Want To See What's In Redolog Files
- 2.2.8 Internal Zimbra Charting - zmstat-chart
- 2.2.8.1 RFE/Bugs You Might Be Interested In
- 2.2.8.2 zmstat IS NOT Logger (graphs in admin console)
- 2.2.8.3 Main References For zmstat-chart Command
- 2.2.8.4 Issues Being Investigated With zmstat And Other "Charting" Items
- 2.2.8.5 Running zmstat-chart
- 2.2.8.6 Like To Have zmstat-chart Data Integrated With Zimbra
- 2.2.8.7 Tweaking zmstat-chart
- 2.2.8.8 Default Items Charted
- 2.2.8.9 Getting All User Quota Data With Zmsoap (not zmstat related really)
- 2.2.8.10 Getting All User Quota Data With Zmprov (not zmstat related really)
- 2.2.9 Third Party Tools (Monitoring & Logging)
- 2.3 Web Client Logging
- 2.4 Active Sessions
- 2.5 Debug (SOAP) via Browser
- 3 User Management Topics
- 3.1 Actual User Management Topics Homepage
- 3.2 Resetting A User's Account From CLI
- 3.2.1 Resetting A Password
- 3.2.2 Resetting Users Auth Session - Force Disconnect
- 3.2.2.1 Please See First - In Case Of Compromised Accounts / Spammers
- 3.2.2.2 Changing the Users Password To Expire Session
- 3.2.2.3 Prior To 605 - Use CLI To Change zimbraAuthTokenValidityValue To Expire The Session
- 3.2.2.4 8.7.6+ invalidate sessions by removing zimbraAuthTokens
- 3.2.2.5 6.0.5+ You Have Admin Console Option
- 3.3 User , Mailbox ID's, And Who Is What
- 3.4 Account & Domain Summary
- 3.5 Zmmailbox Stuff
- 3.5.1 Shares And Permissions
- 3.5.2 Searches With zmmailbox
- 3.5.3 Export & Import Of Users Data In TGZ Format
- 3.5.4 Seeing What & Where Of A Message ID
- 3.5.5 Message Count Mismatches
- 3.6 Managing Legal Requests for Information
- 3.7 Persona, Identities, Send As, Send On Behalf Of Issues
- 3.8 Sieve Rules
- 4 Ajcody Server Topics
- 5 Server Topics
- 5.1 Actual Server Topics Homepage
- 5.2 Issues Being Investigated
- 5.3 LDAP Topics
- 5.3.1 Actual LDAP Topics Homepage
- 5.3.2 LDAP Error Codes
- 5.3.3 Working With ldap Commands - The Easy Way
- 5.3.4 Anonymous Binds
- 5.3.5 Searching For Account In LDAP
- 5.3.6 Deleting An Account In LDAP
- 5.3.7 db_recover For OpenLdap DB In /opt/zimbra/openldap-data
- 5.3.8 ldapmodify Examples
- 5.3.9 db_recover For OpenLdap Accesslog DB In /opt/zimbra/openldap-data/accesslog/db
- 5.3.10 Re-indexing Openldap
- 5.3.11 Purging Logs From /opt/zimbra/openldap-data/logs
- 5.3.12 What Does - connection_read : no connection! - In zimbra.log Indicate
- 5.3.13 Change LDAP Port On Zimbra
- 5.3.14 Can't Setup/Install LDAP Replica
- 5.3.15 Disable LDAP Replica
- 5.3.16 Promoting Replica To LDAP Master
- 5.3.17 Importing LDAP data from master to replica 6.0
- 5.3.18 BDB - Underlying Database Used For LDAP Data
- 5.3.19 Ldap Replica Styles And Timeframes
- 5.3.20 LDAP And OverLays
- 5.4 GAL (Server) Topics
- 5.5 External Authentication
- 6 Ajcody MTA Postfix Topics
- 6.1 Postfix - MTA
- 6.1.1 Actual MTA & Postfix Topics Homepage
- 6.1.2 Missing main.cf Error
- 6.1.3 MTA Mail Flow - Birds-eye Overview
- 6.1.4 Understanding /var/log/zimbra.log And Postfix Log Events
- 6.1.5 Network Tracing Between A Remote Host And A ZCS MTA
- 6.1.6 Finding Messages - zmmsgtrace
- 6.1.7 How To Increase SMTP Debug Logging - MTA
- 6.1.8 Simple Troubleshooting For SMTP Via Telnet, Openssl
- 6.1.8.1 First - Understanding Your Authentication Requirements In ZCS
- 6.1.8.2 Second - Encoding Username And Passwords For AUTH Sequence
- 6.1.8.3 For ESMTP Auth is LOGIN - Example
- 6.1.8.4 For ESMTP Auth is Plain - Example
- 6.1.8.5 For TLS/SSL - Example
- 6.1.8.6 To Confirm An Auth User Can't Send With Another FROM Address
- 6.1.9 Adding A New MTA Server
- 6.1.10 Load Balancing For SMTP - Out Bound Mail
- 6.1.11 User Alias Mapping And Mail Transport with Postfix & LDAP
- 6.1.12 Traditional Aliases Use - /etc/aliases Type Lookups
- 6.1.13 Allowing Accounts To Change The From Address
- 6.1.14 Creating A Domain Alias
- 6.1.15 Relay Domain Forwarding
- 6.1.16 Domain Catchall
- 6.1.17 Rewriting From Address For Outbound Email
- 6.1.18 Rewrite Recipient Address For Incoming Email
- 6.1.19 Automatic BCC
- 6.1.20 Limiting Or Increasing Number Of Recipents / Messages
- 6.1.21 Controlling SMTPD Client Connections
- 6.1.22 Restrictions
- 6.1.23 Spam Control And Related Issues
- 6.1.23.1 High Over View Steps Of What To Do
- 6.1.23.2 Who's My Spammer?
- 6.1.23.3 Resources
- 6.1.23.4 Blocking MAIL FROM - smtpd_sender_restrictions - Default Is Empty
- 6.1.23.5 Some Other SMTP Sending Restrictions
- 6.1.23.6 What's Your SPF Records Say, When Getting "does not designate 74.x.x.x as permitted sender Errors"
- 6.1.24 Using Different SMTP Server For Webclient (ZWC), Mobiles, And ZCO
- 6.1.25 Global Or System Wide Filters
- 6.1.26 Global Disclaimer Options
- 6.1.27 Quota Issues
- 6.1.27.1 Where To Adjust Message User Gets When They Are Over Quota
- 6.1.27.2 See Current User Qoutas
- 6.1.27.3 Controlling Behavior For Messages Sent To Over Quota Mailbox - LMTP
- 6.1.27.4 Controlling Behavior For Messages Sent To Over Quota Mailbox - SMTP
- 6.1.27.5 Message Senders Receive About Mailbox Over Quota
- 6.1.27.6 Quota Not Showing In Admin Console - After ZCS Upgrade
- 6.1.28 Managing Postfix Queue
- 6.1.28.1 Postfix, Amavis, Clamav Spool Directory Paths And Names
- 6.1.28.2 Stop And Starting Postfix And Mta
- 6.1.28.3 To See Postfix Queue
- 6.1.28.4 To View A Message In The Queue
- 6.1.28.5 To Flush Postfix Queue
- 6.1.28.6 To Requeue Messages In Postfix
- 6.1.28.7 To Put Messages On Hold
- 6.1.28.8 To Delete Messages From Queue
- 6.1 Postfix - MTA
- 7 Ajcody MySQL Topics
- 7.1 Mysql
- 7.1.1 Actual Mysql Topics Homepage
- 7.1.2 Mysql Issues And Memory Usuage
- 7.1.3 IO_DIRECT And Ext3 On Linux As Possible Reason For Corruption
- 7.1.4 Mysql Backup And Restore
- 7.1.5 Mysql Database Corruption/Repair/Checks
- 7.1.6 Manual Change Of Mysql Passwords
- 7.1.7 Working Within Mysql For Accounts
- 7.1.8 Useful Mysql Query Examples
- 7.1.8.1 First - Get User Variables we need to query MySQL
- 7.1.8.2 Mysql Query For A Users Specific Blob-Data ID
- 7.1.8.2.1 Content Of Message Example Above As On Filesystem
- 7.1.8.2.2 The Message On The Filesystem - id index_id imap_id
- 7.1.8.2.3 mod_metadata And mod_content
- 7.1.8.2.4 Mysql Query For date And change_date For ALL id's For A Specific User
- 7.1.8.2.5 Confirming subject Matches Subject Line In Message
- 7.1.8.3 Mysql Query For Subject Line In Message Of A Specific User
- 7.1.8.4 Mysql Query For ALL Message ID's Of A User
- 7.1.8.5 Mysql Query For ALL Message ID's In A Particular Folder Of A User
- 7.1.8.6 The Query For ALL Appointments For A Particular User
- 7.1.8.7 Mail Items Received Per Day
- 7.1.8.8 All Blobs Associated With A Particular Volume ID
- 7.1.9 Mysql Tables
- 7.1.10 Mysql Database Location On Filesystem
- 7.1.11 Getting The Size Of The Mbox Tables In MBs
- 7.1.12 Misc Issues Related To Mysql
- 7.1.13 Third Party Tools And References
- 7.1 Mysql
- 8 Ajcody Logger Issues
- 8.1 Actual Logger Issues Homepage
- 8.2 Logger and ZCS 6.x+
- 8.3 Logger Related Bugs
- 8.4 Logger Not Working , No Stats, Services Show Not Running In Admin Console
- 8.5 Large Logger Database Killing Performance Of ZCS
- 8.6 Reinitializing Logger Database From Scratch
- 8.7 Turning Off Logger
- 8.8 Customization Or Modification Of Swatch Config
- 8.9 Lucene
- 9 Ajcody Notes Archive Discovery
- 9.1 Actual Archive & Discovery Notes Homepage
- 9.2 References for A&D
- 9.3 But I Just Want Some BCC's To Happen - Not All This A&D Stuff
- 9.4 But We Have A Non-Zimbra MTA - zimbraSmtpHostname & zimbraMtaRelayHost Pointed To External Device
- 9.5 Notable Bugs Or RFE's
- 9.5.1 Archive Stop Working After Upgrade Or Disabling Anti-Spam - Anti-Virus
- 9.5.1.1 First - Short & Sweet How-To On CLI With Single ZCS 8.6 Server
- 9.5.1.2 When Was A ZCS Service Enabled Or Disabled
- 9.5.1.2.1 Check Current Status Of Services Enabled-Disable and Installed-NotInstalled
- 9.5.1.2.2 Check Backups And What LDAP Has Stored
- 9.5.1.2.3 Check The History Of The Service Status In zimbra-stats.log
- 9.5.1.2.4 Check The Logger/RRD Data And Service History Uptime
- 9.5.1.2.5 Check The audit.log File For Service Enable Changes
- 9.5.1.2.6 Check The zmsetup logs For Changes During Installation/Re-installs
- 9.5.1.2.7 Check The Zimbra Users BASH History File and .zmprov_history
- 9.5.2 Getting Duplicate Emails In The Archive Account
- 9.5.3 Archiving Issues When Using 3rd Party MTA's
- 9.5.1 Archive Stop Working After Upgrade Or Disabling Anti-Spam - Anti-Virus
- 9.6 Pre-Deployment Type Questions
- 9.6.1 How To Add OLD Data Or Retroactively Add Data To A&D Account
- 9.6.2 Can we set the archive settings for only sent mail?
- 9.6.3 Can we set the archive settings for only form port 25?
- 9.6.4 If Zimbra implemented an archive feature, is something in the following MTA files changes?
- 9.6.5 Using One Archive Account For Multiple Accounts
- 9.6.6 External Host For Archive Accounts Setup
- 9.7 Multi-Server & New Mailstore A&D Setup
- 9.7.1 Ajcody Multi-Server & New Mailstore A&D Setup Homepage
- 9.7.2 Actual Multi-Server & New Mailstore A&D Setup Homepage
- 9.7.3 Issues That Have Caused Confusion
- 9.7.4 The How-To
- 9.7.4.1 Reference Documents
- 9.7.4.2 Assumptions
- 9.7.4.3 Preliminary Items
- 9.7.4.4 Installation Of New Mailstore That Will Have A&D
- 9.7.4.5 Upgrading A Zimbra Server For An Archive & Discovery Mailstore
- 9.7.4.6 Configure Zimbra For Use Of The New Mailstore and A&D
- 9.7.4.7 Setup Initial A&D With First Account - Creation Of The Archive Domain
- 9.7.4.8 Testing Of Archive Mail Flow
- 9.7.4.9 Archive Account Isn't Getting Email
- 9.7.4.10 Checking Logs For Archive Operations
- 9.7.4.11 Mass Accounts Configuration
- 9.7.4.12 Searches After Configuration Is Done
- 9.7.4.13 Searches Limited To 500 or 1000 Maximum Results
- 9.8 Special Circumstance Case Scenarios
- 9.9 Domain Admin Searches For ZCS6
- 9.10 service.UNKNOWN_DOCUMENT Error When Trying Search
- 9.11 How To Turn Off / Disable ALL A&D Processing From Admin Web Console
- 9.12 How To Turn Off / Disable A&D For An Account
- 9.13 What Accounts Are Set For Archive And Checking Against License Usuage
- 9.14 Need To Find A&D Accounts On Wrong MailStore To Move Them
- 9.15 Renaming Production Domain And Want To Also Rename Archive Domain
- 10 Ajcody HSM Or Hierarchical Storage Management
- 10.1 Actual HSM Or Hierarchical Storage Management Homepage
- 10.2 General Q&A
- 10.2.1 What's It Look Like - Big Picture
- 10.2.2 Backup And HSM
- 10.2.3 HSM Impact With Backups
- 10.2.4 HSM Impact To Server Performance
- 10.2.5 HSM Running During ZCS Restarts
- 10.2.6 How Does HSM Determine When To Move Message?
- 10.2.7 HSM And Attachments - Any Options?
- 10.2.8 Aging Policy Options For HSM Data
- 10.2.9 What Doesn't Get HSM'd?
- 10.2.10 Does The Mailbox Go Into Maintenance Mode?
- 10.2.11 HSM Logging
- 10.2.12 More Than One HSM Volume (Secondary Message Store)
- 10.2.13 HSM/Secondary Volume for Spam & Junk
- 10.2.14 Consistency Checking Tool For HSM
- 10.2.15 What If HSM Volume Becomes Full?
- 10.2.16 Restoring HSM Volumes - RFE
- 10.3 A How-To Example - CLI
- 10.3.1 Introduction
- 10.3.1.1 Create The HSM Volume
- 10.3.1.2 Set HSM Volume To Current
- 10.3.1.3 Starting HSM For First Time
- 10.3.1.4 Adjusting the zimbraHsmPolicy variable - ZCS 6+
- 10.3.1.5 Adjusting the zimbraHsmAge variable - Deprecated since: 6.0.0_BETA2.
- 10.3.1.6 RFE - To Move Msg's Back To Primary Store
- 10.3.1.7 Now What? Place In Cron
- 10.3.1.8 Checking For The HSM Zimlet
- 10.3.1.9 Deploying The HSM Zimlet
- 10.3.1 Introduction
- 10.4 What Can I Do For HSM In The Admin Web Console?
- 10.5 References From Official Documentation
- 10.6 A Proxy On You!
- 10.6.1 Actual Proxy Notes Homepage
- 10.6.2 Very Rough Draft For Proxy Trouble Shooting Script - More of steam of consciousness really
- 10.6.3 UPDATE PLEASE SEE THESE FIRST
- 10.6.4 My Own Proxy How-To For Setup
- 10.6.5 Proxy References
- 10.6.6 What's Wrong?
- 10.6.7 Notable Proxy Bugs
- 10.6.8 Single ZCS Server
- 10.6.9 Proxy Guide Rewrite Scratch Pad
- 10.7 Clustering Topics
- 10.7.1 Actual Clustering Topics Homepage
- 10.7.2 My Other Clustering Pages
- 10.7.3 Clustering For ZCS 8 And Above
- 10.7.4 Vmware Virtualization and Clustering
- 10.7.5 Critical Bugs/RFE's - False Restarts And So Forth
- 10.7.6 Good Summary For RHEL Clustering
- 10.7.7 Active-Active Clustering
- 10.7.8 Non-San Based Fail Over HA/Cluster Type Configuration
- 10.7.9 RFE's/Bug Related To Supporting Clustering Options
- 10.7.10 Other Clustering RFE's And Bugs
- 10.7.11 HA-Linux (Heartbeat)
- 10.8 Virtualization Issues
- 10.8.1 Actual Virutalization Issues Homepage
- 10.8.2 Vmware - ESX - Performance & Support Resources
- 10.8.3 Vmware And Clustering
- 10.8.4 Introduction To Using VMWare ESX For ZCS Test Servers
- 10.8.5 How-To Setup ESX For ZCS Test Servers
- 10.8.6 Optional Setups To Enhance Your Test Environment
- 11 Ajcody Backup & Restore Issues
- 11.1 Actual Backup & Restore Issues Homepage
- 11.2 Information To Provide When Submitting A Support Case For Backup Issues
- 11.3 Restore Compatibility Between ZCS Versions
- 11.4 NFS Use For Backups
- 11.5 Restore For Disaster Recovery
- 11.6 Performance Issues And Time To Complete
- 11.7 Understanding Option Flags For zmbackup & zmrestore
- 11.8 An Overview Of Some Backup/Restore Items
- 11.8.1 Shared Blobs (messages)
- 11.8.2 Remote copies of backup data for DR use
- 11.8.3 What's Needed For Later Restores
- 11.8.4 Mysql Table That References Most Recent Backup Session Of Users (AutoGroup Backup Mode)
- 11.8.5 Restore Requires accounts.xml File
- 11.8.6 Change "Location" For Backup Or Restore Source Data
- 11.8.7 Manual Removal Of Older Backup Sessions
- 11.9 LDAP Backup Related Items
- 11.10 A Way To Verify Backup Integrity
- 11.11 Auto-Group Backups Rather Than Default Method Topics
- 11.11.1 General Description And Official References
- 11.11.2 Bugs - RFE's To Review For Auto-Group
- 11.11.3 Enabling Auto-Group For Backups - Schedule In Crontab
- 11.11.4 Some Variables For Auto-Group
- 11.11.5 Auto-group And Redologs
- 11.11.6 Problems Switching To Auto-Groups Because It Wants To Run A Full Against All Accounts
- 11.12 Backup And Deletion Schedule - zmschedulebackup
- 11.13 The Zip - Compression Option For Backups
- 11.14 General Backup & Restore Debugging
- 11.15 Redolog Files
- 11.15.1 Redologs Copied To Backup Session And When Deleted
- 11.15.2 Redolog Sequence And The Backup Session
- 11.15.3 RedoLog Variables
- 11.15.4 Want To See What's In Redolog Files
- 11.15.5 zmplayredo And zmredodump
- 11.15.6 Getting A Sequence or Time Variable For Restore Or Replay
- 11.15.7 How Do I Figure Out Which Sequence or Time Variable To Use For Restore Or Replay
- 11.15.8 Are You Messages Really Gone - Things To Check If zmplayredo Isn't Doing What You Expect
- 11.15.9 Gap In Redo Log
- 11.15.10 Error Executing redoOp
- 11.16 Why Do My Fulls Not Report All Accounts?
- 11.17 Issues After /opt/zimbra/backup Became Full
- 11.18 Query And Stopping A Backup or Restore In Progress
- 11.19 Restore To Time Problems
- 11.20 Restore An Individual Message
- 11.21 User Deleted A Bunch Of Data And Notified You Hours Later Wanting It Restored
- 11.22 Restore Deleted Items - skipDeletes Option - ZCS6+
- 11.23 Restore Account Not Yet In Backups
- 11.24 How To Restore To Events Within The Same Day
- 11.25 Can't Restore Or Find An Account That Was Renamed
- 11.26 Quota Is Stopping A Redirected Restore
- 11.27 Restore Of Non-Account Items - Example - COS DL Etc
- 11.28 Restoring A Calendar (ics)
- 11.29 Archiving User Accounts Out Of Production Use In Zimbra
- 11.30 Use Of REST And Other Tools For Specific User Data
- 11.31 Use Of The REST Command To Export ALL User Data - Version Dependant, 5.0.9+ [I believe]
- 11.32 Backup And HSM
- 11.33 Using zmprov -l gaa To Create User Listing for zmbackup & zmrestore -a option
- 11.34 Scripting Out Individual Backups Of Accounts
- 11.35 Finding Message Blob In Users Backup
- 11.36 Backing Up Backups - 3rd Party Tools And Software - Dealing With Directories With Hard Links
- 11.36.1 Description Of Hard Links
- 11.36.2 Hard Links Used Within Zimbra Backup Directory - Sessions
- 11.36.3 Bacis Unix Commands
- 11.36.4 3rd Party Backup Tools And Software - Generally Not Apart Of The Basis OS
- 11.36.4.1 Amanda And Zmanda
- 11.36.4.2 Arkeia
- 11.36.4.3 Backup Exec - Symantec / Veritas
- 11.36.4.4 BackupPC
- 11.36.4.5 Bacula
- 11.36.4.6 BRU - TOLIS Group
- 11.36.4.7 Lone-Tar - Lone Star Software Corp.
- 11.36.4.8 NetBackup - Veritas/Symantec
- 11.36.4.9 NetVault - ORBiT
- 11.36.4.10 rsnapshot
- 11.36.4.11 Tivoli - IBM
- 11.36.5 Other Related Items
- 11.37 NO_SUCH_BLOB Errors
- 11.37.1 Actual No Such Blob Homepage
- 11.37.2 Other Resource Overviews
- 11.37.3 Check Permissions First
- 11.37.4 Perl To Find MailboxID's That Have Problem
- 11.37.5 Zmblobchk for 5.0.6+ Systems
- 11.37.6 BLOB Issue Script
- 11.37.7 The Really Bad Situation, Blob References Gone & Mail Still Missing
- 11.37.8 Notes On - No Associated Metadata
- 11.37.9 Mysql Queries To See What Is Shown For Missing Message ID
- 11.38 Mailing Lists, Distribution Lists, And Mailman
- 11.38.1 Actual Mailing Lists And Mailman Notes Homepage
- 11.38.2 Introduction And Choices - When Email Lists Have More Than 1000+ Recipients
- 11.38.3 Restricting Who Can Send To Mailing List
- 11.38.4 Restrict Sending To Certain Domains
- 11.38.5 Add Everyone To Distribution List - Admin Console
- 11.38.6 Everyone@domain Without Manually Adding Users To A DL
- 11.38.7 Problems Resolving Virtual Aliases For Members Of Large Distribution Lists
- 11.38.8 Mailman - Mailing List Manager
- 11.38.9 Sympa - Mailing List Manager
- 11.38.10 Duplicate Emails With Distribution Lists
- 11.38.11 Confirming Hard Links With Message Blobs To DL On Filesystem
- 11.39 SSL Certificate Issues
- 11.39.1 Actual SSL Certificate Issues Homepage
- 11.39.2 Resources For SSL Certificates
- 11.39.3 Bug & RFE's Related To SSL
- 11.39.4 Recreating Self-Signed SSL Certificates
- 11.39.5 Contrib from Baylink
- 11.39.6 Ldap And-Or MTA Doesn't Start After Cert Changes Or Upgrade
- 11.39.7 Moving Your Certificates To New Or Another Server
- 11.39.8 Commercial Cert Error - Subject Does Not Start With /
- 11.39.9 How To Setup Certs With CACert.org - Free Certs
- 11.40 ZCA Appliance Topics
- 11.41 Zimlets
- 11.41.1 Actual Zimlet Notes Homepage
- 11.41.2 Zimlets In ZCS 8+
- 11.41.3 Zimlet Changes In ZCS 6
- 11.41.4 Location Of Zimlets
- 11.41.5 How To List Currently Installed Zimlets
- 11.41.6 How To Deploy Zimlets
- 11.41.7 How To Undeploy / Uninstall Zimlets
- 11.41.8 Samba & Posix Zimlet - ZCS 6x
- 11.41.9 Samba & Posix Zimlet - ZCS 5x
- 11.41.9.1 Main Samba & Posix How-To Reference
- 11.41.9.2 Important Bugs-RFE's Related To Samba Posix Issues
- 11.41.9.3 Samba - LDAP - Overlays
- 11.41.9.4 Can't Manage Users After Removing Samba & Posix Zimlet
- 11.41.9.5 I Lost My Users After An Upgrade - Samba Posix Zimlet
- 11.41.9.6 Upgrade Or Installation Of New Package On Zimbra Broken Samba - Another Situation
- 11.42 Hostname And DNS Issues
- 11.43 IM - Instant Messaging
- 11.43.1 Actual Instant Messaging Topics Homepage
- 11.43.2 ZCS 8.6 And Above IM Topics
- 11.43.3 Pre ZCS 8.6 IM Topics
- 11.43.4 When Will IM Be Out Of Beta - Update
- 11.43.5 Performance Issues Caused By IM [BETA]
- 11.43.6 Enabling IM [BETA] - 5+ ZCS Server
- 11.43.7 What Happen to AOL IM and MSN?
- 11.43.8 3rd Party Client Setup Up Examples
- 11.43.9 ZCS to ZCS IM Availability
- 11.43.10 Integration With External IM Servers
- 11.43.11 IM And Legal Intercept And Archiving
- 11.43.12 IM - Conference Rooms
- 11.43.13 Embedded IM Requests To Join Chat Session In Html/Email
- 11.43.14 Buddy Notification In ZWC
- 11.43.15 Other General Bugs & RFE's
- 11.43.16 Multi-Mailbox Setup Can Not Message Between Each Other
- 11.43.17 IM And DNS SRV Records
- 12 Ajcody Server Misc Topics
- 12.1 Miscellaneous Server Topics
- 12.1.1 Actual Miscellaneous Server Topics Homepage
- 12.1.2 Mailbox Purge - Trash And Spam Lifetime And More
- 12.1.2.1 Variables Around Lifetime And Purge
- 12.1.2.1.1 Where To Modify In Admin Console or ZWC
- 12.1.2.1.2 How Purges Function Vs Time Variables - Admin Variables
- 12.1.2.1.3 Basics On Editing Variables From CLI
- 12.1.2.1.4 User Level Variables They Can Modify
- 12.1.2.1.5 Admin Level Variables That Users Can't Modify
- 12.1.2.1.6 Dumpster Specific
- 12.1.2.1.7 Dumpster Specific Commands
- 12.1.2.1.8 Checking A Users Dumpster Total Size
- 12.1.2.1.9 Dumpster Related Bug-RFEs
- 12.1.2.2 User UI Elements To Manage Message Retention And Message Disposal - If User Is Enabled For It
- 12.1.2.1 Variables Around Lifetime And Purge
- 12.1.3 Setting A Default Domain For User Login
- 12.1.4 Virtual [vhost] Hosting
- 12.1.5 Domain And User "Status" Changes
- 12.1.6 Cross Mailbox Searches and Tracing
- 12.1.7 Deferred Emails - Error Of Connection Refused
- 12.1.8 What's my time and timezone?
- 12.1.9 Volumes & zmvolume
- 12.1.10 Convertd
- 12.1.11 Domain Rename Issues
- 12.1.12 ZCS Service Can't Start Because Of Port In Use
- 12.1.13 Changing Default Port 80 - No Proxy In Use And Single Server Example
- 12.1.14 Themes, Branding, Logos, And Other UI Customizations
- 12.1.15 Sending Email From The CLI (Command line) On Zimbra Server
- 12.1.16 Role Based Administration - Expansion Of Permission & Function Model For Admin Roles
- 12.1.17 Spammers
- 12.1.18 Mass Importing / Exporting Of Things (Tasks, Notes, Documents, Briefcase, etc.)
- 12.1.19 Inter-Domain (Company To Company) Item Access [Sharing?] Via Rest
- 12.1.20 Rest Url's And Spaces , White Spaces, %20
- 12.1.21 Faster Way To Get Directory Size On Filesytem - find vs du
- 12.1.22 Free Busy, FreeBusy, FB, F/B Topics
- 12.1.23 WedDAV Topics
- 12.1.23.1 Actual WebDAV Homepage
- 12.1.23.2 WebDAV & Davfs2 - Briefcase - Documents - Notebook
- 12.1.23.3 Third Party Webdav Clients
- 12.1.23.4 General Bugs And RFE's
- 12.1.23.5 Max File Upload Size
- 12.1.23.6 Apple - Mac
- 12.1.23.7 Windows - General
- 12.1.23.7.1 Windows Bugs & RFE's
- 12.1.23.7.2 References
- 12.1.23.7.3 Internet Explorer - IE
- 12.1.23.7.4 Internet Explorer - IE - WinXp Trick
- 12.1.23.7.5 How-To For Windows 7, ZCS 6.0.6, And Mapping Webdav Drive
- 12.1.23.7.5.1 IE Performance Work Around
- 12.1.23.7.5.2 Setup Authentication Type For Webdav
- 12.1.23.7.5.3 Turn Off File Locking - Optional
- 12.1.23.7.5.4 Confirm WebClient Service To Automatic
- 12.1.23.7.5.5 Mounting The Zimbra WebDAV Share Via File Explorer
- 12.1.23.7.5.6 Mounting The Zimbra WebDAV Share Via CMD
- 12.1.23.7.6 How-To For Windows 7, ZCS 6.0.6, And Webdrive
- 12.1.23.8 Linux
- 12.1.23.9 Firefox
- 12.1.24 RSS
- 12.1.25 Zimbra And Alfresco
- 12.1 Miscellaneous Server Topics
- 13 Testing & Debugging Tools
- 13.1 Actual Testing & Debugging Homepage
- 13.2 Other Debug References
- 13.3 RFE's Related To Better Logging And Historical Data Of Systems
- 13.4 Various Errors And Log Items One Might See
- 13.4.1 Logging
- 13.4.2 Connections And Or Threads Mentioned In mailbox.log
- 13.4.2.1 Tuning Variables Related To Threads And Connections
- 13.4.2.1.1 zimbraHttpNumThreads
- 13.4.2.1.2 zimbraPop3NumThreads
- 13.4.2.1.3 zimbraImapNumThreads
- 13.4.2.1.4 zimbraLmtpNumThreads
- 13.4.2.1.5 mailboxd_java_options
- 13.4.2.1.6 mailboxd_java_heap_memory_percent
- 13.4.2.1.7 zimbraMessageCacheSize
- 13.4.2.1.8 zimbra_mysql_connector_maxActive
- 13.4.2.1.9 zimbraXMPPEnabled
- 13.4.2.1 Tuning Variables Related To Threads And Connections
- 13.5 Zimbra Tools And Commands
- 13.6 Trouble Shooting Memory Issues
- 13.7 Non-Zimbra Tools
- 14 Disk Full Issues
- 14.1 Actual Disk Full Issues Homepage
- 14.2 Read First - Zimbra Support Is Not Your Appropriate Support Contact For Storage Modifications
- 14.3 Running Out Of Disk Space - Information To Share With Support
- 14.3.1 Notable Bugs In ZCS That Cause Unnecessary Disk Growth Or Consumption
- 14.3.1.1 Large /opt/zimbra/logger/db/data/rrds Directory
- 14.3.1.2 Large /opt/zimbra/data/amavisd/.spamassassin Directory
- 14.3.1.3 Large /opt/zimbra/data/ldap/mdb/db/ Directory Because Of The data.mdb File
- 14.3.1.4 Very Fast Growing zimbra.log And mail.* in /var/log Directory
- 14.3.1.5 Dumpster Issues
- 14.3.1 Notable Bugs In ZCS That Cause Unnecessary Disk Growth Or Consumption
- 14.4 Adding A New Primary Store Volume How-To
- 14.5 Adding A New HSM Volume How-To - 1 Total
- 14.6 Adding A Second HSM Volume How-To - Having One Active HSM and on Inactive HSM Volume - 2 Total
- 14.7 Adding Additional Storage - Vmware Virtual Machine Example
- 14.8 ZCA - Zimbra Appliance - Manually Adding And Expanding The Disk Partitions
- 14.9 Checking Your Dumpster Settings And Purging
- 15 Ajcody Client Topics
- 15.1 Actual Client Topics Homepage
- 15.2 Official End User Guides And How-To's
- 15.3 Bugs-RFE's
- 15.4 Section 508 , VPAT, ADA, And Accessibility
- 15.5 Zimbra Web Client
- 15.5.1 Setting ZWC As Default Mail Client - Mailto
- 15.5.1.1 Seeing What Is Currently Set For Mailto Handler In Various Browsers
- 15.5.1.2 ZCS 8 And RFE To Set ZWC As Default Mail Client
- 15.5.1.3 Most Complete Solution For Windows - Full Mailto & MAPI Calls Mapping via Zimbra Notifier
- 15.5.1.4 Windows Mailto To Use ZWC Advance Ajax Client or Basic HTML Client Interface
- 15.5.1.5 Windows 7 Mailto Registry Key
- 15.5.1.6 Windows Xp And Windows 98 MailTo Setup
- 15.5.2 Conversation Views
- 15.5.3 Read & Delivery Confirmation Receipt
- 15.5.4 Web Client Search
- 15.5.5 Email To Attachment Or Saved To Desktop
- 15.5.6 Date Format date_zimlet Issues
- 15.5.1 Setting ZWC As Default Mail Client - Mailto
- 15.6 General CALDAV Issues
- 16 Ajcody Apple Mac Issues
- 16.1 Actual Apple/Mac Issues Homepage
- 16.2 App To Help Enable Debugging Options
- 16.3 Outlook 2011 For Mac And EWS Setup
- 16.4 Contact Related Items
- 16.5 Entourage And Calendars
- 16.6 iCal General Issues
- 16.6.1 Clearing iCal cache
- 16.6.2 Can't see items in shared Calendar
- 16.6.3 Calendar events are displaying the wrong time
- 16.6.4 Alarm & Calendar Notification Issues with iCal
- 16.6.5 iCal calendar color changing modifies calendar name and/or doesn't retain color
- 16.6.6 Colors for Calendar & Appointments (Non-client specific)
- 16.6.7 Calendar Ordering Issues
- 16.6.8 Directory Access configuration on Macs
- 16.6.9 Calendar Invites can't be imported into iCal
- 16.6.10 Mac clients cause spamming of invitation events when they adjust calendar events
- 16.7 Calendar.app 10.9.5 With ZCS 8.5+
- 16.8 iCal 10.5 - CalDAV Issues
- 16.8.1 Logging-Debug for CalDAV+iCAL
- 16.8.2 Only Seeing 1 Month Back and 1 Year Ahead In CalDAV
- 16.8.3 Not seeing Calendar's In iCAL/CALDAV
- 16.8.4 iCal And Entourage Use for Calendars - Leopard/10.5 users
- 16.8.5 Can't see Calendars after configuring Z-iSync for CALDAV - 10.5 users
- 16.8.6 Trick to work around address lookup for the Attendee field in iCal Events
- 16.8.7 Attendee Lookups for iCALv3/MacOS10.5
- 16.8.8 Free/Busy Lookup not working as expected
- 16.8.9 iCal-CalDAV - server doesn't retain color information from iCal
- 16.8.10 New Calendars Made With iCal-CalDAV Are Being Shared Out
- 16.8.11 Can't Select Which Calendars To Sync - I Could With 10.4 Though
- 16.8.12 iTunes & iPhone configuration for CALDAV
- 16.9 iCal 10.4 - iSync Issues
- 16.10 Sync To Do/Tasks Items in Leopard
- 16.11 Outlook
- 16.11.1 General Outlook Issues
- 16.11.2 ZCO Zimbra Outlook Connector
- 16.11.2.1 Supported Versions Of Windows, Outlook, ZCO
- 16.11.2.2 ZCO 5.0.10 Release
- 16.11.2.3 ZCO 5.0.7+
- 16.11.2.4 The complete troubling-shooting guide (dev info requests)
- 16.11.2.5 Performance Issues
- 16.11.2.6 Can't Send Via Send To -> Mail Recipient
- 16.11.2.7 Saving Current Profile Out To Then Re-Import
- 16.12 Thunderbird , Lightning, Firefox
- 16.13 Gnome Evolution And KDE Kontact
- 16.14 Zimbra Desktop [ZD]
- 16.15 IM - Instant Messaging Clients
- 16.16 Other Topics
- 17 Mobile & Phone Issues
- 17.1 Actual Mobile & Phone Topics Homepage
- 17.2 Help Me Understand the Mobility Options
- 17.3 Forum Support For Mobile Options
- 17.4 General Mobile Issues
- 17.5 Zimbra Mobile And ActiveSync Technology
- 17.6 Mobile Management Features
- 17.7 Windows Mobile Emulator For Testing
- 17.8 Android Emulator For Testing
- 17.9 Android Email Clients
- 17.10 Android And Multiple Calendars
- 17.11 iPhone General Topics
- 17.12 iPhone 2+ Topics
- 17.13 BES Connector Issues
General Notes
Actual General Notes Homepage
Please see Ajcody-General-Notes
Zimbra Variables
Ways to check on different zimbra variables.
su - zimbra zmlocalconfig -i zmlocalconfig -d cd /opt/zimbra/conf/attrs more zimbra-attrs.xml cd /opt/zimbra/openldap/etc/openldap/schema/ more zimbra.schema
Made the following concerning zmlocalconfig's behavior:
- "RFE: zmlocalconfig sanity check and clean up of -i output"
Also, with newer versions of ZCS, you can get it via zmprov - for example:
#zmprov desc -a zimbraFreeBusyExchangeAuthScheme zimbraFreebusyExchangeAuthScheme auth scheme to use type : enum value : basic,form callback : immutable : false cardinality : single requiredIn : optionalIn : cos,domain,globalConfig,account flags : accountInherited,domainInherited defaults : min : max : id : 611 requiresRestart : since : 5.0.3 deprecatedSince :
Addition note, example, for those checking source : src/6.0.7/com/zimbra/cs/account/ProvUtil.java.html
Zimbra Contact Fields For CSV Import Mapping
Please see /opt/zimbra/conf/zimbra-contact-fields.xml
This will show you what "fields" Zimbra is looking for and mapping to in regards to importing from another applications contact csv files.
One easy way to do this is the following:
- From zimbra ajax client as a test user (or any old user) do an export Addressbook.
- This is under the preference tab > Address Book > Import / Export > Export - select Addressbook and click Export button
- Then open file file something like Excel or a Text Editor
- Your only interested in the Top line - that gives the default fields for a Zimbra Addressbook.
- You'll get something like this:
"company","companyPhone","email2","fileAs","firstName","homepageURL","imAddress3","lastName","otherIMLabel","workCity","workCountry","workEmail2","workEmail3","workEmail4","workEmail5","workPostalCode","workState","workStreet"
- Note, ordering [left to right] isn't important. What is important, is the data lines up under the right column header.
- With your other Mail system, export the addressbook to a csv file.
- Open this file in another Excel window.
- Copy the column data from the one Excel sheet and paste it into the appropriate column within the Zimbra Excel sheet.
- Move as much as you can and then save.
- For example:
"company","companyPhone","email2","fileAs","firstName","homepageURL","imAddress3","lastName","otherIMLabel","workCity","workCountry","workEmail2","workEmail3","workEmail4","workEmail5","workPostalCode","workState","workStreet" "Apple Computer Inc.","1-800-MY-APPLE","","3","","http://www.apple.com","","","","Cupertino","United States","","","","","95014","CA","1 Infinite Loop"
- Now you can try importing this csv file back into Zimbra.
- Either with the webclient or you can use some on the CLI commands
- See User_Migration for variations of CLI commands that could be used.
- Here's the documented example:
curl -u schemers:password --data-binary @/tmp/new.csv http://server/service/home/schemers/contacts?fmt=csv
Example Header For Horde Contacts
I have not used this myself, I found it on the forums.
"assistantPhone","birthday","callbackPhone","carPhone","company","companyPhone","email","email2","email3","firstName","fullName","homeCity","homeCountry","homeFax","homePhone","homePhone2","homePostalCode","homeState","homeStreet","homeURL","imAddress1","imAddress2","imAddress3","jobTitle","lastName","middleName","mobilePhone","notes","otherCity","otherCountry","otherFax","otherPhone","otherPostalCode","otherState","otherStreet","otherURL","pager","workCity","work"
I'm hoping the forum user simply renamed the top header column to match description fields that Zimbra knows and that it's in order of the data (left to right) that Horde normally exports in. You'll need to review it and make sure it fits with your exported data columns from Horde.
Admin With Curl And Wget
You will most likely need to include :7071 in the url string to get around the pop-up issue that you would get if you used the same string in a web browser, without :7071 you'll see a permission error when trying to see/get data from a users account via the admin account.
curl -u admin:pass https://hostname:7071/home/user/Contacts wget https://admin:pass@hostname:7071/home/user/Contacts
What's My Server Like
To dump out your server details, these commands are useful. Login to your zimbra server and as the zimbra user do:
zmprov gs `zmhostname` zmprov gacf zmlocalconfig zmdumpenv
Another good document to review for "odd performance" issues is the large server wiki.
http://wiki.zimbra.com/index.php?title=Performance_Tuning_Guidelines_for_Large_Deployments
Restarting Jetty - ZCS 5+
As zimbra
zmmailboxdctl restart
How Do I Find Out What Version Of Zimbra I'm Using
See:
Get Version From Ajax Client
In newer versions of ZWC, the Help > About will also state the ZCS server version being used.
For older version, put the below in the search field of the Ajax client and hit enter:
$set:get version
Also:
https://SERVERNAME/js/zimbraMail/share/model/ZmSettings.js
Search for the CLIENT_VERSION line.
Other Ways To Get Version Of Server
See this forum post:
What's Compiled With Postfix
Moved to What's_Complies_With_Zimbra's_Postfix
REST Information
Resources to review
- Rest Overview
- For queries:
- Working Examples
Format to get around permission denied on multi-domain hosting servers
If you getting permission denied rather than resource not found...try this format example:
http://MAILSTOREofUSER.DOMAIN.com/zimbra/user/FIRST.LAST@USERS_DOMAIN.com/inbox.zip
or
http://MAILSTOREofUSER.DOMAIN.com/zimbra/user/USERNAME@USERS_DOMAIN.com/inbox.zip
I but both in case one issue is where the username has special characters, like the period.
Server Source Doc's
Please see:
http://svn.sourceforge.net/viewvc/zimbra/trunk/ZimbraServer/docs/
Logging
Actual Logging Homepage
Please see Ajcody-Logging
Server
RFE's Related To Better Logging And Historical Data Of Systems
See : Ajcody-Testing-Debugging#RFE.27s_Related_To_Better_Logging_And_Historical_Data_Of_Systems
Debugging
See : Ajcody-Testing-Debugging for more complete debugging information.
When Was A ZCS Service Enabled Or Disabled
See : Ajcody-Notes-Archive-Discovery#When_Was_A_ZCS_Service_Enabled_Or_Disabled
Syslog Items
Single Server Setup
/etc/syslog.conf should have lines similiar to:
[towards bottom of conf file] local0.* -/var/log/zimbra.log auth.* -/var/log/zimbra.log mail.* -/var/log/zimbra.log
Make sure syslog allows messages from log4j to be written, log4j doesn't do unix pipes. Specifically, it uses internet domain sockets (514/upd) instead of unix domain sockets (/dev/log). On a single server setup, this means log4j talking to localhost via 514/udp. Again, /dev/log is never used by log4j (AFAIK, this could change in the future). Adding the "-r" applies for the centralized syslog server as usual, but it also applies for the case where you want log4j data to be logged via syslog locally [single server setup]:
[root@zimbra sysconfig]# diff -u /etc/sysconfig/syslog.ORIG /etc/sysconfig/syslog --- /etc/sysconfig/syslog.ORIG 2008-03-25 09:14:28.000000000 -0400 +++ /etc/sysconfig/syslog 2009-06-09 16:01:13.000000000 -0400 @@ -3,7 +3,7 @@ # -r enables logging from remote machines # -x disables DNS lookups on messages recieved with -r # See syslogd(8) for more details -SYSLOGD_OPTIONS="-m 0" +SYSLOGD_OPTIONS="-r -m 0" # Options to klogd # -2 prints all kernel oops messages twice; once for klogd to decode, and # once for processing with 'ksymoops'
Restart syslog:
/etc/init.d/syslog restart
Setup ZCS to be aware of syslog [we'll restart Zimbra later once all the changes are done]:
zmprov mcf zimbraLogToSyslog TRUE
This will set the appropriate ldap values (after a zimbra restart) to make log4j.properties be written correctly:
/opt/zimbra/conf/log4j.properties will now show some modifications, for example:
[snips - DON'T cut cut/paste this info below for your server] #log4j.rootLogger=INFO,LOGFILE log4j.rootLogger=INFO,LOGFILE,SYSLOG ... # Syslog appender log4j.appender.SYSLOG=org.apache.log4j.net.SyslogAppender log4j.appender.SYSLOG.SyslogHost=localhost log4j.appender.SYSLOG.Facility=LOCAL0 log4j.appender.SYSLOG.layout=com.zimbra.common.util.ZimbraPatternLayout log4j.appender.SYSLOG.layout.ConversionPattern=mailboxd: %-5p [%t] [%z] %c{1} - %m
This will actually cause very little to goto syslog though, it's a very minimalist setup. Now adjust /opt/zimbra/conf/log4j.properties.in to log more items to syslog.
Note: You may or may not want all these things going to syslog and you may be able to send more/other things to syslog as well. I've not spend lots of time with log4j and I'm not familiar enough with all the code to know which pieces are using which logger/settings.
WARNING: the AUDIT logs may have sensitive data so be careful to protect the logs so that sensitive data is not leaked accidentally.
[zimbra@zimbra conf]$ diff -u log4j.properties.in.ORIG log4j.properties.in --- log4j.properties.in.ORIG 2009-06-05 15:31:20.000000000 -0400 +++ log4j.properties.in 2009-06-09 15:54:07.000000000 -0400 @@ -35,7 +35,7 @@ # Save zimbra.security to AUDIT appender log4j.additivity.zimbra.security=false -log4j.logger.zimbra.security=INFO,AUDIT +log4j.logger.zimbra.security=INFO,AUDIT,SYSLOG # Syslog appender log4j.appender.SYSLOG=org.apache.log4j.net.SyslogAppender @@ -88,7 +88,7 @@ log4j.additivity.zimbra.wbxml=false log4j.logger.zimbra.wbxml=DEBUG,WBXML -log4j.logger.zimbra=INFO +log4j.logger.zimbra=INFO,SYSLOG log4j.logger.zimbra.op=WARN -log4j.logger.com.zimbra=INFO +log4j.logger.com.zimbra=INFO,SYSLOG
At this point, you can restart zimbra for all the changes to be in effect:
zmcontrol stop ; zmcontrol start
Centralized Syslog Server
Please see:
This will show you how to setup a syslog server and then to configure the "clients" to log to the local filesystem as well as the syslog server.
You'll need to then take into account the information in Ajcody-Logging#Single_Server_Setup to handle the "Zimbra" part as well as dealing with log4j.
Centralized Log Server Project Ideas
Problems:
- Logs are to large to manage on each server.
- Want to build a central logging server for all logging events.
- The syslog events are very minimal with Zimbra (/var/log/zimbra.log). Most of the logging is control by Log4j (tomcat/jetty). Output from log4j generally goes into the /opt/zimbra/log/ directory. There's some conf files in /opt/zimbra/conf/log4j.properties* for log4j. You can adjust this file to also output into the syslog environment but syslog has very limited choices for "facility". See Ajcody-Logging#Single_Server_Setup and Log4j & Syslog facility for details. You'll end up getting huge files and god knows how many log events per second if you adjusted log4j to dump all zimbra logging into syslog control.
General Thought On This:
Use syslog-ng with mysql for the central log server. Add on php-syslog-ng for comfort.
Leave the log4j stuff alone and configure syslog-ng to monitor the actual log files as they are generated by log4j in /opt/zimbra/log/* .
Then decrease the log sizes and archiving done on the local servers, i.e. zimbraLogRawLifetime & zimbraLogSummaryLifetime .
References:
- Syslog-ng Homepage
- "O'Reilly - Building Secure Servers With Linux - Chapter On Syslog-ng"
- http://eduunix.ccut.edu.cn/index2/html/linux/O'Reilly%20-%20Building.Secure%20Servers%20with%20Linux/bssrvrlnx-CHP-10-SECT-2.html
- Most notably, the section on "sources"
- Php-syslog-ng
- http://code.google.com/p/php-syslog-ng/
- How-To Setup and Install Syslog-ng, mysql, and php-syslog-ng
Log Rotation and Removal
Logs In /opt/zimbra/log Directory
Please look at the output of your crontab - AS ZIMBRA, look for the "Log pruning" line.
crontab -l
And also the config files for logrotate:
/etc/logrotate.conf
/etc/logrotate.d/zimbra
Example From 5.0.11 - Complete ZCS Install Single Server
crontab for zimbra:
# Log pruning # 30 2 * * * find /opt/zimbra/log/ -type f -name \*.log\* -mtime +8 -exec rm {} \; > /dev/null 2>&1 35 2 * * * find /opt/zimbra/log/ -type f -name \*.out.???????????? -mtime +8 -exec rm {} \; > /dev/null 2>&1 # Log pruning # 30 2 * * * find /opt/zimbra/mailboxd/logs/ -type f -name \*log\* -mtime +8 -exec rm {} \; > /dev/null 2>&1
And the logrotate files:
$ cat /etc/logrotate.conf # see "man logrotate" for details # rotate log files weekly weekly # keep 4 weeks worth of backlogs rotate 4 # create new (empty) log files after rotating old ones create # uncomment this if you want your log files compressed #compress # RPM packages drop log rotation information into this directory include /etc/logrotate.d # no packages own wtmp -- we'll rotate them here /var/log/wtmp { monthly minsize 1M create 0664 root utmp rotate 1 } # system-specific logs may be also be configured here.
And also:
$ cat /etc/logrotate.d/zimbra /var/log/zimbra.log { daily missingok notifempty create 0644 zimbra zimbra postrotate killall -HUP syslogd 2> /dev/null || true kill -HUP `cat /opt/zimbra/log/swatch.pid 2> /dev/null` 2> /dev/null || true kill -HUP `cat /opt/zimbra/log/logswatch.pid 2> /dev/null` 2> /dev/null || true endscript compress } /opt/zimbra/log/myslow.log { daily missingok copytruncate rotate 30 notifempty create 0644 zimbra zimbra compress } /opt/zimbra/log/logger_myslow.log { daily missingok copytruncate notifempty create 0660 zimbra zimbra compress size 5000k rotate 7 } /opt/zimbra/log/clamd.log { daily missingok copytruncate notifempty create 0660 zimbra zimbra postrotate kill -HUP `cat /opt/zimbra/log/clamd.pid 2> /dev/null` 2> /dev/null || true endscript compress size 5000k rotate 7 } /opt/zimbra/log/zmlogswatch.out { daily missingok copytruncate notifempty create 0740 zimbra zimbra postrotate su - zimbra -c "/opt/zimbra/bin/zmlogswatchctl stop" su - zimbra -c "/opt/zimbra/bin/zmlogswatchctl start" endscript rotate 5 compress } /opt/zimbra/log/zmswatch.out { daily missingok copytruncate notifempty create 0740 zimbra zimbra postrotate su - zimbra -c "/opt/zimbra/bin/zmswatchctl stop" su - zimbra -c "/opt/zimbra/bin/zmswatchctl start" endscript rotate 5 compress } /opt/zimbra/log/zmmtaconfig.log { daily missingok copytruncate notifempty create 0740 zimbra zimbra postrotate su - zimbra -c "/opt/zimbra/bin/zmmtaconfigctl restart" endscript rotate 5 compress } /opt/zimbra/log/nginx.log { daily missingok notifempty create 0644 zimbra zimbra postrotate kill -USR1 `cat /opt/zimbra/log/nginx.pid 2> /dev/null` 2> /dev/null || true endscript rotate 7 compress } /opt/zimbra/log/zmconvertd.log { daily missingok copytruncate notifempty create 0644 zimbra zimbra rotate 7 } /opt/zimbra/zmstat/zmstat.out { daily missingok copytruncate rotate 7 notifempty compress }
Openldap Logs - In /opt/zimbra/openldap-data/
Ldap logs files in /opt/zimbra/openldap-data/ and in /opt/zimbra/data/ldap/* subdirectories [ZCS 6+] that are like log.0000000001 , log.0000000002 , etc.
This logpurge is controlled by:
$ cd /opt/zimbra/openldap/etc/openldap/ [zimbra@mail3 openldap]$ grep logpurge * master-accesslog-overlay.conf:logpurge 07+00:00 01+00:00
Logpurge Directive Description
From Accesslog Chapter
logpurge Directive
logpurge age interval
Defines both the maximum age for log entries to be retained in the database and how often to scan the database for old entries. Bothage and interval are specified as a time span in days, hours, minutes, and seconds. The time format is [ddd+]hh:mm[:ss], for example, the days and seconds components are optional but hours and minutes are required. Except for days, which can be up to 5 digits, each numeric field must be exactly two digits. Example:
- the log database will be scanned every day
- entries older than two days will be deleted.
logpurge 2+00:00 1+00:00
When using a log database that supports ordered indexing on generalizedTime attributes, specifying an eq index on the reqStart attribute will increase the performance of purge operations.
What's up with all the logs?
Other Logging Page Resources
http://www.zimbra.com/docs/ne/latest/administration_guide/9_Monitoring.14.1.html
http://wiki.zimbra.com/index.php?title=Server_Monitoring
http://wiki.zimbra.com/index.php?title=Log_Files
http://wiki.zimbra.com/index.php?title=Unresponsive_Server_Troubleshooting
The Bread And Butter Logs
/opt/zimbra/log/mailbox.log - where most of your mailbox store activity is logged
- This log is the mailboxd log4j server log containing the logs from the mailbox server. This includes activity from the mailbox store, LMTP server, IMAP and POP servers, and Index server.
- Location: /opt/zimbra/log/mailbox.log
- This log is the mailboxd log4j server log containing the logs from the mailbox server. This includes activity from the mailbox store, LMTP server, IMAP and POP servers, and Index server.
/opt/zimbra/log/zmmailboxd.out - mailboxd/jvm output log
- Mailstore not coming up and nothing is being logged in mailbox.log, check here for errors.
- Location: /opt/zimbra/log/zmmailboxd.out
- Mailstore not coming up and nothing is being logged in mailbox.log, check here for errors.
/opt/zimbra/log/stacktrace.<pid> - stacktrace logs
- stacktraces related to mailboxd
- Location: /opt/zimbra/log/stacktrace.<pid>
- stacktraces related to mailboxd
/opt/zimbra/db/data/YOURHOSTNAME.err - errors for MySQL - ZCS 4.x & ZCS 5.x
- This is the message store database error log.
- Location: /opt/zimbra/db/data/YOURHOSTNAME.err
- This is the message store database error log.
/var/log/zimbra.log - mta and system status log, postfix, amavisd
- The Zimbra syslog details the activities of the Zimbra MTA (Postfix, amavisd, antispam, antivirus), Logger, Authentication (cyrus-sasl), and Directory (OpenLDAP). By default LDAP activity is logged to Zimbra.log.
- Location: /var/log/zimbra.log
- The Zimbra syslog details the activities of the Zimbra MTA (Postfix, amavisd, antispam, antivirus), Logger, Authentication (cyrus-sasl), and Directory (OpenLDAP). By default LDAP activity is logged to Zimbra.log.
- Probably has mta logging events [which also show in /var/log/zimbra.log] and also log events related to your OS
- Location: /var/log/messages
- Probably has mta logging events [which also show in /var/log/zimbra.log] and also log events related to your OS
/opt/zimbra/log/mysql_error.log - problems with MySQL
- If there is data corruption or another problem causing direct mysql errors, events will be logged here.
- /opt/zimbra/log/mysql_error.log
- If there is data corruption or another problem causing direct mysql errors, events will be logged here.
/opt/zimbra/log/myslow.log - slow db/MySQL queries
- If certain search requests are taking longer to complete than others, they will be logged here.
- /opt/zimbra/log/myslow.log
- If certain search requests are taking longer to complete than others, they will be logged here.
Other Logs
/opt/zimbra/log/audit.log - authentication events
- A log of all admin actions taken as well as logins to the server.
- /opt/zimbra/log/audit.log
- A log of all admin actions taken as well as logins to the server.
- Want to see all uses of the "View Mail" button from the admin console? Will have the IP address, User Agent of the browser, user that the admin is logged in as, and the account that they are viewing.
grep DelegateAuth /opt/zimbra/log/audit.log
/opt/zimbra/log/clamd.log - antivrius db
- Status and checks for clamav
- /opt/zimbra/log/clamd.log
- Status and checks for clamav
- If your clamav db is out of date, you'll see a log event here like this:
- LibClamAV Warning: **************************************************
- LibClamAV Warning: *** The virus database is older than 7 days! ***
- LibClamAV Warning: *** Please update it as soon as possible. ***
- LibClamAV Warning: **************************************************
/opt/zimbra/log/convertd.log - attachment conversion
- If your having problems with your attachments and the ability to view them in ZWC, check here for errors.
- /opt/zimbra/log/convertd.log
- If your having problems with your attachments and the ability to view them in ZWC, check here for errors.
/opt/zimbra/log/freshclam.log - clam antivirus updates
- Shows the actual attempt to update the clamav updates.
- /opt/zimbra/log/freshclam.log
- Shows the actual attempt to update the clamav updates.
/opt/zimbra/log/spamtrain.log - spam/ham training details
- Spam/Ham training details are logged here. Errors are also logged here related to this service.
- From a default single ZCS configurations crontab [zimbra]:
- # Spam training
- #:
- 0 :23 * * * /opt/zimbra/bin/zmtrainsa >> /opt/zimbra/log/spamtrain.log 2>&1
- #
- # Spam training cleanup
- #
- 45 23 * * * /opt/zimbra/bin/zmtrainsa --cleanup >> /opt/zimbra/log/spamtrain.log 2>&1
/opt/zimbra/log/sync.log - zimbra mobile and activesync
- Your mobile devices will basically log here.
- /opt/zimbra/log/sync.log
- Your mobile devices will basically log here.
/opt/zimbra/log/synctrace.log - zimbra mobile and activesync
- Still looking for description that describes difference with sync.log
- /opt/zimbra/log/synctrace.log
- Still looking for description that describes difference with sync.log
/opt/zimbra/log/syncstate.log - no description found
- No description found.
- /opt/zimbra/log/syncstate.log
- No description found.
/opt/zimbra/log/wbxml.log - no description found
- No description found.
- /opt/zimbra/log/wbxml.log
- No description found.
/opt/zimbra/log/zmlogswatch.out -
/opt/zimbra/log/zmmtaconfig.log -
/opt/zimbra/log/zmmyinit.log -
/opt/zimbra/log/zmsetup.`date`-'pid'.log -
/tmp/install.log -
After install, gets moved to : /opt/zimbra/.install/
/tmp/zmsetup.log -
After install, gets moved to : /opt/zimbra/log/zmsetup.log.[some numbers]
/opt/zimbra/httpd_access.log -
/opt/zimbra/httpd_error.log -
New Data Directory In ZCS6+
In ZCS 6+ , there's a directory to organize 'data' from our various components.
[root@mail3 data]# pwd /opt/zimbra/data [root@mail3 data]# ls -F altermime/ amavisd/ clamav/ dspam/ ldap/ postfix/ tmp/
This information could prove useful as well with trouble-shooting and debugging problems.
Increase Logging
Increase Logging Per User
Depending on the ZCS version the below will clear all the per account loggers on zimbra reboot. IMAP is used for these examples.
- addAccoutLogger
zmprov aal user@domain.com zimbra.imap debug
- removeAccountLogger
zmprov ral user@domain.com zimbra.imap
Example usuage:
zmprov aal user@domain.com zimbra.soap debug
And tail the log file, while attempting to login to the AJAX client.:
tail -f /opt/zimbra/log/mailbox.log
See Ajcody-Logging#Log4J_Variables for variables that can be used.
To See What Accounts Have Extended Logging Enabled
There's the gaal option for zmprov . It list the accounts on a per mailstore basis :
getAllAccountLoggers(gaal) [-s/--server hostname]
[zimbra@zcs806 ~]$ zmprov gaal `zmhostname` # name test01@zcs806.domain.com zimbra.imap=debug
Bugs And RFE's
I filed the following RFE:
- "Allow "secondary" logging file for zmprov addAccountLogger"
Increase Logging Per Server
If you want to do it globally edit this file:
vi /opt/zimbra/conf/log4j.properties
Add a line at the end that's similar to something like this: log4j.logger.zimbra.imap=DEBUG.
No restart of any service is needed, BUT if something happens that causes a regeneration of the log4j.properties file then your changes will be overwritten. A regeneration of this file takes the contents of /opt/zimbra/conf/log4.properties.in .
To permanently make a change, modify the /opt/zimbra/conf/log4.properties.in file, then a restart would be necessary.
$ zmcontrol stop $ zmcontrol start
or you could run this on the server:
$ zmmtaconfig mailboxd
Wait for a minute for the server to pick up your change.
See Ajcody-Logging#Log4J_Variables for variables that can be used.
Log4J Variables
An Official page has been made for this topic now per my RFE request, bug 41894
Please see:
OpenLDAP Logging Levels
Please see King0770-Notes-Change-LDAP-Log-Levels
Want To See What's In Redolog Files
If you suspect there's too much redolog activity during a time window or have another need to inspect the contents of the redolog, dump it and examine it:
$ zmjava com.zimbra.cs.redolog.util.RedoLogVerify /opt/zimbra/redolog/redo.log > out.file
Pick the right redolog file, either redo.log or one of the files under archive/, based on timestamp.
See Ajcody-Backup-Restore-Issues#Redolog_Files for more details.
Internal Zimbra Charting - zmstat-chart
RFE/Bugs You Might Be Interested In
- "support for real time counters (snmp, jmx, etc)"
- "zmstat - expand documentation"
- "zmstat-chart - graphing besides just one day"
- "zmstat - integrate webpage setup and allow configuration of chart run"
- "zmstat - should have some trending data on ALL client connections (web/soap)"
zmstat IS NOT Logger (graphs in admin console)
Please note, zmstat is different than the processes and graphs involved with Logger. Logger is behind the graphs that show up in the admin web console.
Please see Logger for details and trouble-shooting steps with Logger.
Rick has some other steps for King0770-Notes#Reinitialize_the_Logger_DB
Main References For zmstat-chart Command
Please see the following:
zmstat-chart CLI Administration Guide
zmstat-chart-config CLI Administration Guide
zmstatctl CLI Administration Guide
Monitoring Administration Guide
JFreeChart is the project/binary behind the charting tool. You'll find the jar files here [ZCS 5.0.9 example]:
- /opt/zimbra/lib/jars/jfreechart-1.0.1.jar
- /opt/zimbra/jetty-6.1.5/common/lib/jfreechart-1.0.1.jar
Issues Being Investigated With zmstat And Other "Charting" Items
I currently have an internal thread going with the dev's about some issues with zmstat and also with attempts of getting the active sessions data from the admin web console to be seen in trends.
I'll just be dumping my notes here and then cleaning them up once I'm done with the internal conversation.
- Question: (mailboxd: active connections by client protocol) What exactly is this tracking? I'm on a test box with no connections and it has the different threads in the 100's/1000's. Customer was hoping (as was I) that this would be giving data much like is shown in the admin console about user connections. Also, there doesn't seem to be a comparable "active connections" for the web client (soap)?
- Answer: For the connections issue, it's the number of clients that are currently connected. There's no analog for SOAP because SOAP doesn't have persistent connections. We may be able to log stats for number of SOAP sessions, but that would include noise for cases where the user closes the browser window and the session hasn't timed out yet. If you think this is useful, please file an RFE.
- Question: (graph time plot) If I run zmstat-chart with the --aggregate-start-at option with something like "08/07/2008 01:00:00" I notice that the graphs don't actually reference "days" at the bottom but still use what looks to be "hours". Is this a bug where the bottom reference of the graph doesn't get adjusted or is the syntax to run zmstat-chart to do this more tricky that I think.
- Answer: zmstat-chart doesn't support multi-day ranges, it really only supports a single directory with a single day of charts, the aggregate options are for specifying ranges at which to calculate the max(col)/min(col)/avg(col) values. Our usual practice is to generate one set of charts for each day we want to look at; I think it gives us a better look at when peaks occur and how they compare day-to-day (it's much easier to look at them in an overlay fashion).
- Answer: Seems like a reasonable request to be able to generate charts for multiple days. Please file an RFE if you think this would be useful.
- Question: How reliable are these numbers are in admin console....
- Answer: I imagine they should be quite reliable; but HTTP (Web) is stateless, so you can't really determine whether a session is really active or not. I believe multiple sessions appearing for a single user would be the result of reloading or closing and then reopening the browser to log in again.
- Perhaps it is best to ask the users in question what their usage is like? Is there any concern over the high number of sessions? I don't think it should affect server performance.
- Answer: I imagine they should be quite reliable; but HTTP (Web) is stateless, so you can't really determine whether a session is really active or not. I believe multiple sessions appearing for a single user would be the result of reloading or closing and then reopening the browser to log in again.
- Question: Could you please explain the following:
- Mailboxd Mailbox Add Rate (Delivery Rate)
- Answer: The rate at which messages are being added to the mailbox server, e.g. 1 message being delivered per second is... 1 m/s
- Mailboxd Mailbox Add Latency (Delivery Speed)
- Answer: How long it takes on average to add a message to a mailbox (averaged over the period of a minute)
- Mailboxd Active Connections by Client Protocol- This one does NOT give us counts for web client. Host zcs2.mail.XXXX.xxx: Mailboxd: Active Connections by Client Protocol avg(IMAP) = 169.86 avg(IMAP SSL) = 0.00 avg(POP) = 0.21 avg(POP SSL) = 0.00
- Answer: It doesn't give counts for web client because the web client does not have persistent connections (being HTTP-based). SOAP requests (used by the Web client) use transient connections that often close after they are used; i.e. if you took the number of "SOAP" connections and compared it to the number of "active" sessions, it'd likely be something like 0-1% of the latter figure.
- Mailboxd Mailbox Get Count
- Answer: The number of mailboxes that got opened in the last minute (I don't recall if this counting cache hits or not?)
- Mailboxd Mailbox Get Latency
- Answer: How long it takes to open a mailbox, on average (over a minute)
- Also, we don't get stats for any of the soap parameters:
- SOAP Invocation Count Summary (Top 10 max)
- SOAP Average Call Duration AuthRequest
- Answer: I don't know why this could be; perhaps zmstat-chart-config.xml needs to be regenerated, is /opt/zimbra/zmstat/soap.csv available and does it contain data?
- Mailboxd Mailbox Add Rate (Delivery Rate)
Running zmstat-chart
Confirm it's running:
zmprov gs [mailserver hostname] | grep -i stats zimbraServiceEnabled: stats zimbraServiceinstalled: stats
Default location of stat files is:
/opt/zimbra/zmstat/
Example command to run:
mkdir /tmp/stats zmstat-chart -s /opt/zimbra/zmstat -d /tmp/stats/
Like To Have zmstat-chart Data Integrated With Zimbra
I've made an RFE for this integration:
- "zmstat - integrate webpage setup and allow configuration of chart run"
With Zimbra Jetty
- Note:
- The default Jetty behavior will NOT display directory listing. You'll need a valid html type file in the directory target.
- I would recommend the apache solution over this one as you can avoid hitting performance issues this might cause.
Dump some graphing directories in there:
zmstat-chart -s /opt/zimbra/zmstat -d /opt/zimbra/jetty/webapps/zimbra/downloads/zmstat-chart/`date +%F-%H-%M`
You'll see there's the directory and when you go into it - there's your charts.
You can now place this command in your crontab to run on a schedule basis.
Things you'll want to check before deploying:
- Place charting directory in a location where space is available and will not create a risk to the mail services if it's full.
- Look at the zmstat-chart options to see what other parameters you want to use - especially if it's going in your crontab.
- Make sure your following and security guidelines for your environment.
You'll be able to view the data with the following url:
http://hostname/zimbra/downloads/zmstat-chart/
With Zimbra Apache Or Non-Zimbra Server With Apache
Before You Proceed
Things to check or confirm first before deploying:
- Place your directory root [/opt/zimbra/support in this example] in a location where space is available and will not create a risk to the mail services if it's full.
- If you'll be using NFS to have a centralized storage point:
- Your NFS mount point on the Zimbra servers would be /opt/zimbra/support in this example.
- You'll be exporting /opt/zimbra/support in this example from the NFS server.
- If this is a non-zimbra server, copy the zimbra entry from a zimbra server's /etc/passwd and /etc/group into the non-zimbra servers passwd and group file. This way, if NFS is also used the UID/GID matches.
- Apache Directory variable will be /opt/zimbra/support/data in this example.
- Apache .htpasswd location will be /opt/zimbra/support/.htpasswd in this example, putting it above of the apache Directory variable.
- Make sure your following the security guidelines for your environment.
- Look at the zmstat-chart options to see what other parameters you want to use - especially if it's going in your crontab.
Directory Layout
As root:
mdir -p /opt/zimbra/support/data cd /opt/zimbra/support/data for i in `/opt/zimbra/bin/zmprov gas` do mkdir $i done
If your not on a ZCS server, you'll be manually creating directories named after the output of zmhostname from each of your ZCS servers.
Now, create subdirectory paths under each zmhsotname directory.
cd /opt/zimbra/support/data/ for i in `ls` do mkdir $i/debug $i/logs $i/zmstat $i/tops done
Set permissions on the directories we made:
chown -R zimbra:zimbra /opt/zimbra/support chmod -R 755 /opt/zimbra/support
With this structure and with NFS setup, you'll have a common repository that will have a standard path to use on a per server basis. Example :
script-command -PathOption /opt/zimbra/support/data/`zmhostname`/TYPE_OF_DATA/`date +%F-%H-%M`
Apache Configuration
Let's configure apache to show this directory.
- For ZCS Apache Setup:
vi /opt/zimbra/conf/httpd.conf ** Towards the end, add the following** # Include zmstat-chart directory Include /opt/zimbra/httpd/conf/extra/zimbra-support.conf
- Non-ZCS Server With Apache. Check that there's an existing Include directive that will see our zimbra-support.conf:
vi /etc/httpd/conf/httpd.conf ** Look for something that will allow the following** ** /etc/httpd/conf.d/zimbra-support.conf to be used** ** Your distro might differ on apache paths as well** ** as Include statement for other conf files** Include conf.d/*.conf
Let's now make the apache conf file for zimbra-support.conf
- For ZCS Apache Setup:
vi /opt/zimbra/httpd/conf/extra/zimbra-support.conf Alias /support "/opt/zimbra/support/data" <Directory "/opt/zimbra/support/data"> AuthName "Secure Area For Zimbra Support" AuthType Basic AuthUserFile /opt/zimbra/support/.htpasswd require valid-user Options Indexes IndexOptions FancyIndexing VersionSort AllowOverride None Order allow,deny Allow from all </Directory>
- Non-ZCS Server With Apache:
vi /etc/httpd/conf.d/zimbra-support.conf Alias /support "/opt/zimbra/support/data" <Directory "/opt/zimbra/support/data"> AuthName "Secure Area For Zimbra Support" AuthType Basic AuthUserFile /opt/zimbra/support/.htpasswd require valid-user Options Indexes IndexOptions FancyIndexing VersionSort AllowOverride None Order allow,deny Allow from all </Directory>
Make sure permissions are set correctly on zimbra-support.conf so apache will use it.
Now let's setup a username and password to use with the .htpasswd file.
cd /opt/zimbra/support/ htpasswd -c .htpasswd zimbrasupport chmod 644 .htpasswd
Restart apache so the changes take effect:
- For ZCS Apache Setup:
zmapachectl stop zmapachectl start
- Non-ZCS Server With Apache:
httpd restart
Now, let's dump some graphing directories in there:
zmstat-chart -s /opt/zimbra/zmstat -d /opt/zimbra/support/data/`zmhostname`/zmstat/`date +%F-%H-%M`
To now view the charts. Adjust, SERVERHOSTNAME, for your servername.
- For ZCS Apache Setup:
http://servername:7780/support/data/SERVERHOSTNAME/zmstat
- Non-ZCS Server With Apache:
http://servername/support/data/SERVERHOSTNAME/zmstat
You'll see there's the directory and when you go into it - there's your charts.
You can now place this command in your crontab to run on a schedule basis.
Tweaking zmstat-chart
zmstat-chart also has the option to use a configuration file. The default configuration file is:
/opt/zimbra/conf/zmstat-chart.xml
Copy this to another location and edit away. Then add the -c /location/to/config/file to use your new configuration.
Default Items Charted
Here's a list of the default items that will be charted with zmstat-chart:
- Postfix Queue Size
- convertd CPU time used
- convertd Resident Memory
- convertd Processes and Threads
- Total CPU
- Process CPU
- Process Total Memory
- Process Resident Memory
- Virtual Memory
- Context Switches
- Run/Blocked Process Queue Size
- Disk Partition Throughput
- Disk Utilization
- Disk Throughput
- Disk IOPs
- Swap Activity
- Total file descriptors open
- SOAP Invocation Count Summary (Top 10 max)
- SOAP Average Call Duration Summary (Top 10 avg)
- SOAP Invocation Count GetServerRequest
- SOAP Invocation Count BackupRequest
- SOAP Invocation Count GetAllConfigRequest
- SOAP Invocation Count GetDomainRequest
- SOAP Invocation Count GetAllDomainsRequest
- SOAP Invocation Count AuthRequest
- SOAP Average Call Duration GetServerRequest
- SOAP Average Call Duration BackupRequest
- SOAP Average Call Duration GetAllConfigRequest
- SOAP Average Call Duration GetDomainRequest
- SOAP Average Call Duration GetAllDomainsRequest
- SOAP Average Call Duration AuthRequest
- MySQL Database Connections
- MySQL InnoDB Buffer Pool Pages
- MySQL InnoDB Buffer Pool Hit Rate
- MySQL Tables Open/Opened
- MySQL Total Slow Queries Count
- Mailboxd Connection Pool Get Latency
- Mailboxd Dirty Lucene Index Writers
- Mailboxd Lucene IndexWriterCache Hitrate
- Mailboxd Lucene IO
- Mailboxd LMTP Delivery Throughput
- Mailboxd LMTP Delivery Rate
- Mailboxd Mailbox Add Rate (Delivery Rate)
- Mailboxd Mailbox Add Latency (Delivery Speed)
- Mailboxd Request Rate by Client Protocol
- Mailboxd Response Time by Client Protocol
- Mailboxd Active Connections by Client Protocol
- Mailboxd Mailbox Get Count
- Mailboxd Mailbox Get Latency
- Mailboxd Mailbox Cache Hit Rate
- Mailboxd Mailbox Item/Blob Cache Hit Rate
- Mailboxd Garbage Collection Time
- Mailboxd Garbage Collection Count
- Mailboxd JVM Heap Used
- Mailboxd JVM Heap Free
- Mailboxd JVM Permanent Generation and Code Cache
Moved to Getting_All_Users_Quota_Data
Moved to Getting_All_Users_Quota_Data
Third Party Tools (Monitoring & Logging)
FYI - Support For Real Time Counters (snmp,etc.)
This is for those that need to go beyond what zmstat-chart is doing or need to intergrate within a third party monitoring systems.
Please see RFE:
- "Support for real time counters (snmp, jmx, etc)"
Currently, this RFE has only resolved support for JMX, not SNMP. Customers who need SNMP can use a product like jManage to do the translation from JMX to SNMP.
SNMP And Zimbra
SNMP Related Bugs And RFEs
Please read the following below as they'll have little bits of information that you might need for your customizations / external setup for snmp use against Zimbra. :
- "support for real time counters (snmp, jmx, etc)"
- "zimbra snmp is broken"
- "snmp disk checks report incorrect usage."
- "replace zmdisklog / zimbra-snmp integration"
SNMP Setup On Zimbra To Notify A Remote Host
Our SNMP support is pretty basic; currently, we only send traps when a service (mta, mailbox, ldap) changes state (stop/start).
First, you'll need net-snmp package install on the zimbra host for the notifications to be sent to a remote host.
- When you install the net-snmp package, it creates /etc/snmp/snmpd.conf. This file needs to be edited with the correct community string to allow for snmp mibs to be read from remote machines The default value is "public" with the net-snmp package.
- /opt/zimbra/conf/swatchrc.in is set to use [ perlcode 0 my $snmpargs="-v 2c -c zimbra localhost "; ] for the community string. Adjust this if needed for your corporate snmp environment.
- Your security policy for your company might require you to review the other options there as well - i.e. limit to read-only.
- Also, if there is a firewall between the zimbra server and the snmp server host you'll need to open up port 161/UDP.
- When you install the net-snmp package, it creates /etc/snmp/snmpd.conf. This file needs to be edited with the correct community string to allow for snmp mibs to be read from remote machines The default value is "public" with the net-snmp package.
Then your zimbra host with the zimbra snmp service installed, do the following for a basic default setup:
zmlocalconfig -e snmp_notify=1 zmlocalconfig -e snmp_trap_host=your.host.name
/opt/zimbra/libexec/zmsnmpinit
zmswatchctl stop zmswatchctl start
We watch for something matching /err: Service status change/ and send the trap with:
/opt/zimbra/snmp/bin/snmptrap
See other topics below for customizations that might be needed for your snmp environment.
Other reference for Zimbra and SNMP:
Files To Review For SNMP
Look at the contents of the following files:
- /opt/zimbra/libexec/zmsnmpinit
- /opt/zimbra/conf/swatchrc.in
- zmsnmpinit reads swatchrc.in and writes out the file swatchrc for the running configuration
- /opt/zimbra/conf/swatchrc
- /opt/zimbra/snmp/share/snmp/snmpd.conf.in which is the SOURCE file to
- /opt/zimbra/conf/snmpd.conf [see /opt/zimbra/libexec/zmsnmpinit ]
- The two above are used by zmsnmpinit to generate the /opt/zimbra/conf/swatchrc
- /opt/zimbra/conf/snmpd.conf [see /opt/zimbra/libexec/zmsnmpinit ]
- /opt/zimbra/conf/swatchrc.in
- /opt/zimbra/net-snmp/share/snmp/mibs/zimbra.mib
- /opt/zimbra/net-snmp/share/snmp/mibs/zimbra_traps.mib
- /opt/zimbra/log/zmswatch.out
- Monitor this to see the services when they go up and down successfully send out the email notification for your snmp configuration
Zimbra MIBS
You'll find zimbra.mib and zimbra_traps.mib in the following directory. This listing is mine under 5.0.19 :
[root@mail3 ~]# cd /opt/zimbra/net-snmp/share/snmp/mibs/ [root@mail3 mibs]# ls AGENTX-MIB.txt IPV6-TC.txt SNMP-USER-BASED-SM-MIB.txt DISMAN-EVENT-MIB.txt IPV6-UDP-MIB.txt SNMP-USM-AES-MIB.txt DISMAN-SCHEDULE-MIB.txt NET-SNMP-AGENT-MIB.txt SNMP-USM-DH-OBJECTS-MIB.txt DISMAN-SCRIPT-MIB.txt NET-SNMP-EXAMPLES-MIB.txt SNMPv2-CONF.txt EtherLike-MIB.txt NET-SNMP-EXTEND-MIB.txt SNMPv2-MIB.txt HCNUM-TC.txt NET-SNMP-MIB.txt SNMPv2-SMI.txt HOST-RESOURCES-MIB.txt NET-SNMP-TC.txt SNMPv2-TC.txt HOST-RESOURCES-TYPES.txt NET-SNMP-VACM-MIB.txt SNMPv2-TM.txt IANA-ADDRESS-FAMILY-NUMBERS-MIB.txt NOTIFICATION-LOG-MIB.txt SNMP-VIEW-BASED-ACM-MIB.txt IANAifType-MIB.txt RFC1155-SMI.txt TCP-MIB.txt IANA-LANGUAGE-MIB.txt RFC1213-MIB.txt TRANSPORT-ADDRESS-MIB.txt IANA-RTPROTO-MIB.txt RFC-1215.txt UCD-DEMO-MIB.txt IF-INVERTED-STACK-MIB.txt RMON-MIB.txt UCD-DISKIO-MIB.txt IF-MIB.txt SMUX-MIB.txt UCD-DLMOD-MIB.txt INET-ADDRESS-MIB.txt SNMP-COMMUNITY-MIB.txt UCD-IPFWACC-MIB.txt IP-FORWARD-MIB.txt SNMP-FRAMEWORK-MIB.txt UCD-SNMP-MIB.txt IP-MIB.txt SNMP-MPD-MIB.txt UDP-MIB.txt IPV6-ICMP-MIB.txt SNMP-NOTIFICATION-MIB.txt zimbra.mib IPV6-MIB.txt SNMP-PROXY-MIB.txt zimbra_traps.mib IPV6-TCP-MIB.txt SNMP-TARGET-MIB.txt
What Is Looked For
Take a look at your /opt/zimbra/conf/swatchrc - this is mine under 5.0.19
perlcode 0 my %notifications=(); perlcode 0 $notifications{smtp}="yes"; perlcode 0 $notifications{snmp}="yes"; perlcode 0 my $fr='admin@mail3.zimbra.REMOVED.com'; perlcode 0 my $pwc='admin@mail3.zimbra.REMOVED.com'; perlcode 0 my $snmpargs="-v 2c -c zimbra localhost ''"; perlcode 0 my $snmptrap="/opt/zimbra/snmp/bin/snmptrap $snmpargs"; perlcode 0 my $snmpsvctrap="ZIMBRA-TRAP-MIB::zmServiceStatusTrap"; perlcode 0 my $snmpsvcname="ZIMBRA-MIB::zmServiceName"; perlcode 0 my $snmpsvcstatus="ZIMBRA-MIB::zmServiceStatus"; perlcode 0 my %statuses=('started'=>1,'stopped'=>0); perlcode 0 my $hostname="mail3.zimbra.homeunix.com"; perlcode 0 sub donotify { my %args = (@_); if ($args{HOST} eq "localhost") {$args{HOST}=$hostname;}; if ($notifications{smtp}) { dosmtp(%args) if $args{SERVICE}; dodisksmtp(%args) if $args{DISK};}; if ($notifications{snmp}) {dosnmp(%args);}; } perlcode 0 sub dosmtp { my %args = (@_); print "SMTP notification: $args{MESSAGE}\n"; open (FOO, "|/opt/zimbra/postfix/sbin/sendmail -Am -t"); print FOO "To: $pwc\nFrom: $fr\nSubject: Service $args{SERVICE} $args{STATUS} on $args{HOST}\n\n$args{MESSAGE}\n"; close FOO; } perlcode 0 sub dodisksmtp { my %args = (@_); print "SMTP notification: $args{MESSAGE}\n"; open (FOO, "|/opt/zimbra/postfix/sbin/sendmail -Am -t"); print FOO "To: $pwc\nFrom: $fr\nSubject: Disk $args{DISK} at $args{UTIL}\% on $args{HOST}\n\n$args{MESSAGE}\n"; close FOO; } perlcode 0 sub dosnmp { my %args = (@_); print "SNMP notification: $args{MESSAGE}\n"; `$snmptrap $snmpsvctrap $snmpsvcname s $args{SERVICE} $snmpsvcstatus i $statuses{$args{STATUS}}`; } ignore /DEBUG/ watchfor /err: Service status change: (\S+) (.*) changed from stopped to running/ donotify SERVICE=$2,STATUS=started,HOST=$1 watchfor /err: Service status change: (\S+) (.*) changed from running to stopped/ donotify SERVICE=$2,STATUS=stopped,HOST=$1 watchfor /err: Disk warning: (\S+) (\S+) at (\d+)/ donotify DISK=$2,UTIL=$3,HOST=$1 watchfor /crit: Disk warning: (\S+) (\S+) at (\d+)/ donotify DISK=$2,UTIL=$3,HOST=$1
Enhanced MIB Files For HP OpenView
I've created an RFE for this:
- "enchanced MIB and OID information to work with HP Openview"
Zimbra does not provide "enhanced" mib files" at this time. Thresholds can be set by the customer within their individual monitoring system. Zimbra is alerting on is service up or service down, see the other information above in Ajcody-Logging#SNMP_And_Zimbra .
Some Choices
Charting & Graphing The Data
Montoring Software
- Nagios
- Centreon - based upon Nagios
- Splunk
- You could also look at using Splunk and Nagios together.
- BigSister - take off of BigBrother
- Zenoss
- Cacti
- OpenNMS
- Munin
Nagios On Zimbra
This is a really rough draft for ideas I have in background. Shouldn't be used by anyone.
Configure Nagios to run on single server Zimbra box - Centos 5.x
Configure yum with repo and install nagios
vi /etc/yum.repos.d/Dag.repo yum update yum install nagios nagios-plugins nagios-devel nagios-plugins-nrpe
Move nagios.conf http file into main zimbra directory.
cp /etc/httpd/conf.d/nagios.conf /opt/zimbra/httpd/conf/extra/
Setup nagios to run as zimbra
vi /etc/nagios/nagios.cfg **Change nagios user to zimbra** nagios_user=zimbra nagios_group=zimbra
Change ownership of directories from nagios to zimbra.
chown -R 500:500 /var/log/nagios/ chown -R 500:500 /etc/nagios/ chown -R 500:500 /usr/share/nagios/
Configure authentication within Nagios
vi /etc/nagios/nagios.cfg # AUTHENTICATION USAGE use_authentication=1 # SYSTEM/PROCESS INFORMATION ACCESS authorized_for_system_information=nagiosadmin # CONFIGURATION INFORMATION ACCESS authorized_for_configuration_information=nagiosadmin # SYSTEM/PROCESS COMMAND ACCESS authorized_for_system_commands=nagiosadmin # GLOBAL HOST/SERVICE VIEW ACCESS authorized_for_all_services=nagiosadmin authorized_for_all_hosts=nagiosadmin # GLOBAL HOST/SERVICE COMMAND ACCESS authorized_for_all_service_commands=nagiosadmin authorized_for_all_host_commands=nagiosadmin
Set up httpasswd's for the accounts for Nagios
htpasswd -c /etc/nagios/htpasswd.users nagiosadmin htpasswd /etc/nagios/htpasswd.users guest
Configure Zimbra's http/apache to use nagios http config file
vi /opt/zimbra/conf/httpd.conf **Add the following towards bottom** # Include Nagios Include /opt/zimbra/httpd/conf/extra/nagios.conf
Starting nagios is done as root
/etc/init.d/nagios start
Restarting apache for nagios issues would be done with (as zimbra)
zmapachectl stop zmapachectl start
The webpage address to view Nagios will be like this:
http://IP_OF_SERVER:7780/nagios/
Use the rest of this how-to to configure it now: http://wiki.centos.org/HowTos/Nagios
MRTG - SNMP On Zimbra
This is a really rough draft for ideas I have in background. Shouldn't be used by anyone.
Configure yum with repo and install mrtg, net-snmp, net-snmp-utils
vi /etc/yum.repos.d/Dag.repo yum update yum instal mrtg net-snmp net-snmp-utils
Follow some how-to on setting up the basics.
Create a http config:
vi /opt/zimbra/httpd/conf/extra/mrtg.conf Alias /mrtg "/opt/zimbra/mrtg" <Directory "/opt/zimbra/mrtg"> # SSLRequireSSL Options None AllowOverride None Order allow,deny Allow from all # Order deny,allow # Deny from all # Allow from 127.0.0.1 </Directory>
Add mrtg to http configuration within zimbra:
vi /opt/zimbra/conf/httpd.conf # Include Mrtg Include /opt/zimbra/httpd/conf/extra/mrtg.conf
Restart apache:
zmapachectl stop zmapachectl start
Create directory to hold mrtg data:
mkdir /opt/zimbra/mrtg
Address will be something like:
http://IP_OF_SERVER:7780/mrtg/index.html
Mailq Pointing To Right Binary
# ls -la /usr/bin/mailq lrwxrwxrwx 1 root root 27 Sep 3 17:00 /usr/bin/mailq -> /etc/alternatives/mta-mailq # ls -la /etc/alternatives/mta-mailq lrwxrwxrwx 1 root root 23 Apr 1 10:17 /etc/alternatives/mta-mailq -> /usr/bin/mailq.sendmail # rm /usr/bin/mailq # ln -s /opt/zimbra/postfix/sbin/mailq /usr/bin/mailq # mailq Mail queue is empty
Web Client Logging
Active Sessions
Please see Zmsoap#Active_Server_Sessions_With_DumpSessionsRequest
Debug (SOAP) via Browser
See http://wiki.zimbra.com/index.php?title=Web_Client_URL_Tricks&redirect=no
Admins To View Client Issues
Within the admin console, you can view users mail.
- Goto accounts and highlight the user having the problem.
- Click on the View Mail button above that frame.
- Then goto the url field of that new window and modify it to look like this [replace mailserver with yours]:
- Hit your return key to cause the browser to reload.
- If you get warning about pop-up, accept it.
- If the debug window doesn't show, just mouse in the url field and hit the return key again. It should now pop up.
User Management Topics
Actual User Management Topics Homepage
Please see Ajcody-User-Management-Topics
Resetting A User's Account From CLI
Resetting A Password
Standard Method
SetPassword [sp] from zmprov:
zmprov sp joe@domain.com test321
Resetting Users Auth Session - Force Disconnect
Please See First - In Case Of Compromised Accounts / Spammers
Note - Restarting the mta services will be important once you reset the password/s or lock the account. It's required to ensure the active connections will be closed and any existing auth tokens no longer are valid. See:
- Force currently active SMTP authenticated sessions to be renegotiated when locking an account
Changing the Users Password To Expire Session
See Resetting A Password Via CLI or change it via the admin console.
- "Auth token should be invalidated if a user resets their password"
Prior To 605 - Use CLI To Change zimbraAuthTokenValidityValue To Expire The Session
Change the zimbraAuthTokenValidityValue to a small time value:
su - zimbra zmprov ma <accountname> zimbraAuthTokenValidityValue 1 zmprov fc account <accountname>
This value gets stored in the auth token and compared on every request. Changing it will invalidate all outstanding auth tokens.
8.7.6+ invalidate sessions by removing zimbraAuthTokens
This may be helpful in case you do no want to change zimbraAuthTokenValidityValue or changing zimbraAuthTokenValidityValue does not log you out.
To clear or reset all auth token values we need to enter token data in a particular format like "1689192272|1548369012160|8.8.15_GA_3890".
These are the steps to clear the auth tokens from an account. 1). First check few stored token for the account.
zmprov ga USERNAME@DOMAIN.COM zimbraAuthTokens | head
2). Now pick anyone token value and set it with below command, with this step only one token will be set and others will be removed.
zmprov -l ma USERNAME@DOMAIN.COM zimbraAuthTokens '1689192272|1548369012160|8.8.15_GA_3890'
3). Flush the account cache at the end.
zmprov fc account USERNAME@DOMAIN.COM
All sessions of USERNAME@DOMAIN.COM are now ended.
6.0.5+ You Have Admin Console Option
In the admin console, under the Manage Accounts window you can right click on the user name and choose "Expire Sessions".
- "Manually Invalidate Auth Token(s)"
User , Mailbox ID's, And Who Is What
ZimbraID [UserID] is system wide.
MailboxID is per server store.
To get the ZimbraID:
$ zmprov ga user@domain.com | grep -i zimbraid zimbraId: aeca260b-6faf-4cfe-b407-7673748aabf4 zimbraIdentityMaxNumEntries: 20
To get the MailboxID, get on the appropriate mailserver and:
zmprov gmi user@domain.com mailboxId: 3 quotaUsed: 251512
or globally:
/opt/zimbra/bin/mysql -e "use zimbra; select id from mailbox where account_id = 'UserID HERE including the leading 0'"
Other details can be found here:
http://wiki.zimbra.com/index.php?title=Account_mailbox_database_structure
Account & Domain Summary
Run zmaccts
Here's what it would return:
su - zimbra [zimbra@mail3 ~]$ zmaccts account status created last logon ------------------------------------ ----------- --------------- --------------- admin@mail3.internal.domain.com active 05/06/08 18:46 07/08/08 09:56 ajcody@mail3.internal.domain.com active 05/06/08 20:43 06/23/08 15:48 ajcody2@mail3.internal.domain.com active 05/28/08 11:48 06/30/08 17:44 forward@mail3.internal.domain.com active 05/06/08 21:06 05/29/08 17:24 ham.bidiob2mm@mail3.internal.domain.com active 05/06/08 18:47 never spam.rormmtcyy@mail3.internal.domain.com active 05/06/08 18:47 never wiki@mail3.internal.domain.com active 05/06/08 18:46 never account status created last logon ------------------------------------ ----------- --------------- --------------- secondary@secondary.internal.domain.com active 06/23/08 15:26 06/23/08 15:27 wiki@secondary.internal.domain.com active 06/23/08 15:25 never - domain summary - domain active closed locked maintenance total ----------------------- -------- -------- -------- ------------- -------- mail3.internal.domain 7 0 0 0 7 secondary.internal.domain 2 0 0 0 2
Last Logon comes from the variable zimbraLastLogonTimestamp . This is used to update the "Last Login Time" column in the admin web console as well. It also shows up with [ zmprov ga user@domain ]. Login's based upon session type would only be found in either audit.log or the mailbox.log files. It should have a reference to the user id and the session type for the login [ pop, imap, etc. ].
RFE To Expand zmaccts Output And Options
Please see the following RFE I made:
- "zmaccts to include more options"
Zmmailbox Stuff
RFE's And Bugs To Review
Please see these RFE's first:
- "Admin (zimbra) account to be able to setup resources for accounts (auto-acceptance)"
- http://bugzilla.zimbra.com/show_bug.cgi?id=25740
- Was marked a dup of the work being done for bug7473
- "Share management and discovery"
- "New share property that grants the user the ability to work on email but unable to delete or empty folders"
- http://bugzilla.zimbra.com/show_bug.cgi?id=31466
- In comment 4, I made an extensive suggestion on expanding the permission variables one could use.
- http://bugzilla.zimbra.com/show_bug.cgi?id=31466
Some other's to look at:
- "Expand permission share model"
- "Allow/disallow sharing to all authenticated users via user interface"
- "Calendar Share permission refinement - ability to accept/decline but NOT edit/remove"
- "Revoked view permissions not removed until after logout"
- "RFE - Ability for anyone (not just people with a share) to view some meeting details of resources"
- "After revoking calendar permissions, the web UI still shows the share still exists."
- "Cannot remove sharing permissions for mail folders"
- "Allow non-user "public" folders"
- "share ownership to disti-group -- not just end-user -- delegation (folder, calendar, doc/wiki, task, project)"
- "Global Admin control for Zimbra shared resources (and subscription) -- folders, calendar, address book, task, project, documents"
- "share roles - custom (editor / author) levels"
- "Notification of shared resources for distribution list members"
To See All Folders For A User
Do the following for the user:
[zimbra@mail3 ~]$ zmmailbox -z -m ajcody@DOMAIN gaf Id View Unread Msg Count Path ---------- ---- ---------- ---------- ---------- 1 conv 0 0 / 16 docu 0 2 /Briefcase 10 appo 0 1 /Calendar 14 mess 0 0 /Chats 7 cont 0 0 /Contacts 6 mess 0 0 /Drafts 13 cont 0 9 /Emailed Contacts 2 mess 0 11 /Inbox 4 mess 0 0 /Junk 344 mess 0 0 /Junk E-mail 12 wiki 0 0 /Notebook 302 appo 0 0 /Restored 5 mess 0 15 /Sent 420 mess 0 0 /Share 421 mess 0 0 /Share/Share1 422 mess 0 0 /Share/Share1/Share1-1 423 mess 0 0 /Share/Share2 424 mess 0 0 /Share/Share2/Share2-1 15 task 0 2 /Tasks 3 conv 0 0 /Trash
Do the following for the user [ I'm cutting some of the output to keep it short ]:
[zimbra@mail3 ~]$ zmmailbox -z -m ajcody@DOMAIN gaf -v { "id": "1", "name": "USER_ROOT", "path": "/", "parentId": "11", "flags": null, "color": "defaultColor", "unreadCount": 0, "messageCount": 0, "view": "conversation", "url": null, "effectivePermissions": null, "children": [ { #### CUT HERE #### { "id": "5", "name": "Sent", "path": "/Sent", "parentId": "1", "flags": null, "color": "defaultColor", "unreadCount": 0, "messageCount": 15, "view": "message", "url": null, "effectivePermissions": null }, { "id": "420", "name": "Share", "path": "/Share", "parentId": "1", "flags": "i", "color": "defaultColor", "unreadCount": 0, "messageCount": 0, "view": "message", "url": null, "effectivePermissions": null, "grants": [ { "type": "usr", "name": "ajcody2@mail3.internal.domain.com", "id": "88fd808e-a526-419d-9eda-ad50100d23b6", "permissions": "rwidx", "args": null }, { "type": "all", "name": null, "id": null, "permissions": "rwx", "args": null } ], "children": [ { "id": "421", "name": "Share1", "path": "/Share/Share1", "parentId": "420", "flags": "i", "color": "defaultColor", "unreadCount": 0, "messageCount": 0, "view": "message", "url": null, "effectivePermissions": null, "grants": [ { "type": "usr", "name": "ajcody2@mail3.internal.domain.com", "id": "88fd808e-a526-419d-9eda-ad50100d23b6", "permissions": "rwidx", "args": null }, { "type": "usr", "name": "admin@mail3.internal.domain.com", "id": "5ab13330-2e9b-4a45-9b30-de2c70858265", "permissions": "rwidx", "args": null } ], "children": [ { "id": "422", "name": "Share1-1", "path": "/Share/Share1/Share1-1", "parentId": "421", "flags": null, "color": "defaultColor", "unreadCount": 0, "messageCount": 0, "view": "message", "url": null, "effectivePermissions": null } ] }, { "id": "423", "name": "Share2", "path": "/Share/Share2", "parentId": "420", "flags": null, "color": "defaultColor", "unreadCount": 0, "messageCount": 0, "view": "message", "url": null, "effectivePermissions": null, "children": [ { "id": "424", "name": "Share2-1", "path": "/Share/Share2/Share2-1", "parentId": "423", "flags": null, "color": "defaultColor", "unreadCount": 0, "messageCount": 0, "view": "message", "url": null, "effectivePermissions": null } ### CUT HERE ### ] }
RFE I filed for zmmailbox to have options for this and "recursive".
- "zmmailbox folder should have option to remove ALL shares & recursive option"
Here's a script I wrote. Remove the echo statements to actually run the commands.
#!/bin/bash USER="ajcody@mail3.internal.domain.com" SHARE="/Shared" GETPERM="zmmailbox -z -m $USER gfg $SHARE" MODPERM="zmmailbox -z -m $USER mfg $SHARE" DUMBPASS="34lkoso" NEWPERM=none $GETPERM | egrep -i 'all|guest|public|accoun|domain|group' | gawk '{print $2 " " $3}' | while read SHAREPERM do TYPE=`echo $SHAREPERM|awk '{print $1}'` DISPLAY=`echo $SHAREPERM|awk '{print $2}'` case $TYPE in accoun) echo $MODPERM account $DISPLAY $NEWPERM ;; guest) echo $MODPERM $TYPE $DISPLAY $DUMBPASS $NEWPERM ;; all) echo $MODPERM $TYPE $NEWPERM ;; *) echo $MODPERM $SHAREPERM $NEWPERM ;; esac done
Ouput of an example:
[zimbra@mail3 ~]$ zmmailbox -z -m ajcody@mail3.internal.domain.com gfg /Shared Permissions Type Display ----------- ------ ------- r all r guest ajcody@domain.com r accoun admin@mail3.internal.domain.com r group mydl@mail3.internal.domain.com r domain mail3.internal.domain.com [zimbra@mail3 ~]$ /tmp/remove-share.sh zmmailbox -z -m ajcody@mail3.internal.domain.com mfg /Shared all none zmmailbox -z -m ajcody@mail3.internal.domain.com mfg /Shared guest ajcody@domain.com none zmmailbox -z -m ajcody@mail3.internal.domain.com mfg /Shared account admin@mail3.internal.domain.com none zmmailbox -z -m ajcody@mail3.internal.domain.com mfg /Shared group mydl@mail3.internal.domain.com none zmmailbox -z -m ajcody@mail3.internal.domain.com mfg /Shared domain mail3.internal.domain.com none
I then removed the echo statements:
[zimbra@mail3 ~]$ vi /tmp/remove-share.sh [zimbra@mail3 ~]$ /tmp/remove-share.sh [zimbra@mail3 ~]$ zmmailbox -z -m ajcody@mail3.internal.domain.com gfg /Shared Permissions Type Display ----------- ------ ------- [zimbra@mail3 ~]$
Please TEST this on a test box or a test account before running against a production situation. ZCS version change and commands might act different. Also note, this is a user contributed script and not one from Zimbra developers or the support staff. Also - the wiki formatting might throw of the script and could require you to fix before it runs correctly.
Script is called - zmshares - and should be named such.
#!/usr/bin/env perl # # # This program was written by Pablo Garaitonandia on Nov. 26 2012. # This program is for viewing and deleting all the shares that a user # may have in the event that removing the many shares a user has is # time consuming. # This was written on a system running Zimbra 7.2.0, RHEL 5.8, with perl v5.8.8 use strict; use warnings; use Getopt::Long; my $id=getpwuid($<); my $help=0; my $user_id=0; my $option=0; my @shares; sub view_share; sub del_share; chomp $id; if ($id ne "zimbra") { print STDERR "Error: must be run as zimbra user\n"; exit (1); } GetOptions( 'h|help' => \$help, 'u|uid=s' => \$user_id, 'o|option=s'=> \$option, ) or die "Incorrect usage!\n"; # Check for usage, definition, and correct argument types if ((defined ($user_id) && ($user_id =~ /([a-z0-9]+@[a-z.]+\.[a-z.]+)/gi)) && (defined ($option) && (($option eq "delete") || ($option eq "view")))) { print "\n$option: shares for $user_id \n\n"; } elsif ($help) { usage(); } else { usage(1); } if ($option eq "view"){ view_share();} if ($option eq "delete"){ del_share();} sub view_share { open(VIEW, "/opt/zimbra/bin/zmprov getShareInfo $user_id |"); print <VIEW>; } sub del_share { open(SHARES, "zmprov getShareInfo $user_id |awk '{print substr(\$0,70,6) ,substr(\$0,131,36), substr(\$0,168,15)}' | awk 'NR>2' |"); @shares = <SHARES>; if (!(@shares)){ print "EXITING: User has no shares to delete. \n\n"; exit (1); } foreach my $share (@shares){ my @line = split(/\s+/, $share); if (defined ($line[2])){ print "zmmailbox -z -m $user_id mfg $line[0] account $line[1] none\n"; system("/opt/zimbra/bin/zmmailbox -z -m $user_id mfg $line[0] account $line[1] none") == 0 or die "Command Failed"; } else { print "zmmailbox -z -m $user_id mfg $line[0] account \"\" none\n"; system("zmmailbox -z -m $user_id mfg $line[0] account \"\" none") == 0 or die "Command Failed"; } } } sub usage { my ($msg) = (@_); $msg && print STDERR "\nINCORRECT USAGE: $msg\n"; print STDERR <<USAGE; zmshares -u username\@domain -o (delete|view) Where: -u: (user\@domain) The full user id with domain for user. -o: (delete|view) Delete or view ALL shares for the user USAGE exit (1); } __END__
- I've yet to test these against all items (resources) listed in bug 25740 and work as expected.
To see current perms
zmmailbox -z -m faxfinder@example.com gfg /Inbox
To modify perms:
- r = read
- w = write
- i = insert
- d = delete
- x = accept/decline invites
- a = administer
zmmailbox -z -m faxfinder@example.com mfg /Inbox account user@example.com rwidx
To confirm perms are set:
zmmailbox -z -m faxfinder@example.com gfg /Inbox
To mount "folder" into a user account that was given permission:
zmmailbox -z -m user@example.com cm --view message "/Incoming_Faxes" faxfinder@example.com /Inbox
To confirm folder is mounted:
zmmailbox -z -m user@example.com gaf
Additions notes/options see:
zmmailbox help folder
For mfg it shows it can take the below as a target:
- account {name}
- group {name} *This could be a DL?*
- domain {name}
- all
- public
- guest
Scripting note to do this with multiple users:
- zmmailbox cm could use the zmprov gaa to provide a list of all accounts, this would include system & archive (if exist) accounts though.
How To Turn Off Sharing
You can enable / disable sharing from admin console:
- Admin console --> class of service --> select the CoS (eg default) --> features --> general features --> check/uncheck 'Sharing' option
Alternatively, this can be achieved by having the following CoS attribute either 'TRUE' or 'FALSE', from command line: zimbraFeatureSharingEnabled
Searches With zmmailbox
Special Note If Your Search String Needs Spaces
Here is an example using the correct format to include required spaces to have your search do what you want. For instance, many shared folders will end up using, by default, spaces in the folder name.
$ zmmailbox -z -m ajcody@`zmhostname` gaf | grep appo 10 appo 0 0 /Calendar 263 appo 0 2 /Large Share's Calendar (large-share@mail71.DOMAIN.com:10) $ zmmailbox -z -m ajcody@`zmhostname` s -t appo in:"\"Large Share's Calendar"\" num: 2, more: false Id Type From Subject Date ---------------------------------------- ---- ---------- --------------------- ------ 1. 799efb72-2e6b-400a-8881-c5f9d7c282b1:265 appo <na> Test On Thu 10/28/10 00:02 2. 799efb72-2e6b-400a-8881-c5f9d7c282b1:263 appo <na> test for friday 10/28/10 00:02
Note, the "\"Text1 Text2"\" is for a [s option] search string query, when querying for the folder name with other zmmailbox options - normal quoting works. For example:
$ zmmailbox -z -m ajcody@`zmhostname` gfg "Large Share's Calendar" Permissions Type Display ----------- -------- ------- rwidxa account ajcody@mail71.DOMAIN.com
Search For Messages And Then Delete Them
Here's some examples to grab the message id's from a search and then put them in a variable to use for the delete command.
Other reference: King0770-Notes#Removing_Messages_with_Zmmailbox_based_on_the_Subject
Note - Crossmailbox Search And Delete Is Currently An RFE
See the following :
- RFE: Bulk deletion of a mail - crossmailbox
First - Default Search Returns Only 25 Results
From zmmailbox [help search] & zmmailboxsearch
--limit (optional) -l Sets the limit for the number of results returned. The default is 25.
Example Search With A From And To Date - Multiple Variable Search
This allows you to restrict your search in-between a date range.
zmmailbox -z -m user@domain.com s -t message -l 999 "before:6/15/2011 and after:6/9/2011"
Note - If your trying to do this for a tgz export, please see the following :
Example Search With To Field
[zimbra@mail3 ~]$ zmmailbox -z -m ajcody@mail3.internal.DOMAIN.com s -t message "To: Adam" num: 4, more: false Id Type From Subject Date ---- ---- -------------------- -------------------------------------------------- -------------- 1. 269 mess Adam Re: 8-7-08 11:37 AM to both outside accounts 08/07/08 11:57 2. 268 mess Adam Re: 8-7-08 11:37 AM to both outside accounts 08/07/08 11:39 3. 266 mess Adam Re: 8-7-08 11:37 AM to both outside accounts 08/07/08 11:38 4. 263 mess Adam Re: test on 8-7-08 to zimbra account 08/07/08 11:37 [zimbra@mail3 ~]$ zmmailbox -z -m ajcody@mail3.internal.DOMAIN.com s -t message "To: Adam" |awk '{ if (NR!=1) {print}}'| grep mess | awk '{ print $2 "," }' | tr -d '\n' 269,268,266,263, [zimbra@mail3 ~]$ message=`zmmailbox -z -m ajcody@mail3.internal.DOMAIN.com s -t message "To: Adam" |awk '{ if (NR!=1) {print}}'| grep mess | awk '{ print $2 "," }' | tr -d '\n'` [zimbra@mail3 ~]$ zmmailbox -z -m ajcody@mail3.internal.DOMAIN.com dm `echo $message` [zimbra@mail3 ~]$ zmmailbox -z -m ajcody@mail3.internal.DOMAIN.com s -t message "To: Adam" num: 0, more: false
Example Search With From Field
[zimbra@mail3 ~]$ zmmailbox -z -m ajcody@mail3.internal.DOMAIN.com s -t message "From: Adam" num: 8, more: false Id Type From Subject Date ---- ---- -------------------- -------------------------------------------------- -------------- 1. 464 mess Adam test 3 10/02/08 11:43 2. 463 mess Adam test 2 10/02/08 11:43 3. 462 mess Adam test 1 10/02/08 11:43 4. 461 mess Adam test 09/29/08 16:18 5. 460 mess Adam test for mailbox log 09/29/08 16:17 6. 265 mess Adam 8-7-08 11:37 AM to both outside accounts 08/07/08 11:38 7. 261 mess Adam test on 8-7-08 to zimbra account 08/07/08 11:36 8. 257 mess Adam test from zimbra on 8-7-08 08/07/08 11:27 [zimbra@mail3 ~]$ zmmailbox -z -m ajcody@mail3.internal.DOMAIN.com s -t message "From: Adam" |awk '{ if (NR!=1) {print}}'| grep mess | awk '{ print $2 "," }' | tr -d '\n' 464,463,462,461,460,265,261,257, [zimbra@mail3 ~]$ message=`zmmailbox -z -m ajcody@mail3.internal.DOMAIN.com s -t message "From: Adam" |awk '{ if (NR!=1) {print}}'| grep mess | awk '{ print $2 "," }' | tr -d '\n'` [zimbra@mail3 ~]$ echo $message 464,463,462,461,460,265,261,257, [zimbra@mail3 ~]$ zmmailbox -z -m ajcody@mail3.internal.DOMAIN.com dm `echo $message` [zimbra@mail3 ~]$ zmmailbox -z -m ajcody@mail3.internal.DOMAIN.com s -t message "From: Adam" num: 0, more: false [zimbra@mail3 ~]$
More Search Possibilities
Please see [Search Tips]
Export & Import Of Users Data In TGZ Format
Please see Ajcody-Migration-Notes#ZCS_User_to_Another_ZCS_Server_-_With_Rest_.26_TGZ
Seeing What & Where Of A Message ID
If your need to figure out what the actual email/message is from a logging event.
For example, log shows:
2009-03-03 22:04:58,969 INFO [btpool0-5532] [name=USER@DOMAIN.com;mid=8;ip=10.0.0.1;ua=ZimbraWebClient - IE6 (Win)/5.0.11_GA_2695.UBUNTU8_64;] mailop - moving Message (id=10955) to Folder Trash (id=3)
To see the details of the message, do the following:
zmmailbox -z -m USER@DOMAIN gm 10955 Id: 10955 Conversation-Id: 11155 Folder: /Trash Subject: FW: How are you doing? From: User External <USER@DOMAIN.com> To: <USER@DOMAIN.com> ...etc...
Message Count Mismatches
Message Count Via zmprov
To see a listing of message count in folders, replace USER@DOMAIN w/ user:
zmmailbox -z -m USER@DOMAIN gaf
You can also do something like this:
zmmailbox -z -m USER@DOMAIN s -t mess in:"FOLDER_IN_QUESTION"
If the folder has spaces, use the following format : "\"Large Share's Calendar"\"
zmprov rmc RecalculateMailboxCounts
From the zmprov help for rmc:
RecalculateMailboxCounts rmc {name@domain|id} When unread message count and quota usage are out of sync with the data in the mailbox, use this command to immediately recalculate the mailbox quota usage and unread messages count. Important: Recalculating mailbox quota usage and message count should be schedule to run in off peak hours and used on one mailbox at a time. Example: $zmprov rmc user@domain
Users should log into a new ZWC session after this was done.
If User Is Using IMAP Client
We have some bugs/rfe's in regards to how various IMAP clients operate with their delete/purge and it's impact on the our message counting.
Here's a recent one:
- "Item count should account for \Deleted IMAP messages"
- http://bugzilla.zimbra.com/show_bug.cgi?id=20620
- Resolved with 6.0.8
- http://bugzilla.zimbra.com/show_bug.cgi?id=20620
One work around was by configuring the IMAP client to move messages to a Trash/Deleted Items folder [if available] and to delete/purge messages immediately or upon sign off.
Check The Message Blobs On The File System
This is more of a sanity check, confirming the user does have what you would estimate for message blobs on the file system under their message store path.
See: Ajcody-Mysql-Topics#How_To_Locate_Users_Mailstore_and_Message_Store_Directory
You might also see "No Such Blob" messages in the ZWC client and the mailbox.log file.
See: Ajcody-Notes-No-Such-Blob
Make Sure Your Not Auto-purging Messages
These are set at the global or server level.
zmprov gacf | egrep "zimbraMailPurgeSleepInterval|zimbraMailTrashLifetime|\ zimbraMailSpamLifetime|zimbraMailMessageLifetime" zmprov gs server.domain.com | egrep "zimbraMailPurgeSleepInterval|\ zimbraMailTrashLifetime|zimbraMailSpamLifetime|zimbraMailMessageLifetime"
These at the user level:
zmprov ga user@domain | egrep "zimbraPrefInboxReadLifetime|zimbraPrefInboxUnreadLifetime|\ zimbraPrefSentLifetime|zimbraPrefJunkLifetime|zimbraPrefTrashLifetime"
Reference:
Managing Legal Requests for Information
Description:
- The ZCS legal intercept feature is used to obtain copies of email messages that are sent, received, or saved as drafts from targeted accounts and send these message to a designated “shadow” email address. Legal Intercept can be configured to send the complete content of the message or to send only the header information. When a targeted account sends, receives, or saves a draft message, an intercept message is automatically created to forward copies of the messages as attachments to the specified email address.
Please see:
- http://www.zimbra.com/docs/ne/latest/administration_guide/managing_other_zcs_features.8.1.html
- http://wiki.zimbra.com/index.php?title=Legal_Intercept
- http://bugzilla.zimbra.com/show_bug.cgi?id=17539
Persona, Identities, Send As, Send On Behalf Of Issues
For ZCS 8 And Above You Must Grant ACL Rights For sendAs and sendAsDistList for internal users
This section below only applies to versions ZCS 6 and ZCS 7. For ZCS 8 and above, the zimbraAllowFromAddress variable only is valid for external accounts and can NOT be used for internal users or ZCS distribution lists [DL's]. Please see the following for ZCS 8+
CLI Commands To Manage Persona, Identities, External Account
The following should provide you with the necessary commands to manage these user configurations:
zmprov help command| grep -i data createDataSource(cds) {name@domain} {ds-type} {ds-name} zimbraDataSourceEnabled {TRUE|FALSE} zimbraDataSourceFolderId {folder-id} [attr1 value1 [attr2 value2...]] deleteDataSource(dds) {name@domain|id} {ds-name|ds-id} getDataSources(gds) {name@domain|id} [arg1 [arg2...]] modifyDataSource(mds) {name@domain|id} {ds-name|ds-id} [attr1 value1 [attr2 value2...]]
zmprov help command| grep -i identit createIdentity(cid) {name@domain} {identity-name} [attr1 value1 [attr2 value2...]] deleteIdentity(did) {name@domain|id} {identity-name} getIdentities(gid) {name@domain|id} [arg1 [arg...]] modifyIdentity(mid) {name@domain|id} {identity-name} [attr1 value1 [attr2 value2...]]
Bugs And RFE's To Look At
Send As Issues
- "support sendAs right on server (as opposed to on-behalf-of)"
- http://bugzilla.zimbra.com/show_bug.cgi?id=22819
- "Composer should allow user to send message as self if replying on-behalf-of"
- "Implement "sendAs" rights for user accounts"
- http://bugzilla.zimbra.com/show_bug.cgi?id=22819
- "save copy of send-as message to sent-as user's Sent folder"
On Behalf Of Issues
- "send on behalf of for delegate access for ZWC"
- "reply to message in shared subfolder doesn't follow typical on behalf of behavior"
- "Need "Send on behalf of" pref"
- "Make the checkbox configurable for "Sent on behalf of""
Persona Setup With Send As [zimbraAllowFromAddress] Rights Rather Than On Behalf Of
This section below only applies to versions ZCS 6 and ZCS 7. For ZCS 8 and above, the zimbraAllowFromAddress variable only is valid for external accounts and can NOT be used for internal users or ZCS distribution lists [DL's]. Please see the following for ZCS 8+
- This was tested against ZCS 6.0.8p1 .
Attribute descriptions - 608 :
zimbra-attrs.xml:<attr id="427" name="zimbraAllowAnyFromAddress" type="boolean" cardinality="single" optionalIn="account,cos" flags="accountInfo,accountInherited"> zimbra-attrs.xml:<attr id="428" name="zimbraAllowFromAddress" type="email" max="256" cardinality="multi" optionalIn="account" flags="accountInfo,domainAdminModifiable">
- First, created a test user account:
- ajcody@rr608.zimbra.DOMAIN.com
- In the admin web console, under the users preferences tab :
- Sending Mail > checked : "Allow sending email from any address"
-
zmprov ma ajcody@rr608.zimbra.DOMAIN.com zimbraAllowAnyFromAddress TRUE
- Note, this could be setup in a COS as well and then assign the users you want to that COS
- If this is to permissive, because it does allow the user to send as anybody, then you'll want to do this instead:
-
zmprov ma ajcody@rr608.zimbra.DOMAIN.com zimbraAllowAnyFromAddress FALSE
-
zmprov ma ajcody@rr608.zimbra.DOMAIN.com zimbraAllowFromAddress personal-dl@rr608.zimbra.DOMAIN.com
- Note - bug alert.
- Testing shown that you could still have a persona setup for a particular address that wasn't set for the zimbraAllowFromAddress variable and zimbraAllowAnyFromAddress is set as FALSE. You'll be able to select it when composing a message and the message is sent with no error. But, what happens is the email is delivered to the recipient with your primary account details rather than the persona's.
- Note - bug alert.
-
-
- Sending Mail > checked : "Allow sending email from any address"
- In the admin web console, under the users preferences tab :
- ajcody@rr608.zimbra.DOMAIN.com
- If your only using a DL for the mail traffic, you would:
- Create a new DL :
- persona-dl@rr608.zimbra.DOMAIN.com
- checked "Can receive email"
- Added a user/s to the DL:
- ajcody@rr608.zimbra.DOMAIN.com
- persona-dl@rr608.zimbra.DOMAIN.com
- Create a new DL :
- Now, once that is done we can setup the persona for our "test user" - ajcody. Login as testuser
- Create a Folder called "Persona DL" and then a filter rule to move all emails with persona-dl@rr608.zimbra.DOMAIN.com to the "Persona DL" folder.
- Under the users perferences, Mail > Accounts > Add Persona button:
- Persona Name : Persona DL
- From : Persona DL # personal-dl@rr608.zimbra.DOMAIN.com
- Reply-To : Persona DL # personal-dl@rr608.zimbra.DOMAIN.com
- Use this persona:
- check "when replying or forwarding messages sent to: Persona DL # personal-dl@rr608.zimbra.DOMAIN.com
- check "when replying or forwarding messages in folder(s) : Personal DL
- Persona Name : Persona DL
- Under the users perferences, Mail > Accounts > Add Persona button:
- Create a Folder called "Persona DL" and then a filter rule to move all emails with persona-dl@rr608.zimbra.DOMAIN.com to the "Persona DL" folder.
- Things to note when using persona
- A new message in the "From" section will give a drop down for your persona choice.
- It's best to create a mail filter rule to put related messages for the persona account into a folder and then in the persona choose the option about using the persona as the default when replying to messages in that folder.
This section below only applies to versions ZCS 6 and ZCS 7. For ZCS 8 and above, the zimbraAllowFromAddress variable only is valid for external accounts and can NOT be used for internal users or ZCS distribution lists [DL's]. Please see the following for ZCS 8+
- The below how-to was tested against ZCS 6.0.8p1 .
- First, created a test user account:
- ajcody@rr608.zimbra.DOMAIN.com
- In the admin web console, under the users preferences tab :
- Sending Mail > checked : "Allow sending email from any address"
-
zmprov ma ajcody@rr608.zimbra.DOMAIN.com zimbraAllowAnyFromAddress TRUE
- Note, this could be setup in a COS as well and then assign the users you want to that COS
- If this is to permissive, because it does allow the user to send as anybody, then you'll want to do this instead:
-
zmprov ma ajcody@rr608.zimbra.DOMAIN.com zimbraAllowAnyFromAddress FALSE
-
zmprov ma ajcody@rr608.zimbra.DOMAIN.com zimbraAllowFromAddress personal-source@rr608.zimbra.DOMAIN.com
- Note - bug alert.
- Testing shown that you could still have a persona setup for a particular address that wasn't set for the zimbraAllowFromAddress variable and zimbraAllowAnyFromAddress is set as FALSE. You'll be able to select it when composing a message and the message is sent with no error. But, what happens is the email is delivered to the recipient with your primary account details rather than the persona's.
- Note - bug alert.
-
-
- Sending Mail > checked : "Allow sending email from any address"
- In the admin web console, under the users preferences tab :
- ajcody@rr608.zimbra.DOMAIN.com
- If I was only using a "shared mailbox" for the mail traffic, I would:
- First create a DL that will have the user accounts you want to share this 'new' mailbox [Inbox]:
- Create a new DL:
- persona-share@rr608.zimbra.DOMAIN.com
- checked "Can receive email"
- Added a user to the DL:
- ajcody@rr608.zimbra.DOMAIN.com
- persona-share@rr608.zimbra.DOMAIN.com
- Create a new DL:
- First create a DL that will have the user accounts you want to share this 'new' mailbox [Inbox]:
- The create a new account/mailbox that others will share:
- persona-source@rr608.zimbra.DOMAIN.com
- From the 'admin console', do "View Mail" on the new account
- Share the Inbox to the DL : persona-share@rr608.zimbra.DOMAIN.com w/ Manager or Admin Rights
- From the 'admin console', do "View Mail" on the new account
- persona-source@rr608.zimbra.DOMAIN.com
- Log back into the 'test user' acocunt - ajcody@rr608.zimbra.DOMAIN.com
- Accept the share and confirm you see the "Inbox" from the "persona-source" account.
- Then, under the users perferences, Mail > Accounts > Add Persona button::
- Persona Name : Persona Source
- From : Persona Source # persona-source@rr608.zimbra.DOMAIN.com
- Reply-To : Persona Source # persona-source@rr608.zimbra.DOMAIN.com
- Use this persona:
- check "when replying or forwarding messages sent to: persona-source@rr608.zimbra.DOMAIN.com
- check "when replying or forwarding messages in folder(s) : Persona Source's Inbox
- Persona Name : Persona Source
- Then, under the users perferences, Mail > Accounts > Add Persona button::
- Accept the share and confirm you see the "Inbox" from the "persona-source" account.
- Things to note when using persona
- A new message in the "From" section will give a drop down for your persona choice.
- It's best to create a mail filter rule to put related messages for the persona account into a folder and then in the persona choose the option about using the persona as the default when replying to messages in that folder.
- Need An RFE/BUG Report? - When you have a shared mailbox folder, the 'normal' operation when replying to messages from that folder is to send them "on behalf of". You don't want this option, since your wanting to use the persona rules. You might need to "uncheck" the box under the new message that says:
- uncheck box for "Send this message on behalf of: persona-source@rr608.zimbra.DOMAIN.com"
- I couldn't find a way to have this "unchecked" as the default.
Sieve Rules
Administrating Rules For Users - CLI
Please see King0770-Notes-Sieve_Rules_By_Proxy
Ajcody Server Topics
I moved the following pages out of this section to Ajcody-Server-Plan-Move-Migration-Upgrade-DR. It was getting to large to edit and load in web browser.
- Ajcody-Notes-ServerPlanning , was referenced as Backup Plans And Cheap HA-DR Secondary Server
- Ajcody-Migration-Notes
- Ajcody-Notes-Server-Move , also referenced as Moving To A New Server
- Ajcody-Notes-Multi-Server-Restore-DR
- Ajcody-Disaster-Recovery-Specific-Notes
- Ajcody-Notes-Upgrade-Options
Server Topics
Actual Server Topics Homepage
Please see Ajcody-Server-Topics
Issues Being Investigated
Actual Server Issues Being Investigated Homepage
Please see Ajcody-Server-Issues-Being-Investigated
License Issues
Getting License Details Via Soap - Consumed Licenses
First, flush the cache on all servers for the license information. Then do the query via soap.
zmprov fc -a license zmsoap -z GetLicenseRequest
Two lines that are generally of interest are, for example :
<attr name="TotalAccounts">3</attr> <attr name="ArchivingAccounts">3</attr>
What Should Count Against License
Real accounts, as listed in admin console under Addresses > Accounts. The admin account will count against this but the ham, spam, and wiki ones will not.
Accounts or entries listed under : Aliases , Distribution Lists, Resources should not. See below for bug about Resources though.
Deleted Accounts Still Show In Use
Please see:
- "deleted accounts don't update license count till server restart"
Another suggestion if zimbra restarts don't work, as zimbra:
zmprov fc license
When you have multi ZCS servers:
zmprov fc -a license
Resources Counting Against License
Please see:
- "resources should not count against the licensed user count"
Workaround is :
zmcontrol stop
zmcontrol start
Tested on 5.0.9
- license count 5
- created two resources
- license count 7
zmcontrol stop
zmcontrol start
- license count 5
Performance Issues When Using Mini-Cal And You Have zimbraMailCanonicalAddress Set To Domains You Don't Have
Background Bugs:
Do you have any user's with the variable zimbraMailCanonicalAddress set using a domain that is not within your Zimbra infrastructure? There was case that had that set for a particular user to a domain they didn't have within Zimbra and the symptom showed as a performance issue within the mini-calendar & calendar. The root cause was actually the ldap lookups occurring in the background (those against the zimbraMailCanonicalAddress domain).
- One work around was setting:
-
zmlocalconfig -e ldap_starttls_supported=0
-
ldap stop
-
ldap start
-
-
zmlocalconfig -e zimbra_require_interprocess_security=0
- To update the postfix configuration files.
-
/opt/zimbra/libexec/zmmtainit
-
- To update amavis config files.
-
/opt/zimbra/libexec/zmmtaconfig amavis
-
- Then restart the system. Still need to double check this will be necessary.
- See release notes about ldap_starttls_supported
- And bug: http://bugzilla.zimbra.com/show_bug.cgi?id=24762
- Also see the below bug, comments 75 onward:
-
- The other workaround was to remove the zimbraMailCanonicalAddress variable.
5.0.7+ Performance & Hanging Issues
Administrators might or might not catch this events being tied to calendars or ics data. Here's what I've gather from other cases so far about the issue, there's about 5 of them I've seen. None are resolved at this time (July 23, 08), so use with caution.
1. bug: http://bugzilla.zimbra.com/show_bug.cgi?id=29596 The resolution for this bug would involve an upgrade to 5.0.8 .
- One customer has reported the upgrade to 5.0.8 has resolved their issue so far. They also confirm that the ics files were being processed with much faster times as logged in mailbox.log
- Second customer has confirmed upgrade to 5.0.8 has resolved their issue.
2. Check a the thread dump if the message is getting stuck during an invite email delivery to a conference room. You can guess the calendar object based on the emails in the conference room's Inbox.
3. Also check their recurrence expansion configuration in LDAP with:
"zmprov gacf | grep zimbraCalendarRecurrence".
On a clean install you should see:
zimbraCalendarRecurrenceDailyMaxDays: 730 zimbraCalendarRecurrenceMaxInstances: 0 zimbraCalendarRecurrenceMonthlyMaxMonths: 360 zimbraCalendarRecurrenceOtherFrequencyMaxYears: 1 zimbraCalendarRecurrenceWeeklyMaxWeeks: 520 zimbraCalendarRecurrenceYearlyMaxYears: 100
If these are set to 0, the sysadmin enabled near-infinite expansion on purpose. If these are missing, it's an upgrade problem. The code will default the values to 0 and thus infinite loop. Set them to the above values to avoid long expansions.If these are set to 0, please set to the above values to avoid long exp.
- One customer has reported that the variables weren't set and they set them to the defaults. Restarted zimbra and issues appear to be resolved. They are holding off on 5.0.8 upgrade at this point.
4. Also you are might hitting bug ( http://bugzilla.zimbra.com/show_bug.cgi?id=28397 - this is a private bug) or something similar like this caused by an offending appointment. You can also find out the mailbox (conference room/user) and put it into maintenance mode to keep the mails flowing. Then try to flush the queue.
Upgrade Issues
Please check the Support Portal page for the most recent issues related to newly released ZCS versions. That is were "issues" are generally posted when we discover "new" situations arising from newly released versions.
Very Long Upgrade Times
zmfixperms Causing Long Upgrade Times - HSM Configurations Effected Usually
Please see:
- "zmfixperms : pass in directories not to touch OR don't include other dirs unless -extended specified"
Upper Case Hostname Causes Problems With Install/Upgrade
I believe this is new for version 5.0.8+. Until you adjust the case, the installer script will not continue. It's usually picking up the upper case hostname from the server's /etc/hosts entry. Please don't do this, use upper case in your hosts file ... Unix is not Windows.
- Make the install case insensitive on hostname
LDAP Topics
Actual LDAP Topics Homepage
Please see Ajcody-LDAP-Topics
LDAP Error Codes
A nice reference on ldap errors codes:
Working With ldap Commands - The Easy Way
Tired of working with long ldap strings on the CLI with ldapmodify, ldapsearch, ldapdelete.
zimbra$ source ~/bin/zmshutil zimbra$ zmsetvars
You can now use this string syntax to make things a little easier.
ldapCOMMAND -x -H $ldap_master_url -D $zimbra_ldap_userdn -w $zimbra_ldap_password ACTION
Anonymous Binds
For new installations of ZCS 6.0, anonymous searches of the directory are disabled. (Bug 15378) When you upgrade to 6.0, anonymous searches of the directory are enabled, matching previous release behavior.
- To disable anonymous search after upgrading, on each LDAP server, as zimbra run
-
/opt/zimbra/libexec/zmldapanon -d
-
- To enable anonymous access at any point after it is disabled, on each LDAP server run
-
/opt/zimbra/libexec/zmldapanon -e
-
Important: Enabling anonymous binds is not recommended as it may expose data not intended for anonymous access
Ref:
- "Obviate the need for and disallow LDAP anonymous binds"
Searching For Account In LDAP
To do ldapsearch for the account, and see if there are any related entries in ldap.
su - zimbra source ~/bin/zmshutil zmsetvars ldapsearch -x -H $ldap_master_url -D $zimbra_ldap_userdn -w $zimbra_ldap_password "mail=USER@DOMAIN.com"
To just dump the whole thing [to grep and so forth]:
su - zimbra source ~/bin/zmshutil zmsetvars ldapsearch -x -H $ldap_master_url -D $zimbra_ldap_userdn -w $zimbra_ldap_password
Searching For Accounts On A Particular Mailstore
To do ldapsearch for the account, and see if there are any related entries in ldap.
su - zimbra source ~/bin/zmshutil zmsetvars ldapsearch -x -H $ldap_master_url -D $zimbra_ldap_userdn -w $zimbra_ldap_password "zimbraMailHost=YOURMAILSTORE.COM"
Other LDAP Search Example
See http://wiki.zimbra.com/wiki/ShanxT-LDAP-CheatSheet
ldapsearch over 636 from non-ZCS linux client
From your ZCS ldap server, you'll want to get the following information:
zmhostname zmlocalconfig -s | egrep 'ldap_master_url|ldap_url|ldap_starttls_supported|ldap_port|zimbra_ldap_password'
Replace the details below as followed: ZMHOSTNAME with zmhostname's output above, PASSWORD with zimbra_ldap_password from above. Also adjust the -b 'ou=people,dc=DOMAIN,dc=com' to reflect your domain string. The other variables should state port 636 if your setup for ldaps [ref: How_to_enable_ldaps Now try the following now on the ldap server below to confirm ldapsearch works :
ldapsearch -x -H ldaps://ZMHOSTNAME:636 -D uid=zimbra,cn=admins,cn=zimbra -w PASSWORD -LLL -b 'ou=people,dc=DOMAIN,dc=com' -Z
Now, example uses a centos/rhe machine and therefor I use yum vs apt-get, let's setup the non-ZCS linux machine to test the query:
yum install openldap-clients vi /etc/openldap/ldap.conf * add TLS_REQCERT allow
And now the search test from the non-zcs linux host [I provide a couple lines of the output in the example below]. Remember to replace the ZMHOSTNAME and PASSWORD values below with your variables and the -b 'ou=people,dc=DOMAIN,dc=com' to reflect your domain string. :
ldapsearch -x -H ldaps://ZMHOSTNAME:636 -D uid=zimbra,cn=admins,cn=zimbra -w PASSWORD -LLL -b 'ou=people,dc=DOMAIN,dc=com' -Z ldap_start_tls: Operations error (1) additional info: TLS already started dn: ou=people,dc=DOMAIN,dc=com objectClass: organizationalRole ou: people cn: people
Deleting An Account In LDAP
Via zmprov
- Caution - this should normally only be done under guidance or request by support.
This will delete the account from ldap and not from the db (mysql). It also retains the mail store and index data:
zmprov -l da <USER@DOMAIN.com>
Via ldapdelete
- Caution - this should normally only be done under guidance or request by support.
One way:
su - zimbra source ~/bin/zmshutil zmsetvars ldapsearch -LLL -x -H $ldap_master_url -D $zimbra_ldap_userdn -w $zimbra_ldap_password "mail=ajcody@zimbra.DOMAIN.com" dn dn: uid=ajcody,ou=people,dc=zimbra,dc=DOMAIN,dc=com ldapdelete -r -x -H $ldap_master_url -D $zimbra_ldap_userdn -w $zimbra_ldap_password uid=ajcody,ou=people,dc=zimbra,dc=DOMAIN,dc=com
Once done, you should be able to add or remove the account using 'zmprov ca' command.
db_recover For OpenLdap DB In /opt/zimbra/openldap-data
- Caution - this should normally only be done under guidance or request by support.
For ZCS 5.x
This will cause an impact to your user base, since we'll be stopping the ldap service.
su - zimbra cd /opt/zimbra/openldap-data ls -la **Notice the __db.00# files** ldap stop /opt/zimbra/sleepycat/bin/db_recover ls -la **Notice the __db.00# files are gone** ldap start
Attempt To Cover Versions Higher Than ZCS5 - I've yet to confirm the below
ZCS 6.X.X
# su - zimbra $ ldap stop $ cd /opt/zimbra/openldap-data $ /opt/zimbra/sleepycat/bin/db_recover
and also, if this is a ldap master:
$ cd /opt/zimbra/openldap-data/accesslog/db $ /opt/zimbra/sleepycat/bin/db_recover
ZCS 7.0.x
unconfirmed
7.1.x
# su - zimbra $ ldap stop $ cd /opt/zimbra/data/ldap/hdb/db $ /opt/zimbra/bdb/bin/db_recover
7.1.x Ldap Replica & Mailstore - Case Notes
Error customer had in /var/log/zimbra.log after /opt/zimbra partition hit 100% usage.
Aug 25 15:51:12 SERVER postfix/smtpd[20470]: NOQUEUE: reject: MAIL from localhost.localdomain[127.0.0.1]: 452 4.3.1 Insufficient system storage; proto=ESMTP helo=<localhost> Aug 25 15:51:12 SERVER amavis[16494]: (16494-03) smtp resp to MAIL (pip): 452 4.3.1 Insufficient system storage and later.... Aug 25 17:34:27 SERVER slapd[5627]: @(#) $OpenLDAP: slapd 2.4.26 (Sep 7 2011 12:24:16) $#012#011build@zre-rhel6-64.eng.vmware.com:/home/build/p4/HELIX/ThirdParty/openldap/openldap-2.4.26.5z/servers/slapd Aug 25 17:34:27 SERVER slapd[5628]: hdb_db_open: database "": unclean shutdown detected; attempting recovery. Aug 25 17:34:27 SERVER slapd[5628]: bdb(): file unknown has LSN 146/8895192, past end of log at 146/7885578 Aug 25 17:34:27 SERVER slapd[5628]: bdb(): Commonly caused by moving a database from one database environment Aug 25 17:34:27 SERVER slapd[5628]: bdb(): to another without clearing the database LSNs, or by removing all of Aug 25 17:34:27 SERVER slapd[5628]: bdb(): the log files from a database environment Aug 25 17:34:28 SERVER slapd[5628]: bdb(): file id2entry.bdb has LSN 146/8895192, past end of log at 146/7887443 Aug 25 17:34:28 SERVER slapd[5628]: bdb(): Commonly caused by moving a database from one database environment Aug 25 17:34:28 SERVER slapd[5628]: bdb(): to another without clearing the database LSNs, or by removing all of Aug 25 17:34:28 SERVER slapd[5628]: bdb(): the log files from a database environment Aug 25 17:34:28 SERVER slapd[5628]: bdb(): /opt/zimbra/data/ldap/hdb/db/id2entry.bdb: unexpected file type or format Aug 25 17:34:28 SERVER slapd[5628]: hdb_db_open: database "": db_open(/opt/zimbra/data/ldap/hdb/db/id2entry.bdb) failed: Invalid argument (22). Aug 25 17:34:28 SERVER slapd[5628]: backend_startup_one (type=hdb, suffix=""): bi_db_open failed! (22) Aug 25 17:34:28 SERVER slapd[5628]: bdb_db_close: database "": alock_close failed Aug 25 17:34:28 SERVER slapd[5628]: slapd stopped. Aug 25 17:34:32 SERVER slapd[5631]: @(#) $OpenLDAP: slapd 2.4.26 (Sep 7 2011 12:24:16) $#012#011build@zre-rhel6-64.eng.vmware.com:/home/build/p4/HELIX/ThirdParty/openldap/openldap-2.4.26.5z/servers/slapd Aug 25 17:34:32 SERVER slapd[5632]: bdb(): file id2entry.bdb has LSN 146/8895192, past end of log at 146/7887499 Aug 25 17:34:32 SERVER slapd[5632]: bdb(): Commonly caused by moving a database from one database environment Aug 25 17:34:32 SERVER slapd[5632]: bdb(): to another without clearing the database LSNs, or by removing all of Aug 25 17:34:32 SERVER slapd[5632]: bdb(): the log files from a database environment Aug 25 17:34:32 SERVER slapd[5632]: bdb(): /opt/zimbra/data/ldap/hdb/db/id2entry.bdb: unexpected file type or format Aug 25 17:34:32 SERVER slapd[5632]: hdb_db_open: database "": db_open(/opt/zimbra/data/ldap/hdb/db/id2entry.bdb) failed: Invalid argument (22). Aug 25 17:34:32 SERVER slapd[5632]: backend_startup_one (type=hdb, suffix=""): bi_db_open failed! (22) Aug 25 17:34:32 SERVER slapd[5632]: bdb_db_close: database "": alock_close failed Aug 25 17:34:32 SERVER slapd[5632]: slapd stopped.
Error from the command line when attempting zmcontrol start or ldap start:
Starting ldap...Done. Failed. Failed to start slapd. Attempting debug start to determine error. hdb_db_open: database "": db_open(/opt/zimbra/data/ldap/hdb/db/id2entry.bdb) failed: Invalid argument (22). backend_startup_one (type=hdb, suffix=""): bi_db_open failed! (22) bdb_db_close: database "": alock_close failed
Attempted ldap db recovery.
su - zimbra zmcontrol stop cd /opt/zimbra/data/ldap/hdb/db /opt/zimbra/bdb/bin/db_recover
That didn't work.
Removal of the alock [/opt/zimbra/data/ldap/hdb/db/alock] file also didn't work, ldap start failed with same error and created a new alock file.
Proceeded with some of the steps taken from this reference: http://wiki.zimbra.com/wiki/LDAP_data_import_export
cd /opt/zimbra/data/ldap/ mv hdb hdb.old
Create the new directory structure :
mkdir -p hdb/db mkdir -p hdb/logs mv hdb hdb.old ldap start
Confirmed ldap started ok and also checked replica status.
/opt/zimbra/libexec/zmreplchk Code: 0 Status: In Sync
zimbra.log looked good.
zmcontrol start
And the rest of the zimbra services came up cleanly.
Ldap Restore
To find the LDAP session labels type -lbs.
zmrestoreldap -lbs
Restore the complete LDAP directory server [example]
zmrestoreldap -lb full20061130135236
ldapmodify Examples
Removing An Alias That Is Also Primary Account
Bug Reference:
- "renameAccount allows primary to be renamed as existing AccountAlias - breaking account"
External Reference:
Description of problem:
When I try to remove the alias that matches the primary account with zmprov or to delete the Alias in the web console it fails. And attempt to restore the account to another name [ -ca -pre old_] fails as well [Error occurred: Read timed out].
An attempt to rename the primary account doesn't avoid the issue with the matching alias name.
[zimbra@mail root]$ zmprov ra USER@DOMAIN.com USER_OLD@DOMAIN.com [zimbra@mail root]$ zmprov raa USER_OLD@DOMAIN.com USER@DOMAIN.com ERROR: account.NO_SUCH_ALIAS (no such alias: USER@DOMAIN.com) [zimbra@mail root]$ zmprov ra USER_OLD@DOMAIN.com USER@DOMAIN.com
Also, whenever I rename the account, the alias gets renamed with it. Even when using the zimbraID to rename the account.
The following will confirm the issue as it will show a zimbraMailAlias matching a mail variable.
su - zimbra source ~/bin/zmshutil zmsetvars ldapsearch -x -H $ldap_master_url -D $zimbra_ldap_userdn -w $zimbra_ldap_password "mail=USER@DOMAIN.com"
##shows us something like this##
[cut] # USER, people, DOMAIN.com dn: uid=USER,ou=people,dc=DOMAIN,dc=com [cut] mail: USER@DOMAIN.com mail: USER_Alias1@DOMAIN.com mail: USER_Alias2@DOMAIN.com mail: USER_Alias3@DOMAIN.com zimbraMailAlias: USER@DOMAIN.com zimbraMailAlias: USER_Alias1@DOMAIN.com zimbraMailAlias: USER_Alias2@DOMAIN.com zimbraMailAlias: USER_Alias3@DOMAIN.com [cut]
To use ldapmodify to replace the aliases, you would construct a statement like this:
[if you haven't already done this in the current shell] su - zimbra source ~/bin/zmshutil zmsetvars [end]
ldapmodify -x -H $ldap_master_url -D $zimbra_ldap_userdn -w $zimbra_ldap_password dn: uid=USER,ou=people,dc=DOMAIN,dc=com changetype: modify replace: zimbraMailAlias zimbraMailAlias: USER_Alias1@DOMAIN.com zimbraMailAlias: USER_Alias2@DOMAIN.com zimbraMailAlias: USER_Alias3@DOMAIN.com [ctrl-D executes this change and drops you to prompt]
zmprov flushCache account USER@DOMAIN.com
Notice the absence of the zimbraMailAlias: USER@DOMAIN.com variable.
To use ldapmodify to delete ALL aliases, you would construct a statement like this:
[if you haven't already done this in the current shell] su - zimbra source ~/bin/zmshutil zmsetvars [end]
ldapmodify -x -H $ldap_master_url -D $zimbra_ldap_userdn -w $zimbra_ldap_password dn: uid=USER,ou=people,dc=DOMAIN,dc=com changetype: modify delete: zimbraMailAlias [ctrl-D executes this change and drops you to prompt]
zmprov flushCache account USER@DOMAIN.com
You can also place the edit's in a text file and run it like:
[if you haven't already done this in the current shell] su - zimbra source ~/bin/zmshutil zmsetvars [end]
ldapmodify -x -H $ldap_master_url -D $zimbra_ldap_userdn -w $zimbra_ldap_password -f fix-account.ldif
zmprov flushCache account USER@DOMAIN.com
If you were to do multiple operations, you would need to include the - marker. For example:
userprompt> ldapmodify -D bindDN -w password -h server1 dn: cn=Niels Nelissen,ou=people,dc=example,dc=com changetype: modify delete: telephonenumber - add: manager manager: cn=Peter Petersen,ou=people,dc=example,dc=com ^D userprompt>
db_recover For OpenLdap Accesslog DB In /opt/zimbra/openldap-data/accesslog/db
- Caution - this should normally only be done under guidance or request by support.
For ZCS 5.x Only
This will cause an impact to your user base, since we'll be stopping the ldap service.
For replication issues.
- Steps Removed At This Time.
Re-indexing Openldap
- Caution - this should normally only be done under guidance or request by support.
This will cause an impact to your user base, since we'll be stopping the ldap service.
su - zimbra cd /opt/zimbra/openldap-data ldap stop /opt/zimbra/openldap/sbin/slapindex -f /opt/zimbra/conf/slapd.conf
Purging Logs From /opt/zimbra/openldap-data/logs
- Caution - this should normally only be done under guidance or request by support.
DB_CONFIG sets the log variable, it should be /opt/zimbra/openldap-data/logs .
ldap stop db_checkpoint -1 -h /opt/zimbra/openldap-data db_archive -h /opt/zimbra/openldap-data rm <logs listed from db_archive> ldap start
What Does - connection_read : no connection! - In zimbra.log Indicate
Developer responses I've had on this question:
- One ldap server is seeing it and others aren't, then confirm the logging levels are set the same
- This informative message indicates that a client disconnected without sending an unbind request first. It is quite common and certainly something to ignore.
Note, customer also gave me feedback that they ended up seeing this as a result of they way their load-balancers were operating.
Change LDAP Port On Zimbra
It is recommend that there is no other LDAP service running on the ZCS besides Zimbra's. But if you find the need to change it, here's the steps.
You can modify the default [389] port ldap uses to port 390 by doing the following [change LDAPHOSTNAME.com to your server name]:
zmlocalconfig -e ldap_port=390 zmlocalconfig -e ldap_master_url=ldap://LDAPHOSTNAME.com:390 zmlocalconfig -e ldap_url=ldap://LDAPHOSTNAME.com:390
Note you need to do all three of these or things will break. Once you've run those commands, you will need to restart ZCS:
zmcontrol stop zmcontrol start
Once this is completed, Zimbra will run with LDAP on port 390 rather than port 389 (the default). If you'd like to use a port other than 390, substitute that port for 390 and use the same process.
Can't Setup/Install LDAP Replica
Please see bug against documentation:
- "Update ch5 multi-server replication instructions"
- http://bugzilla.zimbra.com/show_bug.cgi?id=26117
- Updates from the bug seem to be mostly going into the Multi-Server documentation.
- http://bugzilla.zimbra.com/show_bug.cgi?id=26117
Checking /tmp/zmsetup.log will expose errors with installation configuration, for example below, others are listed in my notes farther down:
: Thu Aug 21 16:00:12 2008 *** Running as zimbra user: /opt/zimbra/bin/zmlicense -c Error: exception occurred: system failure: ZimbraLdapContext when running 'zmcontrol start': [zimbra@mail1b ~]$ zmcontrol start Host mail1b.DOMAINNAME Unable to determine enabled services from ldap. Unable to determine enabled services. Cache is out of date or doesn't exist.
Make sure you are using the right passwords. If the ldap replica can't authenticate to the master LDAP server it will not be able to pull down the ldap configurations it needs - one of which is the license data.
My Notes From The Case That I Made For Bug 26117
- Verified Fixed for 5.0.10+ in regards to bug 26117
Summary
Action Items:
- Update doc's to reflect ldap repli password setting during install (all ref docs miss this step)
- If this is done during install, no other action is needed except logger and sshkeys (zmupdateauthkeys)
- Update doc's to reflect recovery steps on an improper install for ldap replication server
- Make comments consistent. See LDAP wiki page
- Update installer to require ldap repli password rather default to random set
password.
References:
- "Update ch5 multi-server replication instructions"
- http://bugzilla.zimbra.com/show_bug.cgi?id=26117
- Verified fix for 5.0.10+
- http://bugzilla.zimbra.com/show_bug.cgi?id=26117
- Main LDAP Wiki Page
- http://www.zimbra.com/docs/os/latest/multi_server_install/LDAP%20Replication.6.1.html
- http://www.zimbra.com/elqNow/elqRedir.htm?ref=http://files.zimbra.com/website/docs/Zimbra%20NE%20Multi-Server%20Install.pdf
LDAP replication has some comments that aren't in other places
- Set the master LDAP password to the correct value (run zmlocalconfig -s ldap_root_password on the master to determine this value)
- Note: In order to install an LDAP replica server with no MBS (Mailbox Server), set zimbra_zmprov_default_to_ldap to true, using the following command:
-
zmlocalconfig -e zimbra_zmprov_default_to_ldap=true.
- If you later add an MBS to your LDAP replica server, set zimbra_zmprov_default_to_ldap to false.
-
- After the installation is complete, run /opt/zimbra/libexec/zmldapenablereplica on the replica server. This will enable replication in the LDAP server and will force an LDAP restart to begin pulling data from the master. zmldapenablereplica must be run on both the master and replica for LDAP replication to work.
The Work
Duplicated on ZCS 5.0.2 - OS Redhat.
Current Servers For Test:
- Setup LDAP MAIN server - zldap1 (ldap only configured server)
- setting passwords to "PASSWORD"
- Mailstore server - zmail2 (mailstore only config)
- MTA server - zmta1 (mta only config)
- Post install
- enable logger
- enable ssh keys
- run zmupdateauthkeys on servers
- created two test accounts and confirmed email delivery between the two.
- On LDAP MAIN (zldap1)- zmldapenablereplica
- Setup LDAP MAIN server - zldap1 (ldap only configured server)
Install LDAP repli - zldap3
- Doc show only to set
- ldap master host
- Master ldap server password
- Create Domain to no
- It fails to include
- Replication Password (part of "Ldap configuration")
- If this is not done, install will finish but you get these errors.
- Replication Password (part of "Ldap configuration")
- [zimbra@zldap3 ~]$ zmcontrol status
- Cannot determine services - exiting
- zldap3.DOMAIN.com...ERROR: service.FAILURE (system failure: getDirectContext)
- (cause: javax.naming.AuthenticationException [LDAP: error code 49 - Invalid Credentials])
- Doc show only to set
To Correct Without Reinstalling
If this has happened and you want to correct without a reinstall. Do the following, please adjust for HOSTNAMES for LDAP MAIN and LDAP REPLICA.
- confirm ssh keys are updated
- run zmupdateauthkeys on all servers
- confirm current settings on LDAP MAIN
- zmlocalconfig -s | grep replication
- grep credentials /opt/zimbra/conf/slapd.conf
- confirm current settings on LDAP REPLI
- grep credentials /opt/zimbra/conf/slapd.conf
- zmlocalconfig -s | grep replication
- Now reconfigure on LDAP REPLI
zmldappasswd -l [passwd from ldap main slapd.conf]
- This does not dynamically update the slapd.conf variable, it puts it in the zmconfig file /opt/zimbra/libexec/zmldapenablereplica
- You'll see that it updates the slapd.conf
- There might be one auth error, until the slapd.conf is reconfigured.
- zmprov gacf will fail with auth errors
- Confirm again settings on LDAP REPLI
- grep credentials /opt/zimbra/conf/slapd.conf
- zmlocalconfig -s | grep replication
- zmlocalconfig | grep ldap_url
- Should have repli first and ldap main second
- Now to confirm it worked
- zmcontrol stop
- zmcontrol start
- zmcontrol status
- Create a test account on LDAP MAIN (example uses test3)
- On LDAP REPLI - replace hostname and test account below
-
ldapsearch -x -H ldap://LDAPREPLICA.DOMAIN.com:389 | grep test3
-
Disable LDAP Replica
References:
http://wiki.zimbra.com/index.php?title=Promoting_Replica_to_LDAP_Master
http://www.zimbra.com/docs/os/latest/multi_server_install/LDAP%20Replication.6.1.html
Remove LDAP Replica From All Active Servers
On each member server, including the replica itself, verify the ldap_url value.
zmlocalconfig ldap_url
Modify the ldap_url to only include enabled ZCS LDAP servers. The master LDAP server should always be at the end of the ldap_url string value.
zmlocalconfig -e ldap_url="ldap://<replica-server-host> ldap://<master-server-host>"
Disable LDAP On The Replica
Stop Zimbra services.
zmcontrol stop
The - in front of zimbraServiceEnabled is [off], rather than a + for [on].
zmprov -l ms `zmhostname` -zimbraServiceEnabled ldap
To enable the ldap service, prefix the zimbraServiceEnabled attribute with a "+".
zmprov -l ms `zmhostname` +zimbraServiceEnabled ldap
If other services are enabled on this host, start them.
zmcontrol start
Additional Steps for MTA hosts
After updating the ldap_url with zmlocalconfig, rerun /opt/zimbra/libexec/zmmtainit. This rewrites the Postfix configuration with the updated ldap_url.
Disabling Replication On The Master
ZCS 5.x
Use only if disabling replication entirely across all nodes.
Edit /opt/zimbra/conf/slapd.conf.in adding the following comments. Please use the precise number of hash marks (#) shown.
change
include /opt/zimbra/conf/master-accesslog.conf
to
###include /opt/zimbra/conf/master-accesslog.conf
change
overlay syncprov syncprov-checkpoint 20 10 syncprov-sessionlog 500 include /opt/zimbra/conf/master-accesslog-overlay.conf
to
#overlay syncprov #syncprov-checkpoint 20 10 #syncprov-sessionlog 500 ###include /opt/zimbra/conf/master-accesslog-overlay.conf
Restart the master LDAP server
ldap stop; ldap start
Promoting Replica To LDAP Master
Please see:
- Promoting_Replica_to_LDAP_Master
- [1]
- Be sure to reference, especially area around "zmenableldapreplica": ZCS Multi-Server Installation Guide, LDAP Replication
Importing LDAP data from master to replica 6.0
Please see:
BDB - Underlying Database Used For LDAP Data
BDB is the underlying high-performance transactional database used to store the LDAP data.
See:
- Performance_Tuning_Guidelines_for_Large_Deployments
- Performance_Tuning_Guidelines_for_Large_Deployments#Configuring_the_BDB_subsystem_to_increase_LDAP_server_performance
db_stat
The db_stat utility displays statistics for Berkeley DB environments.
Example output:
[zimbra@mail3 openldap-data]$ db_stat -c -h /opt/zimbra/openldap-data 462 Last allocated locker ID. 2147M Current maximum unused locker ID. 9 Number of lock modes. 3000 Maximum number of locks possible. 1500 Maximum number of lockers possible. 1500 Maximum number of lock objects possible. 19 Number of current locks. 73 Maximum number of locks at any one time. 62 Number of current lockers. 68 Maximum number of lockers at any one time. 19 Number of current lock objects. 50 Maximum number of lock objects at any one time. 1784391 Total number of locks requested. 1784372 Total number of locks released. 0 Total number of lock requests failing because DB_LOCK_NOWAIT was set. 8 Total number of locks not immediately available due to conflicts. 0 Number of deadlocks. 0 Lock timeout value. 0 Number of locks that have timed out. 0 Transaction timeout value. 0 Number of transactions that have timed out. 968KB The size of the lock region.. 6 The number of region locks granted after waiting. 3543865 The number of region locks granted without waiting.
db_archive
The db_archive utility writes the pathnames of log files that are no longer in use (for example, no longer involved in active transactions), to the standard output, one pathname per line. These log files should be written to backup media to provide for recovery in the case of catastrophic failure (which also requires a snapshot of the database files), but they may then be deleted from the system to reclaim disk space.
db_checkpoint
The db_checkpoint utility is a daemon process that monitors the database log, and periodically calls DB_ENV->txn_checkpoint to checkpoint it.
db_deadlock
db_dump
db_load
db_recover
Ldap Replica Styles And Timeframes
Please see this external reference:
- OpenLDAP syncrepl RefreshAndPersist
- http://www.zytrax.com/books/ldap/ch7/#ol-syncrepl-rap
- Full Chapter Topic
- http://www.zytrax.com/books/ldap/ch7/
LDAP And OverLays
We don't [officially] support running additional overlays with OpenLDAP.
SLAPO-RWM OVERLAY RWM
And slapo-rwm is known to be buggy in OpenLDAP 2.3.43 and continues to be buggy to this day in OpenLDAP 2.4. It certainly won't work with ZCS 5.0.16.
We would advise customers to avoid using it until it stabilizes, though they need to understand it's still going to be unsupported by us.
Where one places "overlay rwm" in the slapd.conf file has been known to cause issues as well. RWM has problems in the order in which it is loaded. There are at least 2 open bugs currently in the OpenLDAP ITS tracker.
GAL (Server) Topics
Actual GAL (Server) Topics Notes Homepage
Please see Ajcody-Notes-ServerGAL
GAL Behavior Bugs/RFE's
GAL And Alises
Please see the following:
- "hide aliases in GAL on a per-alias basis"
- Some background bugs/rfe's on gal - alias issues:
- "hide account alias in gal search for ZWC"
- "All aliases appear when doing GAL auto-complete when composing new message"
Canonical Addresses - Beyond GAL Issues Really
Please see the following:
- "deprecate canonical address"
- "Please add subaddressing support to email addresses"
External GAL Source
Please see:
Setting/Checking GAL Varaibles
CLI To Sync Gal On Server
Truthfully, I'm not sure of the reasoning behind the command but this might be useful in trouble shooting connector issues with GAL sync issues.
zmprov syg DOMAINNAME.com
4.5.x versions will need quotes at the end.
zmprov syg DOMAINAME.com ""
My Gal & LDAP Settings For A Domain
To see your setting, do the following - replacing with domainname with the domain in question.
su - zimbra zmprov gd [domainname] zimbraGalLdapSearchBase zmprov gd [domainname] zimbraGalSyncLdapSearchBase
You'll see more GAL/LDAP related variables with:
zmprov gd domainname | egrep -i 'ldap|gal'
They are set using:
zmprov md [domainname] zimbraGalLdapSearchBase variable zmprov md [domainname] zimbraGalSyncLdapSearchBase variable
Want My GAL To See All Domains
The default of a domain GAL [zimbraGalInternalSearchBase] is to see only it's domain. To have the GAL for a domain to see all domains on the server you need to set the variable to ROOT.
To see the existing setting:
zmprov gd [domainname] zimbraGalLdapSearchBase
To change the variable for the domain:
zmprov md [domainname] zimbraGalInternalSearchBase ROOT
All global change would be done with:
zmprov mcf zimbraGalInternalSearchBase ROOT
Some Other Ideas - Especially With Multiple Domains And ZCS Servers
This is just some notes I made for a specific case where there were multiple ZCS installs across sister companies. They didn't have a multi-server install and weren't sharing LDAP data therefore.
Here's some ideas I'm considering for this situation:
- Dump GAL data from each server and combine date to either:
- an external LDAP server you can then configure the ZCS servers to use as an external GAL
- admin console > domain > GAL > Configure GAL > Both or External
- reformat GAL data so it can then be imported as an address book via the CLI into a sharead adddressbook on each server. Setup command to run from cron.
- an external LDAP server you can then configure the ZCS servers to use as an external GAL
- Just setup an external Openldap server (which would have replica's at each site) that can be used as an external GAL - make this authoritative in your company. Then setup the ZCS to use it as an external GAL.
- To actually move your infrastructure of ZCS servers into one primary ZCS configuration. Instead of having each site/domain having it's own primary LDAP/ZCS server they would become LDAP replica servers with their domain mailstore's being local to each site. Configure each site/domain to use it's own MTA - if you want/need. And then internally to Zimbra you could set the GAL to be ROOT rather than DOMAIN.
Some bugs to review that touch on this:
- "Add support for multiple GALs per domain"
- "groupings for GAL contacts for 'Select Addresses' dialog and or GAL"
- "GAL via contacts folders with sorting, browsing and real sync"
I'm sure there's some other possibilities.
GAL Related Attributes Usage
This is from earlier 5.x versions, newer version might include more variables.
Attribute scope For GAL op - zimbra - autocomplete - external - serarch - both - sync - all ====================================================================================================================================================================== zimbraHideInGal account,DL,CR zimbra all zimbraFeatureGalEnabled account,cos both search,sync zimbraFeatureGalAutoCompleteEnabled account,cos both autocomplete zimbraPrefGalAutoCompleteEnabled account,cos both autocomplete zimbraGalMode domain both all zimbraGalLdapFilterDef globalConfig both all zimbraGalLdapAttrMap domain,globalConfig both all zimbraGalMaxResults domain,globalConfig both autocomplete, search (for sync, system does not specify a max when searching LDAP) zimbraGalTokenizeAutoCompleteKey domain both autocomplete zimbraGalTokenizeSearchKey domain both search zimbraGalLdapPageSize domain,globalConfig both autocomplete, search, (sync if zimbraGalSyncLdapPageSize is not set) zimbraGalSyncLdapPageSize domain,globalConfig both sync ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- zimbraGalInternalSearchBase domain,globalConfig zimbra autocomplete, search, (sync if zimbraGalSyncInternalSearchBase is not set) zimbraGalSyncInternalSearchBase domain,globalConfig zimbra sync ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- zimbraGalLdapURL domain external autocomplete, search, (sync if zimbraGalSyncLdapURL is not set) zimbraGalSyncLdapURL domain external sync zimbraGalLdapSearchBase domain external autocomplete, search, (sync if zimbraGalSyncLdapSearchBase is not set) zimbraGalSyncLdapSearchBase domain external sync zimbraGalLdapAuthMech domain external autocomplete, search, (sync if zimbraGalSyncLdapAuthMech is not set) zimbraGalSyncLdapAuthMech domain external sync zimbraGalLdapBindDn domain external autocomplete, search, (sync if zimbraGalSyncLdapBindDn is not set) zimbraGalSyncLdapBindDn domain external sync zimbraGalLdapBindPassword domain external autocomplete, search, (sync if zimbraGalSyncLdapBindPassword is not set) zimbraGalSyncLdapBindPassword domain external sync zimbraGalLdapKerberos5Principal domain external autocomplete, search, (sync if zimbraGalSyncLdapKerberos5Principal is not set) zimbraGalSyncLdapKerberos5Principal domain external sync zimbraGalLdapKerberos5Keytab domain external autocomplete, search, (sync if zimbraGalSyncLdapKerberos5Keytab is not set) zimbraGalSyncLdapKerberos5Keytab domain external sync zimbraGalAutoCompleteLdapFilter domain,globalConfig external autocomplete zimbraGalLdapFilter domain external search, (sync if zimbraGalLdapSyncFilter is not set) zimbraGalSyncLdapFilter domain external sync
External Authentication
Actual External Authentication Homepage
Please see Ajcody-External-Authentication
General Topics
Zimbra supports the ability to use an external authentication source, but we don't support the external authentication servers setup and configuration.
Please see the following for more details:
- LDAP_Authentication
- LDAP
- King0770-Notes#External_Authentication_with_LDAP
- http://www.zimbra.com/docs/ne/latest/administration_guide/5_Zimbra_LDAP.5.1.html
You can also use the forums to see if others have worked out some good instructions when working with your particular external authentication server.
Another possibility is the use of Preauth, see:
SSO with Sun IAM - Identity And Access Manager
There is no Access Manager Policy Agent for Jetty Application Server [Oct 21, 2008]. We suggest the following.
- Build a webpage that is protected by Sun Java Access Manager. Presumably this would be an apache tomcat served page so that SJAM would be able to manage it with its existing policy agent for apache tomcat. This page would interact with SJAM to get access checks and then use the standard Zimbra pre-auth mechanism to pre-auth the user and bounce them into the zimbra app.
- In Zimbra, you would configure (on the domain) zimbraWebClientLoginURL (and zimbraWebClientLogoutURL), to the address of that apache tomcat served webpage from step 1 above. If someone attempts to login to zimbra directly, they would be redirected to the page which is controlled by SJAM. And when logging out, they would be again redirected to the webpage that is controlled by SJAM. There would be no way to log into or out of Zimbra without the approval and control of SJAM.
For details on the preauth mechanism, see:
JA-SIG Central Authentication Service Or CAS
CAS is an authentication system originally created by Yale University to provide a trusted way for an application to authenticate a user. CAS became a JA-SIG project in December 2004.
- CASifying Zimbra How-To
- Cassifying_Zimbra_5
- For ZCS 4 & 5 see also:
- CASifying_Zimbra_6.0
- For ZCS 6 see also
- Cassifying_Zimbra_5
Bugs/RFE's:
- "zimbra.web.xml.in adjusted to handle customizations (CAS)"
- "Admin console and single sign-on integration"
- "JA-SIG Central Authentication Service Or CAS Support - To determine interest"
Adding the following as reported by a customer, with their permission.
When a Zimbra calendar has a Public share added, the url is something like "https://my.server.edu/home/user@domain.edu/Calendar.html". Once the Zimbra app determines that this calendar has a Public share, it gets the calendar data through the /home directory path, but it requests the images and css data from the /zimbra/img and /zimbra/css directories. We previously did not let unauthenticated users access /zimbra/img or /zimbra/css. We added a modification to our casclient.jar code to allow requests from non-authenticated users to return data from these two directories, since these two directories do not contain any user or private system data.
And a more detailed explanation:
In the CASifying Zimbra setup, this is the default filter mapping they have you set up in the /opt/zimbra/jetty/etc/zimbra.web.xml.in file: <filter-mapping> <filter-name>CAS Filter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> This default url pattern will trigger Zimbra to run any request made to "https://my.server.edu/zimbra/..." through the casclient.jar filter. Note, one thought my co-worker and I had was to modify this section of the zimbra.web.xml.in file to exclude /img and /css, which should accomplish the same thing we did by modifying the casclient.jar file. Unfortunately, in our web-searching for Jetty Servlet 2.4 information about what you can do with the url-pattern, it did not appear that you could exclude or negate any url-patterns. If you or some other individual had any desire, you might have more luck in finding a way to accomplish this. We thought it was better to modify the casclient.jar file anyway, as that carries over through upgrades, but changes to the zimbra.web.xml.in file have to be reapplied after every upgrade. ** Any custom filtering you wish to do for your location would be made in the casclient.jar archive. After unjarring casclient.jar, the file you will modify is: casclient/src/edu/yale/its/tp/cas/client/filter/CASFilter.java Certain requests could be filtered out before being sent on to the CAS server to reduce traffic and cpu usage. Some examples would be requests for the login or logout pages, as the user is on their way to authenticate or de-authenticate, so checking these requests would usually be unnecessary. This is also the place where we added code that excluded the /zimbra/img and /zimbra/css directories. Your code would look something like: String uri = ((HttpServletRequest)request).getRequestURI(); if(uri.startsWith("/zimbra/img") || uri.startsWith("/zimbra/css")) { fc.doFilter(request, response); return; }
Support for SAML Shibboleth
Please see the following RFE:
- "support for SAML/Shibboleth"
References:
- http://shibboleth.internet2.edu/Shibboleth-SAML-FAQ.html
- http://code.google.com/apis/apps/sso/saml_reference_implementation.html
Support for SSO SPNEGO - ZWC, ZCO Outlook, And AD
Commonly Asked Questions That Need Answers
- Q. If a user is logged onto a domain computer, is there a way of configuring Connector for Outlook to use pass through authentication rather than storing the password or prompting for a password?
- A. Yes.
- To modify existing ZCO install, ensure that the Store Password HKEY is diabled
- HKEY_LOCAL_MACHINE\SOFTWARE\Zimbra\StorePassword = 0
- The ZCS server must also be setup for this, see the documentation below.
- I've also made an RFE to include more crossed references in our documentation about SSO and ZCO in the admin guide.
- RFE "Include ZCO references or setup steps in Admin guide for SPNEGO / SSO"
- To modify existing ZCO install, ensure that the Store Password HKEY is diabled
- A. Yes.
- Q. If a user is logged into a domained computer and starts Outlook for the first time, can Connector for Outlook pull the email address for this user from Active Directory rather than prompting for it?
- A. I've filed this RFE
- RFE "ZCO msi to allow auto-population of email field during setup for user"
- A. I've filed this RFE
- Q. How to configure location of ZDB file to be in the roaming profile?
- A. Please see the following references for ZDB files and options.
- http://www.zimbra.com/docs/ne/latest/zcs_connector_for_outlook_guide/wwhelp/wwhimpl/js/html/wwhelp.htm#href=ZCO_Admin_Guide_7_0.ZDB_Configuration_Options.html
- http://www.zimbra.com/docs/ne/latest/zcs_connector_for_user_guide/wwhelp/wwhimpl/js/html/wwhelp.htm#href=ZCO_User_Instructions_7_0.Configuring_Advanced_ZCO_Settings.html
- A. I've also made the following RFE
- RFE "ZCO msi customization to include ZDB location path"
- A. Please see the following references for ZDB files and options.
- Q. When a user first starts Outlook, is there a way of telling Outlook to use Connector for Outlook as the default?
- A. Possible answer, depending on the exact nature of the question.
- RFE/BUG "When setting up a new profile, can we enable the "prompt for profile""
- http://bugzilla.zimbra.com/show_bug.cgi?id=9608
- After creating the zimbra profile, the behaviour is:
- 1. if this new zimbra profile is the only profile make it the default.
- 2. if this new profile is not the only profile, make it the default and enable the prompt.
- RFE "First Run of Outlook for user to launch ZCO install & setup"
- RFE/BUG "When setting up a new profile, can we enable the "prompt for profile""
- A. Possible answer, depending on the exact nature of the question.
Existing References And Documentation
See the following [As of Apr 3, 2012]
- "ZCS Administrator Guide 7.1 (Updated 7.1.4) Network Edition"
- "Appendix B Configuring SPNEGO Single Sign-On for ZCS"
- http://www.zimbra.com/docs/ne/latest/administration_guide/wwhelp/wwhimpl/js/html/wwhelp.htm#href=ZCS_Admin_Guide_7_NE.Appendix_B_Configuring_SPNEGO_Single_Sign-On_for_ZCS.html
- "VMware Zimbra Collaboration Server 7.1 Zimbra Connector for Microsoft Outlook Administrator's Guide"
- "Chapter 2 Pre-Configuring and Customizing the Installer > Setting Up the Single Sign-On Option"
- http://www.zimbra.com/docs/ne/latest/zcs_connector_for_outlook_guide/wwhelp/wwhimpl/js/html/wwhelp.htm#href=ZCO_Admin_Guide_7_0.Setting_Up_the_Single_Sign-On_Option.html
- "Setting Up the Single Sign-On Option
- Note: SPNEGO must be configured on the ZCS server to use this option. This option does not apply to the Zimbra Appliance.
- The single sign-on option works with a specific server. The server name used in the ZCO profile must match that in the SPNEGO configuration. Make sure that the server name is incorporated into the .msi file prior to installation. To set up the single sign-on option in the .msi customization script:
- Set the server name to be the server name configured for SPNEGO, enter
- -sn <server.example.com>
- Set the password rule, enter -pw 0 , Example :
- cscript ZmCustomizeMsi.js ZimbraOlkConnector.msi -sn server.example.com -pw 0
- For more information, see Appendix B, Configuring SPNEGO Single Sign-On for ZCS in the VMware Zimbra Collaboration Server Administrator’s Guide."
- "Chapter 2 Pre-Configuring and Customizing the Installer > Setting Up the Single Sign-On Option"
- To modify existing ZCO install, ensure that the Store Password HKEY is diabled
- HKEY_LOCAL_MACHINE\SOFTWARE\Zimbra\StorePassword = 0
- And on a ZCS server you'll find the following reference:
- /opt/zcs/docs/spnego.txt
Relevant Background Bugs/ RFE's
- "Outlook Connector Single Sign On"
- http://bugzilla.zimbra.com/show_bug.cgi?id=23629
- Keyword - 7_1_1
- depended up on bug 6062
Comment #25 From David Pitt 2011-05-18 01:54:01 Approach adopted in current solution: If you're signed onto a domain with a Windows username that matches the Zimbra name used in the Outlook profile, then ZCO will attempt to use SSO, falling back to a conventional signon if SSO fails. This holds both for existing ZCO profiles and for new ones (so there's currently no concept of a SSO-specific profile). In this respect ZCO largely mirrors the SSO behaviour of the web client, always trying to use SSO first if it's available. One key difference from the web client is that a ZCO user can create a non-SSO profile for a different email account on the same server (whereas if you point the web client at an SSO-configured server then you are not given the opportunity to specify a username). If the target server hasn't been set up with a SPNEGO redirect then SSO will quickly fail (before any attempt to authenticate against the server) & fall back to a normal signon. (So the impact on servers which aren't set up for SSO is minimal.) There's no new UI content at this stage for SSO. When creating a new profile for an SSO target account the password can simply be left empty. For correct operation ZCO must be configured with StorePassword=0 in the Zimbra registry settings. (This can be set within the MSI using ZmCustomizeMsi.js prior to installation.) ------- Comment #31 From David Pitt 2011-05-20 01:51:39 One extra bit of clarification on Comment #25:- as with the web client, the server name specified in the profile must match that used in the SPNEGO SPN (in the Windows domain controller setup) for SSO to be used. (See ZimbraServer/docs/spnego.txt for notes on configuring SPNEGO.) So if, for example, the URL to be used with the web client in order to use SSO is z32.puneqa.lab/zimbra/ then the ZCO profile will only use SSO if the server name is set to z32.puneqa.lab ------- Comment #32 From Nidhi Vyas 2011-05-20 02:23:05 Verified on ZimbraConnectorOLK_7.1.1.6321_x86/ 7.1.1_GA_3183.RHEL4_64_20110516213106 Signed onto a domain with a Windows username that matches the Zimbra name used in the Outlook profile then no need to specify the password while creating profile. Store password was set to 0. Tried for both exsiting and new profile. The target server had SPNEGO redirect enabled. Marking this as verified.
- "Single Signon and Kerberos support for Web UI (SPNEGO)"
- "SSO/SPNEGO + Proxy Support"
- http://bugzilla.zimbra.com/show_bug.cgi?id=64214
- "works" - QA comment wasn't specific against what version of zcs though.
- http://bugzilla.zimbra.com/show_bug.cgi?id=64214
Ajcody MTA Postfix Topics
Postfix - MTA
Actual MTA & Postfix Topics Homepage
Please see Ajcody-MTA-Postfix-Topics
Missing main.cf Error
Moved to Missing_main.cf_Error_-_MTA
MTA Mail Flow - Birds-eye Overview
Moved to Postfix-Amavisd_Mail_Flow_-_Birds-eye_Overview_-_MTA
Understanding /var/log/zimbra.log And Postfix Log Events
Moved to: Understanding_zimbra.log_And_Postfix_Log_Events_-_MTA
Postfix Queue ID vs. message-id
Moved to: Postfix_Queue_ID_vs._message-id_-_MTA
Authentication Log Events
Moved to Understanding_And_Troubleshooting_Authentication_Log_Events
IMAP And Authenticated SMTP [SSL] Example
IMAP Test Via Telnet And Logging Events Of It - Proxy Included
IMAP Login Via Openssl - LOGIN TLS - Proxy Included
Network Tracing Between A Remote Host And A ZCS MTA
Moved to Network_Tracing_Between_A_Remote_Host_And_A_ZCS_MTA
Finding Messages - zmmsgtrace
See the following for details [for 7.1.1+]:
- zmmsgtrace replacement
Documentation at CLI_zmmsgtrace . Note, if you get command not found as the zimbra user, try /opt/zimbra/libexec/zmmsgtrace instead.
How To Increase SMTP Debug Logging - MTA
Moved to How_To_Increase_SMTP_Debug_Logging_-_MTA
Simple Troubleshooting For SMTP Via Telnet, Openssl
Moved to Simple_Troubleshooting_For_SMTP_Via_Telnet_And_Openssl
First - Understanding Your Authentication Requirements In ZCS
Second - Encoding Username And Passwords For AUTH Sequence
For ESMTP Auth is LOGIN - Example
Moved to Simple_Troubleshooting_For_SMTP_Via_Telnet_And_Openssl#For_ESMTP_Auth_is_LOGIN_-_Example
For ESMTP Auth is Plain - Example
Moved to Simple_Troubleshooting_For_SMTP_Via_Telnet_And_Openssl#For_ESMTP_Auth_is_Plain_-_Example
For TLS/SSL - Example
Moved to Simple_Troubleshooting_For_SMTP_Via_Telnet_And_Openssl#For_TLS.2FSSL_-_Example
Testing Against Port 465
Moved to Simple_Troubleshooting_For_SMTP_Via_Telnet_And_Openssl#Testing_Against_Port_465
To Confirm An Auth User Can't Send With Another FROM Address
Adding A New MTA Server
Basic instructions can be found here:
- http://www.zimbra.com/docs/ne/latest/multi_server_install/toc.html
- See "Installing Zimbra MTA on a Server"
Additional instructions needed beyond the above will follow as I hear about them.
Load Balancing For SMTP - Out Bound Mail
Currently, 5.x code, you have the following options:
- Configure zimbraMtaRelayHost and zimbraSmtpHostname zimbraSmtpHostname Details to:
- An external load balancing device that will then split the traffic behind it
- Setup a round-robin A record situation in your DNS for the external mta's you'll be using.
In, GNR/6.x, you are able to add multiple targets to the variables and we'll have some degree of "balancing" between them.
- "allow list for zimbraSmtpHostname"
- "make zimbraSmtpHostname fault tolerant"
User Alias Mapping And Mail Transport with Postfix & LDAP
See User_Alias_Mapping_and_Mail_Transport_with_Postfix_&_LDAP
Multiple LDAP Servers?
Completed RFE:
- "mta should be able to take a list of LDAP servers to take advantage of replicas."
- http://bugzilla.zimbra.com/show_bug.cgi?id=9353
- zmmtainit to allow for multiple command line options that will set the URL. Grab the contents of the ldap_url localconfig variable.
- http://bugzilla.zimbra.com/show_bug.cgi?id=9353
From :
server_host (default: localhost) The name of the host running the LDAP server, e.g. server_host = ldap.example.com Depending on the LDAP client library you're using, it should be possible to specify multiple servers here, with the library trying them in order should the first one fail. It should also be possible to give each server in the list a different port (overriding server_port below), by naming them like server_host = ldap.example.com:1444 With OpenLDAP, a (list of) LDAP URLs can be used to specify both the hostname(s) and the port(s): server_host = ldap://ldap.example.com:1444 ldap://ldap2.example.com:1444 All LDAP URLs accepted by the OpenLDAP library are supported, including connections over UNIX domain sockets, and LDAP SSL (the last one provided that OpenLDAP was compiled with support for SSL): server_host = ldapi://%2Fsome%2Fpath ldaps://ldap.example.com:636 **my note** This thread - http://archives.neohapsis.com/archives/postfix/2004-09/1763.html give me the impression they made a mistake in modifying the help file on this and they dropped the use/need of the command: server_host = ldap://ldap.example.com:1444, ldap://ldap2.example.com:1444
Just a small note on where var shows up:
[root@mail3 conf]# pwd /opt/zimbra/conf [root@mail3 conf]# grep server_host * amavisd.conf.in:$myhostname = '@@zimbra_server_hostname@@'; # must be a fully-qualified domain name! ldap-scm.cf:server_host = ldap://mail3.zimbra.DOMAIN.com:389 ldap-transport.cf:server_host = ldap://mail3.zimbra.DOMAIN.com:389 ldap-vad.cf:server_host = ldap://mail3.zimbra.DOMAIN.com:389 ldap-vam.cf:server_host = ldap://mail3.zimbra.DOMAIN.com:389 ldap-vmd.cf:server_host = ldap://mail3.zimbra.DOMAIN.com:389 ldap-vmm.cf:server_host = ldap://mail3.zimbra.DOMAIN.com:389 localconfig.xml: <key name="zimbra_server_hostname"> zmmta.cf: LOCAL zimbra_server_hostname zmmta.cf: POSTCONF myhostname LOCAL zimbra_server_hostname
References:
Traditional Aliases Use - /etc/aliases Type Lookups
Moved to Traditional_Aliases_Use_-_/etc/aliases_Type_Lookups
Allowing Accounts To Change The From Address
Please see:
Related BUG/RFE's
- Identities: Auto verify user settable from address [marked as dup of 29974]
- persona/external account from field address verification
- ZCO Support for zimbraAllowAnyFromAddress
Creating A Domain Alias
Please see ManagingDomains#Creating_a_Domain_Alias
Relay Domain Forwarding
Please see ManagingDomains#Relaying.2FDomain_Forwarding
Domain Catchall
Please see ManagingDomains#Domain_Catchall
Rewriting From Address For Outbound Email
Please see ManagingDomains#Domain_Masquerading
Rewrite Recipient Address For Incoming Email
There is a way to rewrite the incoming mail, but it's not a standard Zimbra feature. You can implement it as a configuration change in Postfix. Here's what you do:
- Create a file in /opt/zimbra/conf named 'postfix_recipientmap'.
- The format is a single line that reads something like: @alias.domain.com @domain.com
- Run 'postmap postfix_recipientmap' in the conf directory.
- Run "postconf -e recipient_canonical_maps=hash:/opt/zimbra/conf/postfix_recipientmap".
- Run 'postfix reload'.
This will cause postfix to map any incoming mail with a recipient of '@alias.domain.com' to '@domain.com'. You will need to re-apply this postconf change after upgrades, though the postfix_recipientmap file should survive.
Automatic BCC
Option 1 - Via Postfix Customization
From the postfix website:
- always_bcc = address
- Deliver a copy of all mail to the specified address. In Postfix versions before 2.1, this feature is implemented by smtpd(8), qmqpd(8), or pickup(8).
- sender_bcc_maps = type:table
- Search the specified "type:table" lookup table with the envelope sender address for an automatic BCC address. This feature is available in Postfix 2.1 and later.
- recipient_bcc_maps = type:table
- Search the specified "type:table" lookup table with the envelope recipient address for an automatic BCC address. This feature is available in Postfix 2.1 and later.
- Note: automatic BCC recipients are produced only for new mail. To avoid mailer loops, automatic BCC recipients are not generated for mail that Postfix forwards internally, nor for mail that Postfix generates itself.
Please see the following:
- A very nice forum post on the subject from our very own mmorse
- Postfix workaround
- "User defined auto bcc"
- "Next rev of (mail) identities preferences management (server side)"
Option 2 - Via ZCS Legal Intercept
Generally used for Managing Legal Requests for Information
Description:
- The ZCS legal intercept feature is used to obtain copies of email messages that are sent, received, or saved as drafts from targeted accounts and send these message to a designated “shadow” email address. Legal Intercept can be configured to send the complete content of the message or to send only the header information. When a targeted account sends, receives, or saves a draft message, an intercept message is automatically created to forward copies of the messages as attachments to the specified email address.
Please see:
- http://www.zimbra.com/docs/ne/latest/administration_guide/managing_other_zcs_features.8.1.html
- http://wiki.zimbra.com/index.php?title=Legal_Intercept
- http://bugzilla.zimbra.com/show_bug.cgi?id=17539
Option 3 - Zimbra's Archiving And Discovery
See Ajcody-Notes-Archive-Discovery concerning A&D setup and options.
Limiting Or Increasing Number Of Recipents / Messages
Mailing Lists - Distribution Lists
Policy Daemon
If you want to restrict messages per hour, you can look into Policy Daemon:
- http://wiki.zimbra.com/wiki/Postfix_Policyd
- http://wiki.zimbra.com/wiki/How-to_for_cbpolicyd
- http://www.policyd.org/features.html
Beta release in ZCS 7 , see:
- "make support for postfix-policyd easier"
Postfix
Also, there are some default postfix parameters set to control sending a message to x amount recipients. The parameters you will need to look at are smtpd_recipient_limit & smtpd_recipient_overshoot_limit, these have a default value of 1000.
Postfix defines these parameters as:
- smtpd_recipient_limit: The maximum number of recipients that the Postfix SMTP server accepts per message delivery request.
- smtpd_recipient_overshoot_limit: The number of recipients that a remote SMTP client can send in excess of the limit specified with $smtpd_recipient_limit, before the Postfix SMTP server increments the per-session error count for each excess recipient.
From the command line you can change the default values.
su - zimbra postconf -e smtpd_recipient_limit=<new value> postconf -e smtpd_recipient_overshoot_limit=<new value> postfix reload
Bugs RFE's For Customers To Get Behind
I'm wondering if policyd gives one the control everyone is looking for? I've not used it myself.
Policyd References:
- http://www.policyd.org/tiki-index.php?page=Documentation
- http://www.policyd.org/tiki-index.php?page=Quotas&structure=Documentation
- http://www.policyd.org/tiki-index.php?page=Accounting&structure=Documentation
- http://www.policyd.org/tiki-index.php?page=Policies%20%26%20Groups&structure=Documentation
- http://wiki.zimbra.com/index.php?title=Postfix_Policyd
There's other additions [add-on's] one can get for policyd.
We have this RFE in regards to policyd support:
- "make support for postfix-policyd easier"
- http://bugzilla.zimbra.com/show_bug.cgi?id=8791
- Target Milestone currently for Helix release [ http://pm.zimbra.com ]
- http://bugzilla.zimbra.com/show_bug.cgi?id=8791
Other related rfe/bugs, specially to push variables into admin web console:
- "rate limit amount of mail sent via web client"
- http://bugzilla.zimbra.com/show_bug.cgi?id=22300
- *Target Milestone currently for Helix release
- http://bugzilla.zimbra.com/show_bug.cgi?id=22300
- "mta "advanced" tab"
- http://bugzilla.zimbra.com/show_bug.cgi?id=14645
- Target Milestone currently for Helix release
- http://bugzilla.zimbra.com/show_bug.cgi?id=14645
- "Option to IP Blocking through UI"
- http://bugzilla.zimbra.com/show_bug.cgi?id=19240
- Target Milestone currently for Helix release
- http://bugzilla.zimbra.com/show_bug.cgi?id=19240
- "Mail policies and access control for sending to distribution lists"
- http://bugzilla.zimbra.com/show_bug.cgi?id=9620
- Target Milestone currently for GunsNRoses
- http://bugzilla.zimbra.com/show_bug.cgi?id=9620
Controlling SMTPD Client Connections
Mmorse did a good write up on these variables in the forum:
Postfix Resources At Their Site (All Clients/Connections):
- Measures against clients that make too many connections
- anvil - Postfix session count and request rate control
- anvil_rate_time_unit - The time unit over which client connection rates and other rates are calculated.
- smtpd_client_connection_count_limit - How many simultaneous connections any client is allowed to make to this service.
- smtpd_client_message_rate_limit - The maximal number of message delivery requests that any client is allowed to make to this service per time unit, regardless of whether or not Postfix actually accepts those messages.
- smtpd_client_recipient_rate_limit - The maximal number of recipient addresses that any client is allowed to send to this service per time unit, regardless of whether or not Postfix actually accepts those recipients.
- smtpd_client_connection_rate_limit - The maximal number of connection attempts any client is allowed to make to this service per time unit.
Postfix Resources At Their Site (Exceptions To Clients/Connections Or Single Source):
Restrictions
Besides using external mailing list software, Mailman or Sympa, here's some other topical items in regards to restrictions.
Some user contributed articles:
- RestrictPostfixRecipients
- Restrict_sending_to_certain_domains
- Restrict_users_to_certain_domain
- Forum Post: GUIDE: Postifx: HOW TO: Multiple access lists for protected Distribution-lists
Some Postfix references:
- http://www.postfix.org/RESTRICTION_CLASS_README.html#internal
- http://www.postfix.org/SMTPD_POLICY_README.html
Some RFE's related to mta based restrictions [targets are based upon today - July 21, 2010]:
- "Dynamic distribution lists - Internal Directory"
- "per-domain send restriction" - Not Committed
- http://bugzilla.zimbra.com/show_bug.cgi?id=5595
- These are marked as dup's of the above:
- "disable outbound e-mail for one user"
- "Add an facility to detemine internal relay users in admin"
- These are marked as dup's of the above:
- http://bugzilla.zimbra.com/show_bug.cgi?id=5595
- "policy for who can send to a distribution lists" - Helix
- http://bugzilla.zimbra.com/show_bug.cgi?id=9620
- RFE 9620 is also a blocker for the following RFE:
- "milter to check if sender can send to a distribution list"
- These are marked as dup's of the above:
- "Ability to Specify Mail Policy"
- "domain level filters rules"
- "Distribution List Restrictions"
- "Feature request - Mail Policies"
- "limit "send from" to certain domains"
- "'Internal email only' options in admin control panel"
- "Access control for free busy and resources (ie permission to invite)"
- "RFE: Admin GUI: Restrict the use of Distribution List among users."
- RFE 9620 is also a blocker for the following RFE:
- http://bugzilla.zimbra.com/show_bug.cgi?id=9620
- "Implement smtpd_sender_restrictions"
- "How to restrict a user to only send via zwc"
- "enable configuration of "smtpd_sender_restriction""
Spam Control And Related Issues
High Over View Steps Of What To Do
- Step 1: Confirm your not an open relay and double check your postfix $mynetworks variable.
- Step 2: Stop or put on-hold mail queue.
- Put all messages into HOLD queue:
- Get a report of your current mailq [can be useful if you clean out the queue later but need to identify what external mail hosts are now denying you and who you'll need to contact about getting removed from their denial list]
- Example: /opt/zimbra/postfix/sbin/mailq > /tmp/zimbra_mailq_report.txt
- /opt/zimbra/postfix/sbin/postsuper -h ALL
- Get a report of your current mailq [can be useful if you clean out the queue later but need to identify what external mail hosts are now denying you and who you'll need to contact about getting removed from their denial list]
- Or put all messages match compromised account into HOLD queue:
- /opt/zimbra/postfix/sbin/mailq | grep user_compromised@domain | awk '{ print $1 }' | tr -d '!*' | /opt/zimbra/postfix/sbin/postsuper -h -
- Note, this is an example - you might with the grep grab more than the compromised account with the match.
- /opt/zimbra/postfix/sbin/mailq | grep user_compromised@domain | awk '{ print $1 }' | tr -d '!*' | /opt/zimbra/postfix/sbin/postsuper -h -
- See whole section - Managing The Postfix Queue
- Put all messages into HOLD queue:
- Step 3: Check your mail log [On ZCS servers running MTA services] - /var/log/zimbra.log
- Understanding the zimbra.log file and Postfix log events. , see subsection about queue ID and message ID also.
- Who's My Spammer?
- Step 4: Identify compromised account authenticating SMTP AUTH connection or block ip address where emails are coming from at firewall.
- Who's My Spammer?
- Continue to monitor compromised account and block ip addresses:
- tail -f /var/log/zimbra.log | grep username | grep sasl
- Jun 8 18:14:10 mail postfix/smtpd[15794]: 004358EEB16: client=unknown[XXXX.236.197.216], sasl_method=LOGIN, sasl_username=username@domain
- tail -f /var/log/zimbra.log | grep username | grep sasl
- Step 5: Disable the exploited email account, expire auth session, etc.
- Resetting Or Expiring User Auth
- Note - Restarting the mta services will be important once you reset the password/s or lock the account. It's required to ensure the active connections will be closed and any existing auth tokens no longer are valid. See:
- Force currently active SMTP authenticated sessions to be renegotiated when locking an account
- Step 6: Move the mail queue or delete the spam email
- See whole section - Managing The Postfix Queue
- Step 7: Release Mail queue
Who's My Spammer?
Getting Some Initial Summary Data
zmdialyreport
First, some notable bug/RFE's in regards to the zmdailyreport:
- RFE - add explanations to Daily mail report / pflogsumm.pl output
- Daily mail report shows incorrect output because pflogsumm.pl doubles the result
- Descriptions of mta_counts numbers vs daily reports and other msg stats
You can first get some summary data by doing the following:
[zimbra@zcs806 ~]$ /opt/zimbra/libexec/zmdailyreport Grand Totals ------------ messages 7 received 11 delivered 0 forwarded 0 deferred 0 bounced 3 rejected (21%) 0 reject warnings 0 held 0 discarded (0%) 2780 bytes received 10914 bytes delivered 2 senders 1 sending hosts/domains 1 recipients 1 recipient hosts/domains Per-Hour Traffic Summary time received delivered deferred bounced rejected -------------------------------------------------------------------- 0000-0100 0 0 0 0 0 0100-0200 1 3 0 0 0 0200-0300 0 0 0 0 0 0300-0400 0 0 0 0 0 0400-0500 0 0 0 0 0 0500-0600 0 0 0 0 0 0600-0700 0 0 0 0 0 0700-0800 1 0 0 0 2 0800-0900 1 0 0 0 0 0900-1000 0 0 0 0 1 1000-1100 0 0 0 0 0 1100-1200 0 0 0 0 0 1200-1300 4 8 0 0 0 1300-1400 0 0 0 0 0 1400-1500 0 0 0 0 0 1500-1600 0 0 0 0 0 1600-1700 0 0 0 0 0 1700-1800 0 0 0 0 0 1800-1900 0 0 0 0 0 1900-2000 0 0 0 0 0 2000-2100 0 0 0 0 0 2100-2200 0 0 0 0 0 2200-2300 0 0 0 0 0 2300-2400 0 0 0 0 0 Host/Domain Summary: Message Delivery (top 50) sent cnt bytes defers avg dly max dly host/domain -------- ------- ------- ------- ------- ----------- 11 10914 0 7.4 s 24.0 s zcs806.DOMAIN.com Host/Domain Summary: Messages Received (top 50) msg cnt bytes host/domain -------- ------- ----------- 5 2780 zcs806.DOMAIN.com top 50 Senders by message count ------------------------------- 4 zimbra@zcs806.DOMAIN.com 1 admin@zcs806.DOMAIN.com top 50 Recipients by message count ---------------------------------- 11 admin@zcs806.DOMAIN.com top 50 Senders by message size ------------------------------ 1974 zimbra@zcs806.DOMAIN.com 806 admin@zcs806.DOMAIN.com top 50 Recipients by message size --------------------------------- 10914 admin@zcs806.DOMAIN.com message deferral detail: none message bounce detail (by relay): none message reject detail --------------------- MAIL 5.3.4 Message size exceeds fixed limit (total: 3) 3 domain-ext.com message reject warning detail: none message hold detail: none message discard detail: none smtp delivery failures: none Warnings -------- sendmail (total: 3) 1 or the command is run from a set-uid root process 1 the Postfix sendmail command has set-uid root file permissions 1 the Postfix sendmail command must be installed without set-uid ... smtpd (total: 1) 1 7A735345A: queue file size limit exceeded Fatal Errors: none Panics: none Master daemon messages: none
client_usage_report.py
This will give some stats on your mail activity. Note, there are some issue with this script double reporting mail counts etc, but it's useful to identify the top 50 for activity.
[zimbra@zcs806 ~]$ /opt/zimbra/libexec/client_usage_report.py Reading /opt/zimbra/log/access_log.2014-04-17 .. Reading /opt/zimbra/log/access_log.2014-04-18 .. Reading /opt/zimbra/log/access_log.2014-04-19 .. Reading /opt/zimbra/log/access_log.2014-04-20 .. Reading /opt/zimbra/log/access_log.2014-04-21 .. Reading /opt/zimbra/log/access_log.2014-04-22 .. Reading /opt/zimbra/log/access_log.2014-04-23 .. Writing /opt/zimbra/zmstat/client_usage_report_2014-04-24.csv ..
Then review the file it will create , it will give : "user_agent","client_IP","req_count"
[zimbra@zcs806 ~]$ cat /opt/zimbra/zmstat/client_usage_report_2014-04-24.csv "user_agent","client_IP","req_count" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:28.0) Gecko/20100101 Firefox/28.0","192.168.1.166","14" "Mozilla/5.0 (Windows NT 6.2; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0","192.168.1.166","93" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0","192.168.1.174","6" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:28.0) Gecko/20100101 Firefox/28.0","192.168.1.166","71"
qshape
You can also look at the results of [qshape] - the default is the active queue. For more on qshape, see [Postfix Qshape Readme] .
qshape deferred T 5 10 20 40 80 160 320 640 1280 1280+ TOTAL 12 0 0 0 0 0 0 0 0 0 12 gmail.com 9 0 0 0 0 0 0 0 0 0 9 yahoo.com 3 0 0 0 0 0 0 0 0 0 3
3rd Party Log Reports - postfix-logwatch and amavis-logwatch
Created RFE for us to include these in ZCS:
- Include postfix-logwatch_and_amavis-logwatch
You can download them from http://logreporters.sourceforge.net/ . It's a fairly simply install, download and then extract - cd into extracted directory and as root type :
make install-standalone
They will install to /usr/local/bin/amavis-logwatch & postfix-logwatch . The config files are in /usr/local/etc/amavis-logwatch.conf & postfix-logwatch.conf . Here's an example of the output.
/usr/local/bin/amavis-logwatch output example:
[root@zcs806 amavis-logwatch-1.51.02]# /usr/local/bin/amavis-logwatch /var/log/zimbra.log ****** Summary ************************************************************************************* 4 Total messages scanned ------------------ 100.00% 1.926K Total bytes scanned 1,972 ======== ================================================== 4 Passed ---------------------------------- 100.00% 4 Clean passed 100.00% ======== ================================================== 4 Ham ------------------------------------- 100.00% 4 Clean passed 100.00% ======== ================================================== ================================================================================== Spam Score Percentiles 0% 50% 90% 95% 98% 100% ---------------------------------------------------------------------------------- Score Ham (4) -1.900 -1.900 -1.900 -1.900 -1.900 -1.900 ================================================================================== ====================================================================================================== Spam Score Frequency <= -10 <= -5 <= 0 <= 5 <= 10 <= 20 <= 30 > 30 ------------------------------------------------------------------------------------------------------ Hits (4) 0 0 4 0 0 0 0 0 Percent of Hits 0.00% 0.00% 100.00% 0.00% 0.00% 0.00% 0.00% 0.00% ======================================================================================================
/usr/local/bin/postfix-logwatch output example:
[root@zcs806 amavis-logwatch-1.51.02]# /usr/local/bin/postfix-logwatch /var/log/zimbra.log ****** Summary ************************************************************************************* 1 *Warning: Queue file size limit exceeded 6.512K Bytes accepted 6,668 1.928K Bytes sent via SMTP 1,974 4.584K Bytes sent via LMTP 4,694 ======== ================================================== 10 Accepted 76.92% 3 Rejected 23.08% -------- -------------------------------------------------- 13 Total 100.00% ======== ================================================== 3 5xx Reject message size 100.00% -------- -------------------------------------------------- 3 Total 5xx Rejects 100.00% ======== ================================================== 10 Connections 10 Disconnections 8 Removed from queue 4 Sent via SMTP 4 Sent via LMTP 4 Filtered ****** Detail (10) ********************************************************************************* 3 5xx Reject message size ----------------------------------------------------------------- 3 192.168.1.166 remote.domain.com 3 *unavailable 3 *unavailable 4 Sent via SMTP --------------------------------------------------------------------------- 4 zcs806.DOMAIN.com 4 Sent via LMTP --------------------------------------------------------------------------- 4 zcs806.DOMAIN.com 4 Filtered -------------------------------------------------------------------------------- 2 smtp-amavis:[127.0.0.1]:10024 2 Sender address 1 admin@zcs806.DOMAIN.com 1 admin@zcs806.DOMAIN.com 1 192.168.1.166 remote.domain.com 1 user@DOMAIN.com 1 admin@zcs806.DOMAIN.com 1 192.168.1.184 remote2.domain.com 2 smtp-amavis:[127.0.0.1]:10026 2 Sender address 1 admin@zcs806.DOMAIN.com 1 admin@zcs806.DOMAIN.com 1 192.168.1.166 remote.domain.com 1 user@DOMAIN.com 1 admin@zcs806.DOMAIN.com 1 192.168.1.184 remote2.domain.com === Delivery Delays Percentiles ============================================================ 0% 25% 50% 75% 90% 95% 98% 100% -------------------------------------------------------------------------------------------- Before qmgr 0.04 0.09 0.11 0.11 0.23 0.35 0.43 0.48 In qmgr 0.00 0.00 0.01 0.01 0.04 0.07 0.08 0.09 Conn setup 0.00 0.01 0.29 1.30 2.05 2.23 2.33 2.40 Transmission 0.10 2.81 4.85 9.60 21.00 21.00 21.00 21.00 Total 0.20 2.91 5.20 11.00 23.30 23.65 23.86 24.00 ============================================================================================
Note - First, look at the options each command has using the -h output. You might want to use --full when doing an investigation and also include a wildcard - /var/log/zimbra.lo* to take in all the log data. For example:
[zimbra@zcs806 ~]$ /usr/local/bin/postfix-logwatch --full /var/log/zimbra.lo* ****** Summary ************************************************************************************* 9 *Fatal: General fatal 1 *Warning: Queue file size limit exceeded 21 Miscellaneous warnings 710.888K Bytes accepted 727,949 193.036K Bytes sent via SMTP 197,669 520.114K Bytes sent via LMTP 532,597 ======== ================================================== 1041 Accepted 99.71% 3 Rejected 0.29% -------- -------------------------------------------------- 1044 Total 100.00% ======== ================================================== 3 5xx Reject message size 100.00% -------- -------------------------------------------------- 3 Total 5xx Rejects 100.00% ======== ================================================== 65 Connections 65 Disconnections 1041 Removed from queue 523 Sent via SMTP 517 Sent via LMTP 2 Bounced (local) 1 Bounced (remote) 9 Filtered 2 Notifications sent 4 Timeouts (inbound) 1 PIX workaround enabled ****** Detail (10) ********************************************************************************* 9 *Fatal: General fatal ----------------------------------------------------------------- 3 Queue report unavailable - mail system is down 3 Usage: sendmail [options] 2 The Postfix mail system is not running 1 Usage: send-mail [options] 21 Miscellaneous warnings ------------------------------------------------------------------ 7 or the command is run from a set-uid root process 7 the Postfix sendmail command has set-uid root file permissions 7 the Postfix sendmail command must be installed without set-uid root file permissions 3 5xx Reject message size ----------------------------------------------------------------- 3 10.X.X.166 fence.DOMAIN.com 3 *unavailable 3 *unavailable 523 Sent via SMTP --------------------------------------------------------------------------- 507 86.lab 15 zcs806.DOMAIN.com 1 domaina.com 517 Sent via LMTP --------------------------------------------------------------------------- 507 86.lab 10 zcs806.DOMAIN.com 2 Bounced (local) ------------------------------------------------------------------------- 2 5.0.0: Permanent failure: Other/Undefined status: Other undefined status 2 zcs806.DOMAIN.com 2 Zcs806.DOMAIN.com 1 subject:test 1 zimbra 1 Bounced (remote) ------------------------------------------------------------------------ 1 5.0.0: Permanent failure: Other/Undefined status: Other undefined status 1 domain.com 1 user 1 64.X.X.28 sentry.DOMAIN.com 1 505 5.0.0 Unknown recipient: RCPT TO 9 Filtered -------------------------------------------------------------------------------- 7 smtp-amavis:[127.0.0.1]:10026 7 Sender address 3 admin@zcs806.DOMAIN.com 3 admin@zcs806.DOMAIN.com 2 10.X.X.36 zcs806.DOMAIN.com 1 10.X.X.166 gatewayXX.DOMAIN.com 2 zimbra@zcs806.DOMAIN.com 2 admin@zcs806.DOMAIN.com 2 10.X.X.36 zcs806.DOMAIN.com 1 ajcody@DOMAIN.com 1 admin@zcs806.DOMAIN.com 1 10.X.X.184 edgeXX.DOMAIN.com 1 san5@zcs806.DOMAIN.com 1 b@zcs806.DOMAIN.com 1 10.X.X.36 zcs806.DOMAIN.com 2 smtp-amavis:[127.0.0.1]:10024 2 Sender address 1 admin@zcs806.DOMAIN.com 1 admin@zcs806.DOMAIN.com 1 10.X.X.166 gatewayXX.DOMAIN.com 1 ajcody@DOMAIN.com 1 admin@zcs806.DOMAIN.com 1 10.X.X.184 edgeXX.DOMAIN.com 2 Notifications sent ---------------------------------------------------------------------- 2 Non-delivery 2 sender 4 Timeouts (inbound) ---------------------------------------------------------------------- 4 After END-OF-MESSAGE 1 PIX workaround enabled ------------------------------------------------------------------ 1 disable_esmtp delay_dotcrlf 1 64.X.X.28 sentry.DOMAIN.com === Delivery Delays Percentiles ============================================================ 0% 25% 50% 75% 90% 95% 98% 100% -------------------------------------------------------------------------------------------- Before qmgr 0.01 0.03 0.06 0.14 0.27 0.34 0.48 2.60 In qmgr 0.00 0.00 0.08 117.50 193.00 216.00 231.48 246.00 Conn setup 0.00 0.00 0.00 0.00 0.02 0.04 0.22 20.00 Transmission 0.05 0.09 3.60 9.80 10.00 10.00 11.00 160.00 Total 0.07 0.13 3.80 129.00 203.00 226.00 241.64 259.00 ============================================================================================
zmaccts
One way to note accounts that are actively logging in vs. those that aren't, can help shrink the number of accounts you might want to investigate or monitor. [example below, I cut out a lot of the accounts]
account status created last logon ------------------------------------ ----------- --------------- --------------- zcstest001@zcs806.DOMAIN.com active 01/20/14 18:47 03/02/14 21:11 zcstest002@zcs806.DOMAIN.com active 01/30/14 01:48 02/19/14 00:07 admin-20140415@zcs806.DOMAIN.com active 04/15/14 14:42 never archtest-prod-20140402@zcs806.DOMAIN active 04/02/14 07:42 never account status created last logon ------------------------------------ ----------- --------------- --------------- bruce@test1.lab active 02/22/14 09:32 never test.cal@test1.lab active 04/06/14 05:35 04/06/14 05:35 test200@test1.lab active 04/12/14 00:50 never domain summary domain active closed locked maintenance total ----------------------- -------- -------- -------- ------------- -------- test1.lab 3 0 0 0 3 test2.com 2 0 0 0 2 angad.com 2 0 0 0 2 test.test 3 0 0 0 3 test.DOMAIN.com 6 0 0 0 6 zcs806.DOMAIN.com 58 0 0 0 58 zcs806.DOMAIN.com 2 0 0 0 2
By Authentication Attempts
A fast way to see who is doing a lot of authentications, which normally happens when a spammer has compromised an account with a weak password, is to do:
# cat /var/log/zimbra.log | sed -n 's/.*sasl_username=//p' | sort | uniq -c | sort -n 1 Auser@domain.com 3 Buser@domain.com 4 Cuser@domain.com 5 Duser@domain.com 36 SPAMMER@domain.com
Note - This might take a long time, if so - try pruning it down
Example:
# cat /var/log/zimbra.log | grep sasl_username > /tmp/zimbra_sasl_username.txt # cat /tmp/zimbra_sasl_username.txt | sed -n 's/.*sasl_username=//p' | sort | uniq -c | sort -n 1 Auser@domain.com 3 Buser@domain.com 4 Cuser@domain.com 5 Duser@domain.com 36 SPAMMER@domain.com
The full log event will look like this:
zimbra1 postfix/smtpd[29431]: B28914D5978: client=xxxxx.server.com[w.x.y.z], sasl_method=LOGIN, sasl_username=user zimbra1 postfix/cleanup[5522]: B28914D5978: message-id=<20090420154255.B28914D5978@zimbraserver.com> zimbra1 postfix/qmgr[20690]: B28914D5978: from=<spam@spam.com>, size=6026, nrcpt=10 (queue active) zimbra1 postfix/cleanup[3983]: 2BA56465D28: message-id=<20090420154255.B28914D5978@zimbraserver.com>
Against your older logs, you could:
# zcat /var/log/zimbra.log* | sed -n 's/.*sasl_username=//p' | sort | uniq -c | sort -n
And you can look at the specific information for the user in question with:
# grep -C2 "sasl_username=SPAMMER@domain.com" /var/log/zimbra.log
Or if searching against the older logs:
# zgrep -C2 "sasl_username=SPAMMER@domain.com" /var/log/zimbra.log*
If you want to check on a specific message ID, do:
grep 9DF7520804A /var/log/zimbra.log*
For older message logs:
zgrep 9DF7520804A /var/log/zimbra.log*
To read/view the message in the queue:
/opt/zimbra/postfix/sbin/postcat -q 9DF7520804A
One would then normally lock/change password on the one account showing the most activity. Grep'ing the /var/log/zimbra.log with the username in question will also show the ip address being used, this can be blocked with your firewall.
To be alerted of a compromised account and have it lock automatically see below. Slightly modified from this reference : http://www.zimbra.com/forums/administrators/62613-identify-compromised-accounts.html#post278732 :
#!/bin/bash # checks log file and gets a count of authentications sent per minute, per user # and if the count exceeds the maxmails value the user's account is locked. logfile="/var/log/zimbra.log" maxmails="10" mydomain="example.com" support="<postmaster-userid>@$mydomain" accounts="/tmp/active_accounts" su zimbra -c "/opt/zimbra/bin/zmaccts" | grep "@" | grep active | awk '{print $1}' > $accounts zgrep -i "auth ok" $logfile | sed 's/ / /g' | awk -F"[ :]" '{print $3":"$4,$11;}' | uniq -c | sort -n | \ while read line do count=`echo ${line} | cut -d' ' -f 1` userid=`echo ${line} | cut -d' ' -f 3` timestamp=`echo ${line} | cut -d' ' -f 2` active=`grep "$userid@$mydomain" $accounts` if [ "$count" -gt "$maxmails" ] && [ "$active" == "$userid@$mydomain" ]; then echo "Maximum email rate exceeded, $userid@$mydomain will be locked" su zimbra -c "/opt/zimbra/bin/zmprov ma $userid@$mydomain zimbraAccountStatus locked" subject="$userid account locked due to excessive connections" # Email text/message message="/tmp/emailmessage.txt" echo "$userid account has been locked as there were $count connections made at"> $message echo "$timestamp. Please have the user change their password, and check for phishing" >>$message echo "emails if possible." >>$message # send an email using /bin/mail /usr/bin/mail -s "$subject" "$support" < $message rm -f $message #update list of active accounts su zimbra -c "/opt/zimbra/bin/zmaccts" | grep "@" | grep active | awk '{print $1}' > $accounts fi done rm -f $accounts
Then run it as a cron job. The frequency will depend on the number of accounts you're managing.
* * * * * /opt/zimbra/find_spammer.sh
By Connecting IP - Useful For Blocking IP At Firewall
See also the following:
To find the originating IP address of where the emails are coming from:
grep 'connect from' /var/log/zimbra.log | sed 's/.*connect from.*\[\(.[^]]*\)\]/\1/g' | sort | uniq -c | sort -nr | head
To check your older logs [example output below]:
zgrep 'connect from' /var/log/zimbra.log* | sed 's/.*connect from.*\[\(.[^]]*\)\]/\1/g' | sort | uniq -c | sort -nr | head 36 10.137.xx.34 34 127.0.0.1
Open Relay Check
You should also confirm you aren't an open relay.
$ host -t mx DOMAIN.com DOMAIN.com mail is handled by 10 mail.DOMAIN.com. $ telnet mail.DOMAIN.com 25 Trying 184.###.##.## ... Connected to mail.DOMAIN.com. Escape character is '^]'. 220 mail.DOMAIN.com ESMTP Postfix helo support.test 250 mail.DOMAIN.com mail from:<SPAMMER@domain.com> 250 2.1.0 Ok rcpt to:<TEST@DOMAIN.COM> 554 5.7.1 <TEST@DOMAIN.COM>: Relay access denied rcpt to:<SPAMMER@domain.com> 554 5.7.1 Service unavailable; Client host [71.XXX.XX.XX] blocked using zen.spamhaus.org; http://www.spamhaus.org/query/bl?ip=71.202.XX.XX quit 221 2.0.0 Bye Connection closed by foreign host.
Telnet Test To Confirm/Show Authentication Required For SMTP/Port 25
This is an example:
esx2:~ ajcody$ telnet zcs723.EXAMPLE.com 25 Trying 10.137.27.32... Connected to zcs723.EXAMPLE.com. Escape character is '^]'. 220 zcs723.EXAMPLE.com ESMTP Postfix helo zcs723.EXAMPLE.com << I typed 250 zcs723.EXAMPLE.com mail from:ajcody@zcs723.EXAMPLE.com << I typed 250 2.1.0 Ok rcpt to:ajcody2@zcs723.EXAMPLE.com << I typed 553 5.7.1 <ajcody@zcs723.EXAMPLE.com>: Sender address rejected: not logged in
But note - if you do this from the ZCS server or a server that is within the ip range or has it's specific ip listed in the mynetworks, you will not get this authentication requirement.
[root@zcs723 ~]# telnet localhost 25 Trying ::1... telnet: connect to address ::1: Connection refused Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 220 zcs723.EXAMPLE.com ESMTP Postfix helo myworkstation 250 zcs723.EXAMPLE.com ehlo myworkstation 250-zcs723.EXAMPLE.com 250-PIPELINING 250-SIZE 10240000 250-VRFY 250-ETRN 250-STARTTLS 250-AUTH LOGIN PLAIN 250-AUTH=LOGIN PLAIN 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN mail from:<ajcody@zcs723.EXAMPLE.com> 250 2.1.0 Ok rcpt to: <ajcody2@zcs723.EXAMPLE.com> 250 2.1.5 Ok data 354 End data with <CR><LF>.<CR><LF> From: Adam <ajcody@zcs723.EXAMPLE.com> To: Adam 2 <ajcody2@zcs723.EXAMPLE.com> Subject: From Localhost - NOT Auth test . 250 2.0.0 Ok: queued as 8B19E1E78D1 quit 221 2.0.0 Bye Connection closed by foreign host.
Resources
A list of resources you'll find useful:
- Zimbra_MTA#Anti-Spam_Training_Filters
- CLI_zmtrainsa
- Improving_Anti-spam_system
- Postfix_Policyd
- IP_Address_whitelisting
- Spam_training
- Restrict by user
- Restrict by ip addresses and sender and other items:
- Postfix - Restriction Class Readme
- Note, from the readme:
- "What follows is based on the SMTP client IP address, and therefore is subject to IP spoofing."
- "What follows is based on the sender SMTP envelope address, and therefore is subject to SMTP sender spoofing."
- Note, from the readme:
- Postfix - Restriction Class Readme
Wiki articles that have been assigned to the anit-spam category:
Down to the end-user:
External Relay Test Pages
- http://www.checkor.com/
- Note - this test is in regards to the From spoofing spammers sometimes do for DL's.
- Also, for the test - make an account/DL on your system for test1@[your domain] . Otherwise you'll just error about account not existing.
RSET 250 2.0.0 Ok MAIL FROM: spam@mail59.DOMAIN.com 250 2.1.0 Ok RCPT TO: test1@mail59.DOMAIN.com Test Failed, 250 2.1.5 Ok
Blocking MAIL FROM - smtpd_sender_restrictions - Default Is Empty
External References
- External Sources
Zimbra References And Bugs & RFE's
- Zimbra Related Soures
- "policy for who can send to a distribution lists"
- https://bugzilla.zimbra.com/show_bug.cgi?id=9620
- Note - This will not stop spammers from mailing into your DL's by way of forged Mail From and guessing your DL address in the To
- https://bugzilla.zimbra.com/show_bug.cgi?id=9620
- "support smtpd_sender_login_maps for smtp auth"
- "Implement smtpd_sender_restrictions"
- "milter to check if sender can send to a distribution list"
- https://bugzilla.zimbra.com/show_bug.cgi?id=46311
- Dependent upon bug 9620
- https://bugzilla.zimbra.com/show_bug.cgi?id=46311
- Zimbra Forum Post on using smtpd_sender_restrictions options
- [http://www.zimbra.com/forums/administrators/28770-how-enforce-sasl_username-address.html How to enforce sasl_username=FROM ADDRESS"
- Another Zimbra Forum Post on using smtpd_sender_restrictions options
- "policy for who can send to a distribution lists"
Protecting DL's From Spammers - Forging Mail From
First Recommendation - As Given By Dev's From Critical Meeting Notes
- Enabled SASL/SMTP Authentication
- Implement how-to as described in :
- Permitted Senders: RestrictPostfixRecipients
- Note: You'll see on the above page a reference to the spoof hole.
- "This method can be spoofed by forging the MAIL FROM: header (so mail appears to originate from within the domain), so it isn't foolproof, but it works for basic needs."
- Note: You'll also modify the instructions as above with addition details provided below.
- Note: You'll see on the above page a reference to the spoof hole.
- Permitted Senders: RestrictPostfixRecipients
- Force authentication for local-domain senders:
- modify the main.cf to have the following:
- smtpd_sender_restrictions = check_sender_access hash:/path/to/file
- Then for the /path/to/file that you used in the mail.cf for smtpd_sender_restrictions, you'll have a line like:
- example.com permit_sasl_authenticated, reject
- modify the main.cf to have the following:
Second Recommendation - Unpredictable DL name or Non-routing Domain
Do not use predictable DL names. Instead of using everyone@company.com , use something like everyone-[random-string]@company.com .
Another option is to use a non-routing domain - company.local - and setup your DL's there. You'll want to configure your main domain to be able to query the GAL of this domain.
To see the existing setting:
zmprov gd [domainname] zimbraGalLdapSearchBase
To change the variable for the domain:
zmprov md [domainname] zimbraGalInternalSearchBase ROOT
Third Recommendation - Using smtpd_sender_restrictions
- Work In Progress. I'm testing this now. Please don't attempt until this line is removed.
Update: See the following:
- "Enforcing a match between the FROM Address and sasl_username in Zimbra Collaboration Server (2011281)"
This should work if your "clients" are using ZWC, ZCO, or ActiveSync mobile devices. If you are using IMAP/POP + STMP thick clients, you'll most likely have to enable smtp authentication [sasl] and use the reject_authenticated_sender_login_mismatch variable instead.
postconf -e smtpd_sender_restrictions=reject_sender_login_mismatch postfix reload
This option is described as:
- reject_sender_login_mismatch
- Reject the request when $smtpd_sender_login_maps specifies an owner for the MAIL FROM address, but the client is not (SASL) logged in as that MAIL FROM address owner; or when the client is (SASL) logged in, but the client login name doesn't own the MAIL FROM address according to $smtpd_sender_login_maps. Man page
Some Other SMTP Sending Restrictions
Blocking Incoming From Domain And By User
See the following:
check_client_access
The smtpd_client_restrictions parameter restricts what clients this system accepts SMTP connections from. The default behavior is to allow SMTP connections from any client. This is discussed under Spam Controls on the Postfix site.
Example:
check_client_access regexp:/etc/postfix/access_sender_client_server,
Example:
check_sender_access regexp:/etc/postfix/access_sender_toplevel
smtpd_reject_unlisted_sender
Details can be found on the mail.cf Postfix page.
Example:
smtpd_reject_unlisted_sender = yes
Possible Bug:
http://bugzilla.zimbra.com/show_bug.cgi?id=24889
What's Your SPF Records Say, When Getting "does not designate 74.x.x.x as permitted sender Errors"
This is most likely related to the SPF records for your domain and what the header content of the sending email states as it's Mail From. For example, this is from the header of an email that was "received":
Received: from mail.XYZ-FAKE.com (mailhost.XYZ-FAKE.com [74.X.X.244]) by mta01.ABC-FAKE.com with ESMTP id Cft0mO3fjlFGQjTA for <support@ABC-FAKE.com>; Tue, 21 Apr 2009 05:14:13 -0700 (PDT) X-Barracuda-Envelope-From: testuser@XYZ-FAKE.com Received-SPF: pass (mta01.ABC-FAKE.com: domain of testuser@XYZ-FAKE.com designates 74.X.X.244 as permitted sender) receiver=mta01.ABC-FAKE.com; client_ip=74.X.X.244; envelope-from=testuser@XYZ-FAKE.com;
To see what this check was done against, do the following below. I'll trim the output and adjust the information used to protect the innocent. Also, notice how a DNS "alias" might cause an issue here? :
$ host 74.X.X.244 244.X.X.74.in-addr.arpa domain name pointer mailhost.XYZ-FAKE.com. $ host mailhost.XYZ-FAKE.com mailhost.XYZ-FAKE.com has address 74.X.X.244 $ host mail.XYZ-FAKE.com mail.XYZ-FAKE.com is an alias for mailhost.XYZ-FAKE.com. mailhost.XYZ-FAKE.com has address 74.X.X.244 $ dig XYZ-FAKE.com MX ;; QUESTION SECTION: ;XYZ-FAKE.com. IN MX ;; ANSWER SECTION: XYZ-FAKE.com. 3600 IN MX 22 serverA.DNS-FAKE.com. XYZ-FAKE.com. 3600 IN MX 11 serverB.DNS-FAKE.com. $ dig XYZ-FAKE.com TXT ;; QUESTION SECTION: ;XYZ-FAKE.com. IN TXT ;; ANSWER SECTION: XYZ-FAKE.com. 3600 IN TXT "v=spf1 a:mail.XYZ-FAKE.com ~all"
See the following for more information:
- http://www.openspf.org/
- http://www.schlitt.net/spf/spf_classic/draft-schlitt-spf-classic-02.html#publishing
- All of the 3.x section.
Using Different SMTP Server For Webclient (ZWC), Mobiles, And ZCO
Note Of Caution About Using External MTAs
Using non-zimbra MTA's can cause some options in zimbra to not function anymore - since it no longer has zimbra's mta services available.
Zimbra Mail Forwarding Possibly Will Not Work - Turn Off User Option To Set MailForwarding
Mail forwarding might no longer work depending on the configuration you setup regarding the use of your external mta's. When this happens you'll most likely want to disable the option for users to set a mail forwarding address in their preferences. This can be done via their COS or USER configuration.
- In the admin console, goto the COS configuration the user/s are using and the "Features" tab. Uncheck the option "Allow the user to specify a forwarding address" under Mail Features. It is in the same location under a USERs configuration panel in the admin console.
In the CLI, you will see these set as the defaults for the default COS. The admin gui option above only adjusts the zimbraFeatureMailForwardingEnabled variable :
$ zmprov gc default | grep zimbraFeatureMailForwarding zimbraFeatureMailForwardingEnabled: TRUE zimbraFeatureMailForwardingInFiltersEnabled: TRUE
$ zmprov ga ajcody@`zmhostname` | grep zimbraFeatureMailForwarding zimbraFeatureMailForwardingEnabled: TRUE zimbraFeatureMailForwardingInFiltersEnabled: TRUE
More details about them are in the /opt/zimbra/conf/attrs/zimbra-attrs.xml file.
<attr id="342" name="zimbraFeatureMailForwardingEnabled" type="boolean" cardinality="single" optionalIn="account,cos" flags="accountInfo,accountInherited,domainAdminModifiable"> <defaultCOSValue>TRUE</defaultCOSValue> <desc>enable end-user mail forwarding features</desc> </attr> <attr id="704" name="zimbraFeatureMailForwardingInFiltersEnabled" type="boolean" cardinality="single" optionalIn="account,cos" flags="accountInfo,accountInherited, domainAdminModifiable" since="5.0.10"> <defaultCOSValue>TRUE</defaultCOSValue> <desc>enable end-user mail forwarding defined in mail filters features</desc> </attr>
Configure External MTA To Use LDAP Virtual Alias Maps
Here's the basic info in regards to how Zimbra's mta [postfix/etc] uses Zimbra's LDAP to get the forwarding information:
$ grep Forward conf/ldap-* conf/ldap-vam.cf:result_attribute = zimbraMailDeliveryAddress,zimbraMailForwardingAddress, zimbraPrefMailForwardingAddress,zimbraMailCatchAllForwardingAddress
$ postconf |grep vam virtual_alias_maps = proxy:ldap:/opt/zimbra/conf/ldap-vam.cf
See http://www.postfix.org/postconf.5.html#virtual_alias_maps for more information.
Confirming And Setting zimbraMtaRelayHost And zimbraMtaDnsLookupsEnabled
First we'll set zimbraMtaRelayHost and zimbraMtaDnsLookupsEnabled variables. These options are also shown in the admin console and can be configured there. These variable alone will not redirect ALL traffic to an external MTA first though. There's alao a variable called zimbraSmtpHostname that is in the global (zmprov gacf) and server (zmprov gs `hostname`) configs - addressed in the section below. It's defaulted value is 'localhost' - at least on a single ZCS configuration.
In situations where you need/want all mail to be processed by, for example, an external non-Zimbra spam filter box you could set this variable to the spam filter servers hostname.
Normally, when zimbraMtaRelayHost is set to a non-zimbra external MTA would disable DNS lookups. If you disable DNS Lookups (under the MTA tab of the admin console, or with zmprov), Zimbra will end up using (according to the postconf man page) the "gethostbyname() system library routine which normally also looks in /etc/hosts" (based on the entries on the "hosts" line in /etc/nsswitch.conf). If you do this but don't also specify an SMTP relay host (typically your ISP's SMTP server), which will take care of checking DNS, you will reverse your ability to send mail: suddenly you can send mail to other users on the Zimbra server, but you can't send to the internet (though you can still receive mail from the internet either way).
Query Global - `zmhostname` would use the value returned, you can manual type out the servername as well :
zmprov gacf zimbraMtaRelayHost zmprov gacf zimbraMtaDnsLookupsEnabled
Query Per Server - `zmhostname` would use the value returned, you can manual type out the servername as well :
zmprov gs `zmhostname` zimbraMtaRelayHost zmprov gs `zmhostname` zimbraMtaDnsLookupsEnabled
Note - if you get errors about doing the query on your non-mailstores like, "ERROR: zclient.IO_ERROR (invoke Connection refused, server: localhost) (cause: java.net.ConnectException Connection refused)" then you might need to adjust this variable. First query it, it's most likely set to localhost
zmlocalconfig zimbra_zmprov_default_soap_server
If you had the error and it was set to localhost, modify it to be one of your mailstores.
zmlocalconfig -e zimbra_zmprov_default_soap_server=mailstore.example.com
No restart of anything is needed, the zmprov query should now work.
Modify Global - `zmhostname` would use the value returned, you can manual type out the servername as well :
zmprov mcf zimbraMtaRelayHost hostname-of-ext-server:PORT ** ex : zmprov mcf zimbraMtaRelayHost primary.YYY.state.XX.us:25 ** At the end, 25 is the port number for smtp on the targeted system. ** Adjust this number if you changed the smtp port. zmprov mcf zimbraMtaDnsLookupsEnabled FALSE
Modify Per Server - `zmhostname` would use the value returned, you can manual type out the servername as well :
zmprov ms `zmhostname` zimbraMtaRelayHost hostname-of-ext-server:PORT ** ex : zmprov ms `zmhostname` zimbraMtaRelayHost primary.YYY.state.XX.us:25 ** At the end, 25 is the port number for smtp on the targeted system. ** Adjust this number if you changed the smtp port. zmprov ms `zmhostname` zimbraMtaDnsLookupsEnabled FALSE
Confirming And Setting zimbraSmtpHostname
I'm assuming you already set, zimbraMtaRelayHost and zimbraMtaDnsLookupsEnabled for your needs - see above section. The variable called zimbraSmtpHostname is in the global (zmprov gacf) and server (zmprov gs `hostname`) configs. It's default value is set to 'localhost' - at least on a single ZCS configuration.
In cases where you need/want all mail to be processed by, for example, an external non-Zimbra spam filter box you could set this variable to the spam filter boxes hostname.
Query Global - `zmhostname` would use the value returned, you can manual type out the servername as well :
zmprov gacf zimbraSmtpHostname
Query Per Server - `zmhostname` would use the value returned, you can manual type out the servername as well :
zmprov gs `zmhostname` zimbraSmtpHostname
Note - if you get errors about doing the query on your non-mailstores like, "ERROR: zclient.IO_ERROR (invoke Connection refused, server: localhost) (cause: java.net.ConnectException Connection refused)" then you might need to adjust this variable. First query it, it's most likely set to localhost
zmlocalconfig zimbra_zmprov_default_soap_server
If you had the error and it was set to localhost, modify it to be one of your mailstores.
zmlocalconfig -e zimbra_zmprov_default_soap_server=mailstore.example.com
No restart of anything is needed, the zmprov query should now work.
Modify Global - `zmhostname` would use the value returned, you can manual type out the servername as well :
zmprov mcf zimbraSmtpHostname hostname-of-ext-server ** ex : zmprov mcf zimbraSmtpHostname primary.YYY.state.XX.us
Modify Per Server - `zmhostname` would use the value returned, you can manual type out the servername as well :
zmprov ms `zmhostname` zimbraSmtpHostname hostname-of-ext-server ** ex : zmprov ms `zmhostname` zimbraSmtpHostname primary.YYY.state.XX.us
External Email Clients Setting A SMTP Server
The above variable, zimbraSmtpHostname, will not alter your third party email clients that are setting the smtp server to your ZCS mta's. Here are your options if you also need to have that traffic to go through another device [mta, spam filter, etc.] prior to local delivery [lmtp] to an internal address.
- Set your clients to use the another devices ip address or hostname that you set for zimbraSmtpHostname.
If you can't do the above, for whatever reason -- maybe security constraints or issues that might arise being a hosting provider, then see below.
- You could investigate the alternation of postfix's content_filter option to place the external device/host [a barracuda for example] within that process. postfix.org has information on this - Postfix After-Queue Content Filter. This would be unsupported by Zimbra.
- Contact Zimbra's Professional Services [PS] team for help.
- Setup another server using a mta of your choice [postfix , sendmail] that the clients can use for the smtp server variable. This "new" mta would then simply relay to the device - a barracuda box for example. The barracuda would then do what it needs to and then forwards the messages to the appropriate servers for delivery. Your ZCS mta's in the case of local delivery that would of normally occurred over lmtp - userA@domainC.com sending to userB@domainC.com .
Global Or System Wide Filters
There is no "supported" solution for this - depending on the exact circumstances. It's a complex issue because each request for "global filters" tends to be very specific on either what's to be filter, what actions are to be taken, and so forth.
RFE's Related To Global Filters
- "Define a default filter rule for spam that users can apply before custom filters"
- "admin assignable mail filters"
Use The Legal Intercept Method
Depending on the details of your request, using the Legal Intercept options might be useful. You could take the results that goto the LI mailbox and then perform your admin global searches against your mailbox accounts to take the appropriate action.
See Legal_Intercept
Sieve Filter Set For Every Account
One could setup a forloop for all of your users and setup a sieve filter. Downside here is the rules are editable by the users and you would have to manage the rules for new accounts going forward.
See User_Migration#Migrating_Sieve_Filter_Rules for details.
Double Check The Current Anti-Spam Options
Make sure your request can't be solved by the current solutions described in articles.
Postfix , Amavis Customizations
I've seen some posts on the forums that customers found their own workarounds by customizing postfix and amavis. This will most likely result in an unsupported situation. Unfortunately, those forum posts don't also include details that I can share here. Hopefully I can find them going forward and I'll post them here.
Global Disclaimer Options
Here's the url to review for a "current" possibility:
And in the notes section there's a comment about multi-servers:
Please note though, "This article is a community contribution and may include unsupported customizations." Meaning, it's an unsupported customization, so please take the necessary precautions.
In regards to an official and supported way to do this, please review this RFE:
Quota Issues
Where To Adjust Message User Gets When They Are Over Quota
Moved to How_To_Adjust_The_Over_Quota_Message_The_User_Receives
See Current User Qoutas
Moved to Getting_All_Users_Quota_Data
Controlling Behavior For Messages Sent To Over Quota Mailbox - LMTP
Moved to Controlling_Behavior_For_Messages_Sent_To_Over_Quota_Mailbox_-_LMTP
Controlling Behavior For Messages Sent To Over Quota Mailbox - SMTP
Moved to Controlling_Behavior_For_Messages_Sent_To_Over_Quota_Mailbox_-_SMTP
Message Senders Receive About Mailbox Over Quota
Moved to Message_Senders_Receive_About_Mailbox_Over_Quota
Quota Not Showing In Admin Console - After ZCS Upgrade
Moved to Quota_Not_Showing_In_Admin_Console_-_After_ZCS_Upgrade
Managing Postfix Queue
Moved to Managing_The_Postfix_Queues#Managing_The_Postfix_Queues
Postfix, Amavis, Clamav Spool Directory Paths And Names
Moved to Managing_The_Postfix_Queues#Postfix.2C_Amavis.2C_Clamav_Spool_Directory_Paths_And_Names
Stop And Starting Postfix And Mta
Moved to Managing_The_Postfix_Queues#Stop_And_Starting_Postfix_And_Mta
To See Postfix Queue
Moved to Managing_The_Postfix_Queues#To_See_The_Postfix_Queues
Qshape - Print Postfix queue domain and age distribution
Moved to Managing_The_Postfix_Queues#Qshape_-_Print_Postfix_queue_domain_and_age_distribution
To View A Message In The Queue
Moved to Managing_The_Postfix_Queues#To_View_A_Message_In_The_Queue
To Flush Postfix Queue
Moved to Managing_The_Postfix_Queues#To_Flush_Postfix_Queue
To Requeue Messages In Postfix
Moved to Managing_The_Postfix_Queues#To_Requeue_Messages_In_Postfix
To Put Messages On Hold
Moved to Managing_The_Postfix_Queues#To_Put_Messages_On_Hold
To Delete Messages From Queue
Moved to Managing_The_Postfix_Queues#To_Delete_Messages_From_Queue
Cautionary Note
Moved to Managing_The_Postfix_Queues#Cautionary_Note
Relevant Sections Of Postsuper Man Page
Moved to Managing_The_Postfix_Queues#Relevant_Sections_Of_Postsuper_Man_Page
To Delete Single Message From Queue
Moved to Managing_The_Postfix_Queues#To_Delete_Single_Message_From_Queue
To Delete ALL Messages From Queue
Moved to Managing_The_Postfix_Queues#To_Delete_ALL_Messages_From_Queue
To Delete ALL Messages From The Deferred Queue
Moved to Managing_The_Postfix_Queues#To_Delete_ALL_Messages_From_The_Deferred_Queue
To Delete ALL Messages From The Hold Queue
Moved to Managing_The_Postfix_Queues#To_Delete_ALL_Messages_From_The_Hold_Queue
To Delete Many Messages From Queue
Moved to Managing_The_Postfix_Queues#To_Delete_Many_Messages_From_Queue
Delete From Queue By Email Address
Moved to Managing_The_Postfix_Queues#Delete_From_Queue_By_Email_Address
From CLI
Moved to Managing_The_Postfix_Queues#From_CLI
Script To Delete From Queue By Email Address
Moved to Managing_The_Postfix_Queues#Script_To_Delete_From_Queue_By_Email_Address
Script To Delete From Queue By Various Variable Targets
Moved to Managing_The_Postfix_Queues#Script_To_Delete_From_Queue_By_Various_Variable_Targets
Ajcody MySQL Topics
Mysql
Actual Mysql Topics Homepage
Please see Ajcody-Mysql-Topics
Mysql Issues And Memory Usuage
My Ajcody-General-Notes#Trouble_Shooting_Memory_Issues has some stuff on memory troubleshooting - generalities.
Our performance guide for Mysql:
http://wiki.zimbra.com/index.php?title=Performance_Tuning_Guidelines_for_Large_Deployments#MySQL
Variable Within MySQL & Zimbra
These percentages below are used against physical RAM - disregard swap in the percentage division.
From the above url, we get some details.
"By default, we try to reserve 30% of system memory for use by this process, and 40% for use by MySQL."
# ZCS 5.0 and later $ zmlocalconfig -e mailboxd_java_heap_memory_percent=40
Java - mailboxd_java_heap_memory_percent
The command to set the java percentage is:
zmlocalconfig -e mailboxd_java_heap_memory_percent=30
Mysql - mysql_memory_percent & my.cnf w/ innodb_buffer_pool_size
Looks like there's an issue with the command/variable (zmlocalconfig -e mysql_memory_percent=##) in regards to MySQL though.
"There is a local config variable [mysql_memory_percent] for mysql memory percent, but today my.cnf doesn't get rewritten after install, so you have to edit my.cnf for this setting if you want to change it."
In summary, this variable [ mysql_memory_percent ] for MySQL is basically not working.
Do this to get memory in bytes for division numbers:
free -b
Figure out what your % in bytes using the physical memory (Mem:) output. Now edit the /opt/zimbra/conf/my.cnf file to change the following line with your memory percentage in bytes:
vi /opt/zimbra/conf/my.cnf #Modify this var to adjust memory usage innodb_buffer_pool_size = xxx
This will require a restart.
A GREAT forum post on this is here:
- http://www.zimbra.com/forums/administrators/21519-memory-usage-slowness-backup-error.html#post107080
So other background info:
- http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/
- http://www.mysqlperformanceblog.com/2007/11/03/choosing-innodb_buffer_pool_size/
Mysql And Swap
See this article first before exploring the options below.
Should you have your swap file enabled while running MySQL ?
Set swappiness Kernel Var To 0
Source of this summary is here: [http://www.mysqlperformanceblog.com/2007/09/28/heikki-tuuri-to-answer-your-in-depth-innodb-questions/#comment-174442 Swappiness To 0"
Set it on running box:
echo 0 > /proc/sys/vm/swappiness
Set it to persist after reboot - vi /etc/sysctl.conf :
vm.swappiness = 0
The value is a percentage. By setting it to 100, Linux will always swap programs out and never shrink the buffer cache.
Swap Ram Disk Instead Of Disk
Source of this summary is here:
MySQL and the Linux swap problem
Make a (or some) swap disks:
mkdir /mnt/ram0 dd bs=1024 count=14634 if=/dev/zero of=/mnt/ram0/swapfile mkswap /mnt/ram0/swapfile swapon /mnt/ram0/swapfile
Will look like this:
[root@mail3 ~]# mkdir /mnt/ram0 [root@mail3 ~]# dd bs=1024 count=14634 if=/dev/zero of=/mnt/ram0/swapfile 14634+0 records in 14634+0 records out 14985216 bytes (15 MB) copied, 0.246329 seconds, 60.8 MB/s [root@mail3 ~]# mkswap /mnt/ram0/swapfile Setting up swapspace version 1, size = 14979 kB [root@mail3 ~]# free total used free shared buffers cached Mem: 1555472 1461200 94272 0 159400 344328 -/+ buffers/cache: 957472 598000 Swap: 2031608 104 2031504 [root@mail3 ~]# swapon /mnt/ram0/swapfile [root@mail3 ~]# free total used free shared buffers cached Mem: 1555472 1476252 79220 0 159404 344376 -/+ buffers/cache: 972472 583000 Swap: 2046232 104 2046128 [root@mail3 ~]# swapon -s Filename Type Size Used Priority /dev/mapper/VolGroup00-LogVol01 partition 2031608 104 -1 /mnt/ram0/swapfile file 14624 0 -2 [root@mail3 ~]# cat /proc/swaps Filename Type Size Used Priority /dev/mapper/VolGroup00-LogVol01 partition 2031608 104 -1 /mnt/ram0/swapfile file 14624 0 -2
Just add those lines to your relevant startup file, like /etc/rc.d/rc.local, and it’ll persist after reboots.
</pre>
O_DIRECT On Linux And INNODB To Fix Swapping
Source reference for this part is here:
Using O_DIRECT on Linux and INNODB to Fix Swap Insanity
See also: Ajcody-Mysql-Topics#IO_DIRECT_And_Ext3_On_Linux_As_Possible_Reason_For_Corruption
IO_DIRECT And Ext3 On Linux As Possible Reason For Corruption
This is being investigated. Below are my notes on the issue.
- We recommend this setting that might be causing issue:
- IO_DIRECT For MySQL Can Be Detrimental
- Mysql Bug - "innodb_flush_method = O_DIRECT may degrade performance of InnoDB on SAN":
- Comment about O_Direct from Linus:
- EXT3 not RAID-5 may be the cause of performance issues
- Numerous Items On This Blog Page:
- http://mysqldba.blogspot.com/2008_01_01_archive.html
- Most relevant are these sections:
- http://mysqldba.blogspot.com/2008_01_01_archive.html
Mysql Backup And Restore
Please see the MySQL_Backup_and_Restore page.
Mysql Database Corruption/Repair/Checks
Please see the Mysql_Crash_Recovery page rather than the normal search results that give mysql-logger details.
Mysql Table Checks
Mysql Table Types - InnoDB or MyISAM
Tables are either InnoDB or MyISAM. Putting this information here because if a table is in need of repair or something, the steps to fix it might be different depending on the tables ENGINE type.
Example for MyISAM:
$ mysql -e "show create table zimbra.jiveRoster" [cut] ) ENGINE=MyISAM DEFAULT CHARSET=utf8 | [cut]
Example for InnoDB:
$ mysql -e "show create table zimbra.mailbox" [cut] ) ENGINE=InnoDB DEFAULT CHARSET=utf8 | [cut]
check zimbra.mailbox database tables
$ mysql -e "check table zimbra.mailbox" +----------------+-------+----------+----------+ | Table | Op | Msg_type | Msg_text | +----------------+-------+----------+----------+ | zimbra.mailbox | check | status | OK | +----------------+-------+----------+----------+
check mboxgroup[#].mail_item table
$ mysql -e "check table mboxgroup3.mail_item" +----------------------+-------+----------+----------+ | Table | Op | Msg_type | Msg_text | +----------------------+-------+----------+----------+ | mboxgroup3.mail_item | check | status | OK | +----------------------+-------+----------+----------+
jive.Roster or zimbra.jiveUserProp Errors From Daily Report With mysqlcheck Errors
- Please note, these tables are MyISAM. Don't use the below steps for other type of tables as each table might be treated differently or with extra caution. [InnoDB vs MyISAM]
Your report from /opt/zimbra/libexec/zmdbintegrityreport might give the following for example:
Database errors found. /opt/zimbra/mysql/bin/mysqlcheck --defaults-file=/opt/zimbra/conf/my.cnf -S /opt/zimbra/db/mysql.sock -A -C -s -u root --password=[mysql password] zimbra.jiveID warning : 1 client is using or hasn't closed the table properly zimbra.jiveRoster warning : 1 client is using or hasn't closed the table properly zimbra.jiveUserProp warning : 2 clients are using or haven't closed the table properly
Attempt the following:
mysql -e "check table zimbra.jiveRoster" +-------------------+-------+----------+----------+ | Table | Op | Msg_type | Msg_text | +-------------------+-------+----------+----------+ | zimbra.jiveRoster | check | status | OK | +-------------------+-------+----------+----------+
To see if the data "looks" fine or works correctly against a select, do:
mysql -e "select * from zimbra.jiveRoster"
Note, if the above command might dump out a lot of data, try:
mysql -e "select * from zimbra.jiveRoster" > /tmp/zimbra.jiveRoster.out
Yours might show something different for Msg_text. If you need to repair, you would run:
mysql -e "repair table zimbra.jiveRoster"
You can also do the same above but replacing zimbra.jiveRoster with zimbra.jiveUserProp .
Manual Change Of Mysql Passwords
Please see:
http://wiki.zimbra.com/index.php?title=Issues_with_mysql_and_logmysql_passwords
Working Within Mysql For Accounts
- Note, the mailboxId is specific to the mailstore the user resides on. The zimbraId is the users unique id system wide - zmprov ga user@domain.com zimbraId .
Other References:
Getting User Variables We Need To Query MySQL
Getting The Users mailboxId # - zmprov gmi user@domain
For Mysql, this # returned below will become apart of mailbox_id=### . Example used is mailbox_id=3 .
- Note, the mailboxId is specific to the mailstore the user resides on. The zimbraId is the users unique id system wide - zmprov ga user@domain.com zimbraId .
[root@mail39 ~]# su - zimbra [zimbra@mail39 ~]$ zmprov gmi ajcody@mail39.zimbra.DOMAIN.com mailboxId: 3 quotaUsed: 169831
Getting The Users Mailstore That Their DB Resides On - zmprov ga user@domain zimbraMailHost
The mailboxId found above for the user is unique to their actual mailstore and the db that resides there. Again:
- Note, the mailboxId is specific to the mailstore the user resides on. The zimbraId is the users unique id system wide - zmprov ga user@domain.com zimbraId .
To get their particular mailstore their database resides on:
$ zmprov ga ajcody@mail39.zimbra.DOMAIN.com zimbraMailHost # name ajcody@mail39.zimbra.DOMAIN.com zimbraMailHost: mail39.zimbra.DOMAIN.com
So you would now log onto that mailstore to do your mysql operations (searches).
Confirm zimbra_mailbox_groups Variable
Need to confirm zimbra_mailbox_groups variable to get the users mboxgroup# since we'll then need to run the expression below to determine it.
[zimbra@mail39 ~]$ zmlocalconfig zimbra_mailbox_groups zimbra_mailbox_groups = 100
The Mysql group_id Value
The group_id is controlled by a local configuration value. It defaults to 100.
$ zmlocalconfig zimbra_mailbox_groups zimbra_mailbox_groups = 100
You'll see group_id in the following:
$ mysql -e 'SELECT * FROM zimbra.mailbox WHERE id=3\G' *************************** 1. row *************************** id: 3 group_id: 3 *** CUT REST OF OUTPUT ***
Get Users mboxgroup #
Finally confirming what the mboxgroup is for the user by running the following below. The mboxgroup is comprised of multiple users that are unique by way of their mailbox_id number. This is to minimize the number of db's that are needed on the mailstore, rather than doing one db per user.
- 3 ='s the users mailboxId
- 100 ='s the variable from zimbra_mailbox_groups
For Mysql, this # returned below will become apart of mboxgroup###.mail_item = mboxgroup3.mail_item
[zimbra@mail39 ~]$ expr 3 % 100 3
Queries Against Mysql For User Information In The zimbra DB And mailbox Table - zimbra.mailbox
By mailboxId
You'll need to know the mailboxId for the user for this. [ zmprov gmi USER@DOMAIN.com ]
Format:
$ mysql -e 'SELECT * FROM zimbra.mailbox WHERE id=<mailboxID of USER>\G'
Working example:
$ mysql -e 'SELECT * FROM zimbra.mailbox WHERE id=3\G' *************************** 1. row *************************** id: 3 group_id: 3 account_id: 3be48432-926c-4a54-bd66-3b16185a37a4 index_volume_id: 2 item_id_checkpoint: 339 contact_count: 5 size_checkpoint: 35912 change_checkpoint: 7200 tracking_sync: 0 tracking_imap: 0 last_backup_at: 1231567229 comment: ajcody@zimbra.DOMAIN.com last_soap_access: 1229584283 new_messages: 1 idx_deferred_count: 0
By zimbraId
You'll need to know the zimbraId for the user for this.
Via zmprov:
$ zmprov ga ajcody@zimbra.DOMAIN.com zimbraId # name ajcody@zimbra.DOMAIN.com zimbraId: 3be48432-926c-4a54-bd66-3b16185a37a4
Or ldap:
$ su - zimbra $ source ~/bin/zmshutil $ zmsetvars $ ldapsearch -LLL -x -H $ldap_master_url -D $zimbra_ldap_userdn -w $zimbra_ldap_password "mail=ajcody@zimbra.DOMAIN.com" zimbraId dn: uid=ajcody,ou=people,dc=zimbra,dc=DOMAIN,dc=com zimbraId: 3be48432-926c-4a54-bd66-3b16185a37a4
Format:
$ mysql -e 'SELECT * FROM zimbra.mailbox WHERE account_id=<zimbraID of USER>\G'
Working example:
$ mysql -e 'SELECT * FROM zimbra.mailbox WHERE account_id="3be48432-926c-4a54-bd66-3b16185a37a4"\G' *************************** 1. row *************************** id: 3 group_id: 3 account_id: 3be48432-926c-4a54-bd66-3b16185a37a4 index_volume_id: 2 item_id_checkpoint: 339 contact_count: 5 size_checkpoint: 35912 change_checkpoint: 7200 tracking_sync: 0 tracking_imap: 0 last_backup_at: 1231567229 comment: ajcody@zimbra.DOMAIN.com last_soap_access: 1229584283 new_messages: 1 idx_deferred_count: 0
By Comment Field - I.E. Username
This way searches against the "comment field". The comment field is mostly correct, but it is deemed unreliable since there are some corner cases where it can be duplicated. Use it in a pinch.
Format:
$ mysql -e 'SELECT * FROM zimbra.mailbox WHERE comment LIKE "<USER>%"\G'
Working example:
$ mysql -e 'SELECT * FROM zimbra.mailbox WHERE comment LIKE "ajcody%"\G' *************************** 1. row *************************** id: 3 group_id: 3 account_id: 3be48432-926c-4a54-bd66-3b16185a37a4 index_volume_id: 2 item_id_checkpoint: 339 contact_count: 5 size_checkpoint: 35912 change_checkpoint: 7200 tracking_sync: 0 tracking_imap: 0 last_backup_at: 1231567229 comment: ajcody@zimbra.DOMAIN.com last_soap_access: 1229584283 new_messages: 1 idx_deferred_count: 0
Show all accounts on mailstore
Show all accounts on mailstore.
$ mysql -e 'SELECT * FROM zimbra.mailbox WHERE comment LIKE "%"\G' | grep comment comment: admin@zimbra.DOMAIN.com comment: wiki@zimbra.DOMAIN.com comment: spam.1c4mokie@zimbra.DOMAIN.com comment: ham.iudu0ic_mz@zimbra.DOMAIN.com comment: shared-account@zimbra.DOMAIN.com comment: testuser@zimbra.DOMAIN.com comment: large-share@zimbra.DOMAIN.com comment: cos-user@zimbra.DOMAIN.com comment: arch-prod@zimbra.DOMAIN.com
Query All Users In A mboxgroup##
This is very useful, for example, if you experience corruption in one of your mboxgroup## db files when you want to see who is effected. Remember, these are unique to mailstore (group_id = mboxgroup)(id = userid). The account_id is a global variable, the comment field should reflect the account_id's email address - another global variable.
Note - I'm on a small test server, hence why only one account is showing. zimbra_mailbox_groups = 100 [default] determines the 'round-robin' behavior of assigning users to mboxgroup's
$ mysql -e 'select id, comment, account_id, group_id from zimbra.mailbox where group_id=5' +----+-------------------------------------------+--------------------------------------+----------+ | id | comment | account_id | group_id | +----+-------------------------------------------+--------------------------------------+----------+ | 5 | ham.1msrt1ugis@mail37.DOMAIN.com | 9ded4fa5-62fe-4ae4-ac14-7a8928386ea8 | 5 | +----+-------------------------------------------+--------------------------------------+----------+
You can also, double check, information the account_id and comment with zmprov then:
$ zmprov gmi 9ded4fa5-62fe-4ae4-ac14-7a8928386ea8 mailboxId: 5 quotaUsed: 0 $ zmprov gmi ham.1msrt1ugis@mail37.DOMAIN.com mailboxId: 5 quotaUsed: 0
Just to be complete, below I'll list the location of the various db's in question based upon the filesystem.
$ pwd /opt/zimbra/db/data/zimbra $ ls mailbox* mailbox.frm mailbox.ibd mailbox_metadata.frm mailbox_metadata.ibd $ cd ../mboxgroup5/ $ pwd /opt/zimbra/db/data/mboxgroup5 $ ls appointment.frm data_source_item.ibd imap_folder.ibd mail_item.frm open_conversation.ibd revision.frm tombstone.ibd appointment.ibd db.opt imap_message.frm mail_item.ibd pop3_message.frm revision.ibd data_source_item.frm imap_folder.frm imap_message.ibd open_conversation.frm pop3_message.ibd tombstone.frm
Deleting An Account In Mysql
This comes up in very rare circumstances, usually when an account rename was attempted and for some reason it fails -- leaving the account in an odd state, where ldap and mysql data no longer match up. Use with extreme caution and under guidance of support staff.
The Steps To Delete User In Mysql
Caution - This Should Almost Never Need To Be Done. Usually Only Needed When Ldap Doesn't Have Account Anymore And For Some Reason Account Still Exists In Mysql
Use the above section, Ajcody-Mysql-Topics#Getting_User_Variables_We_Need_To_Query_MySQL , to get mailboxId or other needed data. The below example will most likely fail with the zmprov command because of missing data in ldap. You still might need to do the expr example below when you do your mysql delete commands.
# Fetch the user's mailbox Id # zmprov will most likely fail in the situation where you need to do this process # Use Ajcody-Mysql-Topics#Getting_User_Variables_We_Need_To_Query_MySQL # alternative methods to get this variable - mailboxId [root@]# su - zimbra [zimbra@]$ zmprov getMailboxInfo user1@example.com mailboxId: 11 quotaUsed: 30620 # Fetch the user's mboxgroup Id # Default is 100 for zimbra_mailbox_groups
$ zmlocalconfig zimbra_mailbox_groups zimbra_mailbox_groups = 100
# expr [mailboxId] % [zimbra_mailbox_groups]
$ expr 11 % 100 11
Each user is referenced by a unique mailboxId within Mysql. Each mailstore has it's own Mysql database and therefore the user mailboxId's are only locally unique - i.e., the id isn't a unique global variable. Replace id=#####, mboxgroup## and mailbox_id=##### with relevant data. An example might have mboxgroup77 , id=18577 and mailbox_id=18577.
[root@]# su - zimbra [zimbra@]# mysql mysql> SET foreign_key_checks = 0; mysql> use mboxgroup##; mysql> delete from appointment where mailbox_id=#####; mysql> delete from data_source_item where mailbox_id=#####; mysql> delete from imap_folder where mailbox_id=#####; mysql> delete from imap_message where mailbox_id=#####; mysql> delete from mail_item where mailbox_id=#####; mysql> delete from open_conversation where mailbox_id=#####; mysql> delete from pop3_message where mailbox_id=#####; mysql> delete from revision where mailbox_id=#####; mysql> delete from tombstone where mailbox_id=#####; mysql> use zimbra; mysql> delete from mailbox where id=#####; mysql> delete from mailbox_metadata where mailbox_id=#####; mysql> SET foreign_key_checks = 1 mysql> quit
[zimbra@]# zmprov fc account
Useful Mysql Query Examples
First - Get User Variables we need to query MySQL
Please see Ajcody-Mysql-Topics#Getting_User_Variables_We_Need_To_Query_MySQL
Mysql Query For A Users Specific Blob-Data ID
Query of Mysql against users mboxgroup [mboxgroup#.mail_item] for a SPECIFIC message [id=#]
- Note, in this case, the users mailbox_id isn't necessary
[zimbra@mail39 ~]$ mysql -e 'SELECT * FROM mboxgroup3.mail_item WHERE id=321\G' *************************** 1. row *************************** mailbox_id: 3 id: 321 type: 5 parent_id: NULL folder_id: 5 index_id: 321 imap_id: 321 date: 1281984004 size: 448 volume_id: 1 blob_digest: 0pe,M6lHRy4KBXbIyEeR7AJzfkA= unread: 0 flags: 8193 tags: 0 sender: Adam Cody subject: test w mobile sending name: NULL metadata: d1:f0:1:s45:Adam Cody <ajcody@mail39.zimbra.DOMAIN.com>1:t32:admin@mail38.zimbra.DOMAIN.com1:vi10ee mod_metadata: 21394 change_date: 1281984004 mod_content: 21394
Content Of Message Example Above As On Filesystem
How To Locate Users Mailstore and Message Store Directory
The basics:
- $ zmprov ga USER@DOMAIN zimbraMailHost
- $ zmprov gmi USER@DOMAIN
- Note the mailboxId for the user.
- Then ssh to the zimbraMailHost the user is on.
- $ zmvolume -l
- Confirm the path for the primaryMessage volume, default is /opt/zimbra/store .
- cd to the primaryMessage volume path, example uses the default path.
- $ cd /opt/zimbra/store
- find . -maxdepth 2 -name [replace with the mailboxId of the user] -print
- or do perl -e 'print mailboxId# >> 12 ; print "\n"'
- You can now cd to the users msg directory.
Working example:
$ zmprov ga userA@DOMAIN zimbraMailHost # name userA@mail71.DOMAIN.com zimbraMailHost: mail71.DOMAIN.com [I'm already on the zimbraMailHost for this user, no need to ssh to it] $ zmprov gmi userA@DOMAIN mailboxId: 17 quotaUsed: 2032 $ zmvolume -l Volume id: 1 name: message1 type: primaryMessage path: /opt/zimbra/store compressed: false current: true Volume id: 2 name: index1 type: index path: /opt/zimbra/index compressed: false current: true $ find . -maxdepth 2 -name 17 -print ./0/17 or to find the top directory the user directory is in: $ perl -e 'print 17 >> 12 ; print "\n"' 0 $ cd 0/17/msg/ $ find . -name \*.msg -print ./0/268-751.msg ./0/269-756.msg ./0/306-2119.msg
The Message On The Filesystem - id index_id imap_id
Change directory to the users root directory under your mailstores 'store' path. Default is /opt/zimbra/store , this example user is under /opt/zimbra/store/0/3 . Everything under that is "theirs".
[zimbra@mail39 0]$ pwd /opt/zimbra/store/0/3/msg/0 [zimbra@mail39 0]$ ls 267-9778.msg 280-13700.msg 287-13743.msg 291-13777.msg 295-13763.msg 300-13771.msg 305-13784.msg 268-9780.msg 283-13715.msg 288-13747.msg 292-13758.msg 296-13764.msg 301-13774.msg 307-13791.msg 269-9782.msg 284-13740.msg 289-13752.msg 293-13759.msg 297-13765.msg 302-13775.msg 320-21392.msg 270-9854.msg 285-13741.msg 290-13755.msg 294-13760.msg 299-13769.msg 304-13782.msg 321-21394.msg
In our example above, we used "WHERE id=321". Remember, "id=321" is correlated to the 321 in the filename, 321-21394.msg. Also, you'll notice there's actually 3 matches :
- id: 321
- index_id: 321
- imap_id: 321
mod_metadata And mod_content
From the output above, you see two matches for 21394 - remember, filename is 321-21394.msg :
- mod_metadata: 21394
- mod_metadata might not as there are changes exclusively in the db.
- For example - marking read/unread, tagging, flagging, moving to a new folder, etc..
- mod_metadata might not as there are changes exclusively in the db.
- mod_content: 21394
- mod_content should always be reflected in the filename on the system
- mod_content is updated, for example, when saving a draft, editing a briefcase document, etc.
- Note : "Edit As New" on a message actually creates a new file on the filesystem and uses a different id .
- In ZCS6+ , using the "Remove Attachments" option on an email with attachments would most likely alter the mod_content number as well.
- mod_content is updated, for example, when saving a draft, editing a briefcase document, etc.
- mod_content should always be reflected in the filename on the system
Notice that the main difference between the two is where changes are only exclusively made in the db vs. a change that would necessary alter the "file".
If I then "tag" the message in ZWC for this message, you'll notice the mod_metadata is altered to 23826 but mod_content and the filename on the fs still uses 21394 . Notice as well, "tags: 0" was now changed to "tags: 1" .
[zimbra@mail39 data]$ mysql -e 'SELECT * FROM mboxgroup3.mail_item WHERE id=321\G' *************************** 1. row *************************** mailbox_id: 3 id: 321 type: 5 parent_id: NULL folder_id: 5 index_id: 321 imap_id: 321 date: 1281984004 size: 448 volume_id: 1 blob_digest: 0pe,M6lHRy4KBXbIyEeR7AJzfkA= unread: 0 flags: 1 tags: 1 sender: Adam Cody subject: test w mobile sending name: NULL metadata: d1:f0:1:s45:Adam Cody <ajcody@mail39.zimbra.DOMAIN.com>1:t32:admin@mail38.zimbra.DOMAIN.com1:vi10ee mod_metadata: 23826 change_date: 1282864623 mod_content: 21394 $ cd /opt/zimbra/store/0/3/msg/0 $ ls -la 321* -rw-r----- 1 zimbra zimbra 448 Aug 16 14:40 321-21394.msg
Mysql Query For date And change_date For ALL id's For A Specific User
Another item to point out in this example is the change_date and date fields. Notice that change_date has changed compared to the first time we ran the query. The change_date use to match the date variable number - date: 1281984004 . This field, change_date, is updated when the item has 'changed', not necessarily a mod_metadata type change -- that might be reflected in the time stamp of the file on the filesystem.
- date: 1281984004
- change_date: 1281984004
- vs. after we applies a 'tag' to message
- date: 1281984004
- change_date: 1282864623
To convert that into a 'normal' readable time format, using perl:
# perl -e 'print localtime(1281984004). "\n"' Mon Aug 16 14:40:04 2010 *** Which matches the ls -la time above. ***
vs.
# perl -e 'print localtime(1282864623). "\n"' Thu Aug 26 19:17:03 2010 *** Which is the time I tagged the message in ZWC. ***
To translate Thursday Aug 26 2010 19:17:03 to epoch seconds and back again, for example [Replace '-d' with '-ud' for GMT/UTC time]:
# date +%s -d "08/26/2010 19:17:03" 1282864623
or
# date +%s -ud "Thu Aug 26 19:17:03 EDT 2010" 1282864623
And to prove the conversion goes back again with the date command:
# date -d @1282864623 Thu Aug 26 19:17:03 EDT 2010
Another reference is, the from_unixtime() and unix_timestamp() mysql functions - see :
- http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html
- Please see the note as well under the following, note 100% - so you might want to fudge the time/numbers you use when searching 'dates/times'
Examples within mysql:
$ mysql -e 'SELECT UNIX_TIMESTAMP("2010-08-26 19:17:03")' +---------------------------------------+ | UNIX_TIMESTAMP("2010-08-26 19:17:03") | +---------------------------------------+ | 1282864623 | +---------------------------------------+
And back again:
$ mysql -e 'SELECT FROM_UNIXTIME(1282864623)' +---------------------------+ | FROM_UNIXTIME(1282864623) | +---------------------------+ | 2010-08-26 19:17:03 | +---------------------------+
An example mysql search query using this format:
$ mysql -e 'SELECT * FROM mboxgroup3.mail_item WHERE mailbox_id=3 AND change_date=(SELECT UNIX_TIMESTAMP("2010-08-26 19:17:03"))\G'
This might be useful if you find yourself wanting to query against the change_date for a particular user and see what messages were altered at that time or time range. Example might be, where the user is reporting their "problem" occurring at a certain time or during a time range.
A search against the change_date field and mailbox_id we've been discussing here, shows:
$ mysql -e 'SELECT * FROM mboxgroup3.mail_item WHERE mailbox_id=3 AND change_date=1282864623\G' *************************** 1. row *************************** mailbox_id: 3 id: 64 type: 3 parent_id: NULL folder_id: 8 index_id: NULL imap_id: NULL date: 1282864623 size: 0 volume_id: NULL blob_digest: NULL unread: NULL flags: 0 tags: 0 sender: NULL subject: Test-Tag name: Test-Tag metadata: d1:vi10ee mod_metadata: 23825 change_date: 1282864623 mod_content: 23825 *************************** 2. row *************************** mailbox_id: 3 id: 321 type: 5 parent_id: NULL folder_id: 5 index_id: 321 imap_id: 321 date: 1281984004 size: 448 volume_id: 1 blob_digest: 0pe,M6lHRy4KBXbIyEeR7AJzfkA= unread: 0 flags: 1 tags: 1 sender: Adam Cody subject: test w mobile sending name: NULL metadata: d1:f0:1:s45:Adam Cody <ajcody@mail39.zimbra.DOMAIN.com>1:t32:admin@mail38.zimbra.DOMAIN.com1:vi10ee mod_metadata: 23826 change_date: 1282864623 mod_content: 21394
See how we also identified the 'tag' entry, id: 64 type: 3 , that was made as the id=321 type=5 was altered.
To search by a range of the change_date variable. Notice the syntax of :
- change_date>=1282864600 ; meaning greater than or equal to
- we could also use this instead, change_date>=(SELECT UNIX_TIMESTAMP("2010-08-26 19:17:03")
- change_date<=1282865366 ; meaning less than or equal to
- we could also use this instead, change_date<=(SELECT UNIX_TIMESTAMP("2010-08-26 19:29:26")
$ mysql -e 'SELECT * FROM mboxgroup3.mail_item WHERE mailbox_id=3 AND change_date>=1282864600 AND change_date<=1282865366\G' *************************** 1. row *************************** mailbox_id: 3 id: 64 type: 3 parent_id: NULL folder_id: 8 index_id: NULL imap_id: NULL date: 1282864623 size: 0 volume_id: NULL blob_digest: NULL unread: NULL flags: 0 tags: 0 sender: NULL subject: Test-Tag name: Test-Tag metadata: d1:vi10ee mod_metadata: 23825 change_date: 1282864623 mod_content: 23825 *************************** 2. row *************************** mailbox_id: 3 id: 321 type: 5 parent_id: NULL folder_id: 5 index_id: 321 imap_id: 321 date: 1281984004 size: 448 volume_id: 1 blob_digest: 0pe,M6lHRy4KBXbIyEeR7AJzfkA= unread: 0 flags: 1 tags: 1 sender: Adam Cody subject: test w mobile sending name: NULL metadata: d1:f0:1:s45:Adam Cody <ajcody@mail39.zimbra.DOMAIN.com>1:t32:admin@mail38.zimbra.DOMAIN.com1:vi10ee mod_metadata: 23826 change_date: 1282864623 mod_content: 21394 *************************** 3. row *************************** mailbox_id: 3 id: 323 type: 5 parent_id: NULL folder_id: 6 index_id: 323 imap_id: 323 date: 1282865366 size: 444 volume_id: 1 blob_digest: l5E3l5rbE5XUzHcp+hRNkN1E7os= unread: 0 flags: 65 tags: 0 sender: Adam Cody subject: test w mobile sending - edit as new name: NULL metadata: d1:dd2:do3:3214:idnt36:db166bd3-2405-49d2-aa38-91159a3c9302e1:f4:test1:s45:Adam Cody <ajcody@mail39.zimbra.DOMAIN.com>1:t32:admin@mail38.zimbra.DOMAIN.com1:vi10ee mod_metadata: 23829 change_date: 1282865366 mod_content: 23829
Confirming subject Matches Subject Line In Message
You'll see that the message 321-21394.msg on the filesystem also matches the output we had with our mysql query - compare the Subject line.
[zimbra@mail39 0]$ head 321-21394.msg Date: Mon, 16 Aug 2010 14:40:04 -0400 (EDT) From: Adam Cody <ajcody@mail39.zimbra.DOMAIN.com> To: admin@mail38.zimbra.DOMAIN.com Message-ID: <27950055.531281984004882.JavaMail.root@mail39.zimbra.DOMAIN.com> Subject: test w mobile sending MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.0.13] X-Mailer: Zimbra 5.0.23_GA_3242.RHEL5 (zclient/5.0.23_GA_3242.RHEL5)
This is a good field to query against also. See Mysql Query For Subject Line In Message Of A Specific User.
Mysql Query For Subject Line In Message Of A Specific User
This is a good field to query against, depending on your circumstances. User's have very little information from their end, ZWC, that correlates into the mysql fields we've been discussing [generally speaking]. They can't see the message id as needed for id= in mboxgroup#.mail_item. Let's say you only have the mailbox_id of the user, therefor the mboxgroup#, and the Subject line of the message in question. You would do something like the following:
$ mysql -e 'SELECT * FROM mboxgroup3.mail_item WHERE mailbox_id=3 AND subject="test w mobile sending"\G' *************************** 1. row *************************** mailbox_id: 3 id: 321 type: 5 parent_id: NULL folder_id: 5 index_id: 321 imap_id: 321 date: 1281984004 size: 448 volume_id: 1 blob_digest: 0pe,M6lHRy4KBXbIyEeR7AJzfkA= unread: 0 flags: 1 tags: 1 sender: Adam Cody subject: test w mobile sending name: NULL metadata: d1:f0:1:s45:Adam Cody <ajcody@mail39.zimbra.DOMAIN.com>1:t32:admin@mail38.zimbra.DOMAIN.com1:vi10ee mod_metadata: 23826 change_date: 1282864623 mod_content: 21394
Mysql Query For ALL Message ID's Of A User
As you'll see in the above query, it has type=5 . Description of mboxgroup[#].mail_item Type shows that type 5 is 'messages'.
[zimbra@mail39 ~]$ mysql -e 'SELECT * FROM mboxgroup3.mail_item WHERE mailbox_id=3 AND type=5\G' *************************** 1. row *************************** mailbox_id: 3 id: 261 type: 5 parent_id: 263 folder_id: 5 index_id: 261 imap_id: 261 date: 1273609779 size: 458 volume_id: 3 blob_digest: baQatWGZSt5THO6tAGImpEOqVQY= unread: 0 flags: 1 tags: 0 sender: Adam Cody subject: test test name: NULL metadata: d1:f9:test test1:s45:Adam Cody <ajcody@mail39.zimbra.DOMAIN.com>1:t45:Adam Cody <ajcody@mail39.zimbra.DOMAIN.com>1:vi10ee mod_metadata: 6216 change_date: 1273609779 mod_content: 6215 *************************** 2. row *************************** mailbox_id: 3 id: 262 type: 5 parent_id: 263 folder_id: 2 index_id: 262 imap_id: 262 date: 1273609779 size: 1599 volume_id: 3 blob_digest: s2BgZHas3+fgRhBYpIHv7uAEuCY= unread: 0 flags: 0 tags: 0 sender: Adam Cody subject: test test name: NULL metadata: d1:f9:test test1:s45:Adam Cody <ajcody@mail39.zimbra.DOMAIN.com>1:vi10ee mod_metadata: 6217 change_date: 1273609784 mod_content: 6216 *************************** 3. row *************************** mailbox_id: 3 id: 264 type: 5 parent_id: NULL folder_id: 2 index_id: 264 imap_id: 264 date: 1273610021 size: 3467 volume_id: 3 blob_digest: n,VKvXmfL,jiA6kC8zE2g3TkWuM= unread: 0 flags: 0 tags: 0 sender: Test User subject: test html name: NULL metadata: d1:f14:BOLD Underline1:s43:Test User <test@mail39.zimbra.DOMAIN.com>1:vi10ee mod_metadata: 6220 change_date: 1273610084 mod_content: 6219 *************************** 4. row ***************************
- cut -- it then continues for all the messages that exist for this account
Mysql Query For ALL Message ID's In A Particular Folder Of A User
As you'll see in the above query, it has type=5 . Description of mboxgroup[#].mail_item Type shows that type 5 is 'messages'.
Get folder_id Number And Description
One way to get the folder_id is to use the zmmailbox against the user to find the id# that we want.
[zimbra@mail39 ~]$ zmmailbox -z -m ajcody@mail39.zimbra.DOMAIN.com gaf Id View Unread Msg Count Path ---------- ---- ---------- ---------- ---------- 1 conv 0 0 / () 16 docu 0 1 /Briefcase () 10 appo 0 1 /Calendar () 14 mess 0 6 /Chats () 7 cont 0 1 /Contacts () 6 mess 0 1 /Drafts () 13 cont 0 2 /Emailed Contacts () 2 mess 10 19 /Inbox () 4 mess 0 0 /Junk () 12 wiki 0 0 /Notebook () 5 mess 0 6 /Sent () 15 task 0 0 /Tasks () 3 conv 0 0 /Trash ()
Or we could use a mysql query to get the output of the descriptions as well. folder_type=1 if for "Folders" and instead of selecting * , we'll use "id,name".
[zimbra@mail39 ~]$ mysql -e 'SELECT id,name FROM mboxgroup3.mail_item WHERE mailbox_id=3 AND type=1\G' *************************** 1. row *************************** id: 1 name: USER_ROOT *************************** 2. row *************************** id: 2 name: Inbox *************************** 3. row *************************** id: 3 name: Trash *************************** 4. row *************************** id: 4 name: Junk *************************** 5. row *************************** id: 5 name: Sent *************************** 6. row *************************** id: 6 name: Drafts *************************** 7. row *************************** id: 7 name: Contacts *************************** 8. row *************************** id: 8 name: Tags *************************** 9. row *************************** id: 9 name: Conversations *************************** 10. row *************************** id: 10 name: Calendar *************************** 11. row *************************** id: 11 name: ROOT *************************** 12. row *************************** id: 12 name: Notebook *************************** 13. row *************************** id: 13 name: Emailed Contacts *************************** 14. row *************************** id: 14 name: Chats *************************** 15. row *************************** id: 15 name: Tasks *************************** 16. row *************************** id: 16 name: Briefcase
The Query For ALL Message ID's In A Particular Folder Of A User
Now we'll setup the query to also use the folder_id. In this example folder_id=5 for the users "Sent" folder.
[zimbra@mail39 ~]$ mysql -e 'SELECT * FROM mboxgroup3.mail_item WHERE mailbox_id=3 AND type=5 AND folder_id=5\G' *************************** 1. row *************************** mailbox_id: 3 id: 261 type: 5 parent_id: 263 folder_id: 5 index_id: 261 imap_id: 261 date: 1273609779 size: 458 volume_id: 3 blob_digest: baQatWGZSt5THO6tAGImpEOqVQY= unread: 0 flags: 1 tags: 0 sender: Adam Cody subject: test test name: NULL metadata: d1:f9:test test1:s45:Adam Cody <ajcody@mail39.zimbra.DOMAIN.com>1:t45:Adam Cody <ajcody@mail39.zimbra.DOMAIN.com>1:vi10ee mod_metadata: 6216 change_date: 1273609779 mod_content: 6215 *************************** 2. row *************************** mailbox_id: 3 id: 281 type: 5 parent_id: 286 folder_id: 5 index_id: 281 imap_id: 281 date: 1277122331 size: 463 volume_id: 3 blob_digest: LifXXOMYCgjFsIj,+bsxi0cboOQ= unread: 0 flags: 1 tags: 0 sender: Adam Cody subject: test mail39 name: NULL metadata: d1:f0:1:s45:Adam Cody <ajcody@mail39.zimbra.DOMAIN.com>1:t33:ajcody@mail59.zimbra.DOMAIN.com1:vi10ee mod_metadata: 13741 change_date: 1278082563 mod_content: 13701 *************************** 3. row *************************** mailbox_id: 3 id: 297 type: 5 parent_id: 286 folder_id: 5 index_id: 297 imap_id: 297 date: 1278084134 size: 14896 volume_id: 1 blob_digest: 66QUCgivALxwGk+p3hnQ4viVZXU= unread: 0 flags: 8195 tags: 0 sender: Adam Cody subject: test mail39 name: NULL metadata: d1:f22:-- Original Message --1:p4:Re: 1:s45:Adam Cody <ajcody@mail39.zimbra.DOMAIN.com>1:t45:Adam Cody <ajcody@mail59.zimbra.DOMAIN.com>1:vi10ee mod_metadata: 13765 change_date: 1278084134 mod_content: 13765 *************************** 4. row ***************************
- cut -- it then continues for all the messages that exist for this account
The Query For ALL Appointments For A Particular User
$ mysql -e 'SELECT * FROM mboxgroup3.appointment WHERE mailbox_id=3\G' *************************** 1. row *************************** mailbox_id: 3 uid: 3252c10b-b889-41ab-bbea-e07eafba0d76 item_id: 325 start_time: 2010-08-27 18:55:00 end_time: 2010-08-27 20:00:00 *************************** 2. row *************************** mailbox_id: 3 uid: 87fa4fc8-70c6-4459-9d3d-e139c0f6e64a item_id: 266 start_time: 2010-06-01 17:40:00 end_time: 2010-06-01 18:00:00
The only relationship I find so far at this point with the above data to 'other' areas within ZCS in regards to mysql or the filesystem is the UID [ 3252c10b-b889-41ab-bbea-e07eafba0d76 ] above will be the UID as well in the ics format that will be in the message that is sent. And that messages will be on the filesystem under the user's store directory path. The message filename was 326-24060.msg - which doesn't match the item_id [325] .
$ pwd /opt/zimbra/store/0/3/msg/0 $ grep 3252c10b-b889-41ab-bbea-e07eafba0d76 * 326-24060.msg:UID:3252c10b-b889-41ab-bbea-e07eafba0d76 $ ls -la 326-24060.msg -rw-r----- 1 zimbra zimbra 4619 Aug 27 18:04 326-24060.msg $ cat 326-24060.msg ## CUT ### BEGIN:VEVENT UID:3252c10b-b889-41ab-bbea-e07eafba0d76 SUMMARY:Test for Mysql Query LOCATION:My office ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE:mailto:admin@m ail39.zimbra.DOMAIN.com ORGANIZER;CN=Adam Cody:mailto:ajcody@mail39.zimbra.DOMAIN.com DTSTART;TZID="(GMT-06.00) Central Time (US & Canada)":20100827T180000 DTEND;TZID="(GMT-06.00) Central Time (US & Canada)":20100827T190000 ### ###
Mail Items Received Per Day
Actually saw this query from a customer in a case, thought it might be useful for others. Example uses mboxgroup3 and mailbox_id3 , you would adjust that for your own purposes.
$ mysql mysql> connect mboxgroup3; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Connection id: 18414 Current database: mboxgroup3 mysql> select FROM_UNIXTIME( date, '%d %m %Y'), count(*) from mail_item where mailbox_id=3 group by FROM_UNIXTIME( date, '%d %m %Y') order by date; +----------------------------------+----------+ | FROM_UNIXTIME( date, '%d %m %Y') | count(*) | +----------------------------------+----------+ | 13 09 2010 | 17 | | 14 09 2010 | 5 | | 15 09 2010 | 4 | | 16 09 2010 | 4 | | 17 09 2010 | 4 | +----------------------------------+----------+ 5 rows in set (0.00 sec) mysql>
All Blobs Associated With A Particular Volume ID
Assumptions to the command below. There's 100 mboxgroups and the volume we are searching for is volume id 3 [zmvolume -l] . Also, this was against ZCS 8.6 - which uses locator instead of volume_id field. Older versions of ZCS will need to swap locator below to read volume_id .
for i in `seq 100`; do mysql --skip-column-names -e "SELECT CONCAT_WS(',',mailbox_id,id,locator) \ FROM mboxgroup$i.mail_item WHERE locator=1" ; done >> /tmp/locator.txt
Mysql Tables
zimbra database
SHOW zimbra Database Tables
This output shows the tables of the zimbra database. From ZCS 8.6 :
mysql -e 'SHOW tables FROM zimbra' +-------------------+ | Tables_in_zimbra | +-------------------+ | config | | current_sessions | | current_volumes | | deleted_account | | mailbox | | mailbox_metadata | | mobile_devices | | out_of_office | | pending_acl_push | | scheduled_task | | service_status | | table_maintenance | | volume | | volume_blobs | +-------------------+
DESCRIBE zimbra.mailbox Database Table
Description of the zimbra.mailbox table in the zimbra database. From ZCS 8.6 :
mysql -e 'DESCRIBE zimbra.mailbox' +----------------------+---------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +----------------------+---------------------+------+-----+---------+-------+ | id | int(10) unsigned | NO | PRI | NULL | | | group_id | int(10) unsigned | NO | | NULL | | | account_id | varchar(127) | NO | UNI | NULL | | | index_volume_id | tinyint(3) unsigned | NO | MUL | NULL | | | item_id_checkpoint | int(10) unsigned | NO | | 0 | | | contact_count | int(10) unsigned | YES | | 0 | | | size_checkpoint | bigint(20) unsigned | NO | | 0 | | | change_checkpoint | int(10) unsigned | NO | | 0 | | | tracking_sync | int(10) unsigned | NO | | 0 | | | tracking_imap | tinyint(1) | NO | | 0 | | | last_backup_at | int(10) unsigned | YES | MUL | NULL | | | comment | varchar(255) | YES | | NULL | | | last_soap_access | int(10) unsigned | NO | | 0 | | | new_messages | int(10) unsigned | NO | | 0 | | | idx_deferred_count | int(11) | NO | | 0 | | | highest_indexed | varchar(21) | YES | | NULL | | | version | varchar(16) | YES | | NULL | | | last_purge_at | int(10) unsigned | NO | | 0 | | | itemcache_checkpoint | int(10) unsigned | NO | | 0 | | +----------------------+---------------------+------+-----+---------+-------+
Example Of User Information Of zimbra.mailbox
I use both the user's :
- {ldap} mailboxId equals id {mysql}
- remember, this is for the zimbra.mailbox and not the mboxgroup# db, for mboxgroup# you would use mailbox_id.
- {ldap} zimbraId equals account_id {mysql}
below in this example.
Example is from ZCS 8.6
$ zmprov gmi user1@`zmhostname` mailboxId: 7 quotaUsed: 17000 $ mysql -e 'SELECT * FROM zimbra.mailbox WHERE id=7\G' *************************** 1. row *************************** id: 7 group_id: 7 account_id: 2aa65168-7b18-4b13-b0e5-a91e4cd87bf5 index_volume_id: 2 item_id_checkpoint: 266 contact_count: 0 size_checkpoint: 17000 change_checkpoint: 800 tracking_sync: 0 tracking_imap: 0 last_backup_at: 1423893615 comment: user1@ldap2.zimbra.DOMAIN.com last_soap_access: 0 new_messages: 10 idx_deferred_count: 0 highest_indexed: NULL version: 2.7 last_purge_at: 1424184635 itemcache_checkpoint: 0 $ zmprov ga user1@`zmhostname` zimbraId # name user1@ldap2.zimbra.homeunix.com zimbraId: 2aa65168-7b18-4b13-b0e5-a91e4cd87bf5 $ mysql -e 'SELECT * FROM zimbra.mailbox WHERE account_id="2aa65168-7b18-4b13-b0e5-a91e4cd87bf5"\G' *************************** 1. row *************************** id: 7 group_id: 7 account_id: 2aa65168-7b18-4b13-b0e5-a91e4cd87bf5 index_volume_id: 2 item_id_checkpoint: 266 contact_count: 0 size_checkpoint: 17000 change_checkpoint: 800 tracking_sync: 0 tracking_imap: 0 last_backup_at: 1423893615 comment: user1@ldap2.zimbra.DOMAIN.com last_soap_access: 0 new_messages: 10 idx_deferred_count: 0 highest_indexed: NULL version: 2.7 last_purge_at: 1424184635 itemcache_checkpoint: 0
mboxgroup[#] database
Users are associated with a mboxgroup database. Each mboxgroup database will be comprised of multiple users, the users and their data are unique by way for the mailbox_id of the user.
SHOW mboxgroup[#] Database Tables
This output shows the tables of the mboxgroup# database. From ZCS 8.6 :
$ mysql -e 'SHOW tables FROM mboxgroup7' +----------------------+ | Tables_in_mboxgroup7 | +----------------------+ | appointment | | appointment_dumpster | | data_source_item | | imap_folder | | imap_message | | mail_item | | mail_item_dumpster | | open_conversation | | pop3_message | | revision | | revision_dumpster | | tag | | tagged_item | | tombstone | +----------------------+
DESCRIBE mboxgroup[#].mail_item Database Table
Description of the mail_item table in the mboxgroup# database. From ZCS 8.6 :
$ mysql -e 'DESCRIBE mboxgroup7.mail_item' +--------------+---------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------------+---------------------+------+-----+---------+-------+ | mailbox_id | int(10) unsigned | NO | PRI | NULL | | | id | int(10) unsigned | NO | PRI | NULL | | | type | tinyint(4) | NO | | NULL | | | parent_id | int(10) unsigned | YES | | NULL | | | folder_id | int(10) unsigned | YES | | NULL | | | prev_folders | text | YES | | NULL | | | index_id | int(10) unsigned | YES | | NULL | | | imap_id | int(10) unsigned | YES | | NULL | | | date | int(10) unsigned | NO | | NULL | | | size | bigint(20) unsigned | NO | | NULL | | | locator | varchar(1024) | YES | | NULL | | | blob_digest | varchar(44) | YES | | NULL | | | unread | int(10) unsigned | YES | | NULL | | | flags | int(11) | NO | | 0 | | | tags | bigint(20) | NO | | 0 | | | tag_names | text | YES | | NULL | | | sender | varchar(128) | YES | | NULL | | | recipients | varchar(128) | YES | | NULL | | | subject | text | YES | | NULL | | | name | varchar(255) | YES | | NULL | | | metadata | mediumtext | YES | | NULL | | | mod_metadata | int(10) unsigned | NO | | NULL | | | change_date | int(10) unsigned | YES | | NULL | | | mod_content | int(10) unsigned | NO | | NULL | | | uuid | varchar(127) | YES | | NULL | | +--------------+---------------------+------+-----+---------+-------+
Description of mboxgroup[#].mail_item Type
Ref: /source/xref/zimbra-zcs-JUDASPRIEST-860/ZimbraServer/src/java/com/zimbra/cs/mailbox/MailItem.java
75 public abstract class MailItem implements Comparable<MailItem>, ScheduledTaskResult { 76 77 public enum Type { 78 UNKNOWN(-1), 79 /** Item is a standard {@link Folder}. */ 80 FOLDER(1), 81 /** Item is a saved search {@link SearchFolder}. */ 82 SEARCHFOLDER(2), 83 /** Item is a user-created {@link Tag}. */ 84 TAG(3), 85 /** Item is a real, persisted {@link Conversation}. */ 86 CONVERSATION(4), 87 /** Item is a mail {@link Message}. */ 88 MESSAGE(5), 89 /** Item is a {@link Contact}. */ 90 CONTACT(6), 91 /** Item is a {@link InviteMessage} with a {@code text/calendar} MIME part. */ 92 @Deprecated INVITE(7), 93 /** Item is a bare {@link Document}. */ 94 DOCUMENT(8), 95 /** Item is a {@link Note}. */ 96 NOTE(9), 97 /** Item is a memory-only system {@link Flag}. */ 98 FLAG(10), 99 /** Item is a calendar {@link Appointment}. */ 100 APPOINTMENT(11), 101 /** Item is a memory-only, 1-message {@link VirtualConversation}. */ 102 VIRTUAL_CONVERSATION(12), 103 /** Item is a {@link Mountpoint} pointing to a {@link Folder}, possibly in another user's {@link Mailbox}. */ 104 MOUNTPOINT(13), 105 /** Item is a {@link WikiItem} */ 106 @Deprecated WIKI(14), 107 /** Item is a {@link Task} */ 108 TASK(15), 109 /** Item is a {@link Chat} */ 110 CHAT(16), 111 /** Item is a {@link Comment} */ 112 COMMENT(17), 113 /** Item is a {@link Link} pointing to a {@link Document} */ 114 LINK(18); 115
DESCRIBE mboxgroup[#].appointment Database Table
Description of the appointment table in the mboxgroup# database.
$ mysql -e 'DESCRIBE mboxgroup7.appointment' +------------+------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------+------------------+------+-----+---------+-------+ | mailbox_id | int(10) unsigned | NO | PRI | NULL | | | uid | varchar(255) | NO | PRI | NULL | | | item_id | int(10) unsigned | NO | | NULL | | | start_time | datetime | NO | | NULL | | | end_time | datetime | YES | | NULL | | +------------+------------------+------+-----+---------+-------+
Mysql Database Location On Filesystem
mboxgroup# Database Default Example for ZCS5
Using my examples above of the mboxgroup3 .
[zimbra@mail39 data]$ pwd /opt/zimbra/db/data [zimbra@mail39 data]$ ls -F backup/ ib_logfile0 ib_logfile1 ibdata1 mboxgroup1/ mboxgroup2/ mboxgroup3/ mboxgroup4/ mboxgroup5/ mboxgroup6/ mysql/ test/ zimbra/ [zimbra@mail39 data]$ ls mboxgroup3/ appointment.frm data_source_item.ibd imap_folder.ibd mail_item.frm open_conversation.ibd revision.frm tombstone.ibd appointment.ibd db.opt imap_message.frm mail_item.ibd pop3_message.frm revision.ibd data_source_item.frm imap_folder.frm imap_message.ibd open_conversation.frm pop3_message.ibd tombstone.frm
You'll notice there's matching files on the system for the various tables reported with:
$ mysql -e 'SHOW tables FROM mboxgroup3'
zimbra Database Default Example for ZCS5
[zimbra@mail39 data]$ pwd /opt/zimbra/db/data [zimbra@mail39 data]$ ls -F backup/ ib_logfile0 ib_logfile1 ibdata1 mboxgroup1/ mboxgroup2/ mboxgroup3/ mboxgroup4/ mboxgroup5/ mboxgroup6/ mysql/ test/ zimbra/ [zimbra@mail39 data]$ ls zimbra config.frm jiveGroupUser.MYI jiveProperty.MYD jiveSASLAuthorized.frm mucAffiliation.MYD mucRoomProp.frm config.ibd jiveGroupUser.frm jiveProperty.MYI jiveUserProp.MYD mucAffiliation.MYI out_of_office.frm current_volumes.frm jiveID.MYD jiveProperty.frm jiveUserProp.MYI mucAffiliation.frm out_of_office.ibd current_volumes.ibd jiveID.MYI jiveRemoteServerConf.MYD jiveUserProp.frm mucConversationLog.MYD scheduled_task.frm db.opt jiveID.frm jiveRemoteServerConf.MYI jiveVCard.MYD mucConversationLog.MYI scheduled_task.ibd deleted_account.frm jiveOffline.MYD jiveRemoteServerConf.frm jiveVCard.MYI mucConversationLog.frm service_status.MYD deleted_account.ibd jiveOffline.MYI jiveRoster.MYD jiveVCard.frm mucMember.MYD service_status.MYI jiveExtComponentConf.MYD jiveOffline.frm jiveRoster.MYI jiveVersion.MYD mucMember.MYI service_status.frm jiveExtComponentConf.MYI jivePrivacyList.MYD jiveRoster.frm jiveVersion.MYI mucMember.frm table_maintenance.frm jiveExtComponentConf.frm jivePrivacyList.MYI jiveRosterGroups.MYD jiveVersion.frm mucRoom.MYD table_maintenance.ibd jiveGroupProp.MYD jivePrivacyList.frm jiveRosterGroups.MYI mailbox.frm mucRoom.MYI volume.frm jiveGroupProp.MYI jivePrivate.MYD jiveRosterGroups.frm mailbox.ibd mucRoom.frm volume.ibd jiveGroupProp.frm jivePrivate.MYI jiveSASLAuthorized.MYD mailbox_metadata.frm mucRoomProp.MYD jiveGroupUser.MYD jivePrivate.frm jiveSASLAuthorized.MYI mailbox_metadata.ibd mucRoomProp.MYI
You'll notice there's matching files on the system for the various tables reported with :
$ mysql -e 'SHOW tables FROM zimbra'
Getting The Size Of The Mbox Tables In MBs
Here is what you would run.
$ su - zimbra ## Note : I added \'s in the command below so it would format ok in wiki ## $ mysql -e "SELECT table_schema AS 'Mbox table', \ Round( Sum( data_length + index_length ) / 1024 / 1024, 3)\ AS 'Mbox Size (MB)' FROM information_schema.tables \ GROUP BY table_schema ;" +--------------------+----------------+ | Mbox table | Mbox Size (MB) | +--------------------+----------------+ | information_schema | 0.004 | | mboxgroup1 | 0.453 | | mboxgroup2 | 0.453 | | mboxgroup3 | 0.516 | | mboxgroup4 | 0.453 | | mboxgroup5 | 0.453 | | mboxgroup6 | 0.453 | | mysql | 0.520 | | zimbra | 0.319 | +--------------------+----------------+
This was a response from the developers on a question a customer had concerning the sizes of their mboxgroup*ibd files and why they were of varying sizes and if the larger ones could be "shrunk".
- The innodb tablespace can physically grow, but won't shrink. We set innodb_file_per_table to store an idb file per table instead of one large idb file for all tables. If a table has a lot of activity, the idb file will grow. The rows can be deleted but the idb file will still be at the high-water mark. That doesn't mean there isn't a bunch of free space that can be used, just that it will remain large on the filesystem. You can find out the actual size of the space being used by querying the information_schema dictionary view.
- Note - see syntax above that I did. Adam
- SELECT table_schema AS 'Mbox table',
- Round( Sum( data_length + index_length ) / 1024 / 1024, 3) AS Mbox Size (MB)',
- FROM information_schema.tables
- GROUP BY table_schema ;
- Note - see syntax above that I did. Adam
- As you can see, you can include both the data and index lengths, or you could exclude one and run separately to see exactly how large each is. That will get you the actual size which you can compare to the physical size of the idb on disk.If you want to reclaim the disk space by data, I think you are going to have to export the data, drop the table (I don't think a truncate will do it), then import the data again. As far as checking for the percentage of fragmentation, you can't really determine if the difference between physical size and data size is due to many records being deleted or due to fragmentation waste. You can STILL take the same administrative action of rebuilding the tables to help avoid the problem though.
Concerning the dropping of data/tables, see the Mysql_Crash_Recovery on the basic concepts for that. Zimbra Support uses the steps on the Mysql_Crash_Recovery for extreme or DR sitautions, falling back to a full DR recovery process using the zmrestore if the Mysql Crash Recovery steps fail. One should not pursue the Mysql_Crash_Recovery steps unless your willingly to accept the possible need of doing a full DR restore if things don't work out.
To see or understand more about the data in the mboxgroup* mail_item tables, see:
- Ajcody-Mysql-Topics#Mysql_Query_For_ALL_Message_ID.27s_Of_A_User
- Ajcody-Mysql-Topics#Query_All_Users_In_A_mboxgroup.23.23
Also, for future references since 608 is at 5.0.90 - this query might prove useful in regards to the fragmentation question:
Misc Issues Related To Mysql
Error - inconsistent state: unread
You might see a error like the following:
"com.zimbra.common.service.ServiceException: system failure: inconsistent state: unread < 0 for item X" (X is the id of the folder in question.)
Please see the following on the issue and the work around and/or later fix.
- "Add RecalculateMailboxCounts admin command and CLI"
Third Party Tools And References
Recovery Issues
- "InnoDB Recovery Tool" - is a tool to recover corrupted or deleted InnoDB tables
Ajcody Logger Issues
You might want to cross review these other sections as well:
Actual Logger Issues Homepage
Please see Ajcody-Logger-Issues
Logger and ZCS 6.x+
Please see Logger(GnR) , as logger has changed dramatically in 6.x+ as compared to 5.x.
Missing Stats
Are You Using rsyslog, syslog-ng, or syslog
See this forum thread: upgrade to 6.0.2 stats and status no longer working
See the bugs listed below as well.
Confirm All hosts Are Still Present
Follow the instructions at Ajcody-Logger-Issues#What_Tables_And_To_View_Them and confirm all the hosts displayed are still present in your environment. You'll probably also see an error about this in the output from the instructions given at Logger(GnR)#Statistics_show_no_data_available
Logger Not Running
You might want to check /opt/zimbra/log/zmlogswatch.out and see if it mentions a missing file or directory. For example:
tail -f log/zmlogswatch.out Error opening /var/log/zimbra-stats.log: No such file or directory at /opt/zimbra/data/tmp/.swatch_script.21119 line 92
Here's the ownership as that file should be:
ls -la /var/log/zimbra-stats.log -rw-r--r-- 1 zimbra zimbra 2500220 Feb 17 05:37 /var/log/zimbra-stats.log
Logger 6.x Bugs To Review
Some bugs to review:
- "Server statistics fail after logrotate with rsyslogd"
- "Services status: all servers reported as not running/error in web console"
- ""no data available" message after upgrading from 5.0.18 to 6.0.2"
- "48 hour server specific no stats - loading data for chart..."
- "Stats service failing due to folder permissions getting set wrong"
- "zmloggerinit [in zcs5+] for zcs6+"
- "rework logger"
- http://bugzilla.zimbra.com/show_bug.cgi?id=45705
- Dev comments on this bug:
- "Lots of issues have been filed against logger problems. For affected deployments, the current recommendation is to disable the logger until the problems are solved."
- Dev comments on this bug:
- http://bugzilla.zimbra.com/show_bug.cgi?id=45705
sqlite3 and Logger
External Reference: Command Line Shell For SQLite
Login To DB and Quit
How to log into the logger db and to quit:
[zimbra@mail3 data]$ pwd /opt/zimbra/logger/db/data [zimbra@mail3 data]$ sqlite3 logger.sqlitedb SQLite version 3.3.6 Enter ".help" for instructions sqlite> .quit [zimbra@mail3 data]$
What Tables And To View Them
$ pwd /opt/zimbra/logger/db/data $ sqlite3 logger.sqlitedb SQLite version 3.3.6 Enter ".help" for instructions sqlite> .mode list sqlite> .tables config hosts rrd_column_type rrds sqlite> select * from hosts; 1|mail3|mail3.zimbra.REMOVED.com 2|mail3.zimbra.REMOVED.com|mail3.zimbra.REMOVED.com sqlite>.quit $
Delete A Host
This is the command to delete a host, id is the number shown on the left of the line where the hostname is display from "select * from hosts;"
sqlite> DELETE from hosts WHERE id=1;
That would delete the first hostname [id 1] .
Query Of ZCS Service Status History Via zmrrdfetch
Example were done on ZCS 8.0.6 and a single ZCS server setup. First, if you need a converter for unix time see : http://www.epochconverter.com/ . Secondy, note the columns are described below. Some of my examples will not include this first row. :
timestamp,opendkim,zmconfigd,mailbox,proxy,spell,logger,antivirus,archiving,snmp,ldap,memcached,convertd,stats,antispam,mta
The below example checks to see when the archiving service was reported as up. Archiving is the 9th column.
/opt/zimbra/libexec/zmrrdfetch -f zmstatuslog -h zcs806.us.DOMAIN.com -s 1388534400 -e 1405618603 | awk -F, '$9 == 1' [cut] 1405454400,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 1405458000,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 1405461600,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 1405465200,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 1405468800,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 1405472400,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 1405476000,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 1405479600,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 [cut]
The below example checks to see when the archiving service was reported as unavailable 100%. Archiving is the 9th column. [zimbra@zcs806 data]$ /opt/zimbra/libexec/zmrrdfetch -f zmstatuslog -h zcs806.us.DOMAIN.com -s 1388534400 -e 1405618603 | awk -F, '$9 == ""'
1405069200,1,1,1,1,1,1,1,,1,1,1,1,1,1,1 1405072800,1,1,1,1,1,1,1,,1,1,1,1,1,1,1 1405076400,1,0.964354991388889,1,1,1,1,1,,1,1,1,1,1,1,1 1405080000,1,0.946143796944445,1,1,1,1,1,,1,1,1,1,1,1,1 1405083600,1,1,1,1,1,1,1,,1,1,1,1,1,1,1 1405087200,1,1,1,1,1,1,1,,1,1,1,1,1,1,1 1405090800,1,1,1,1,1,1,1,,1,1,1,1,1,1,1 1405094400,1,1,1,1,1,1,1,,1,1,1,1,1,1,1 1405098000,1,1,1,1,1,1,1,,1,1,1,1,1,1,1 1405101600,1,1,1,1,1,1,1,,1,1,1,1,1,1,1 1405105200,1,0.987032061666667,1,1,1,1,1,,1,1,1,1,1,1,1 1405108800,1,1,1,1,1,1,1,,1,1,1,1,1,1,1 1405112400,1,1,1,1,1,1,1,,1,1,1,1,1,1,1 1405116000,1,0.982143184166667,1,1,1,1,1,,1,1,1,1,1,1,1 1405119600,1,1,1,1,1,1,1,,1,1,1,1,1,1,1 1405123200,1,1,1,1,1,1,1,,1,1,1,1,1,1,1 1405126800,1,1,1,1,1,1,1,,1,1,1,1,1,1,1 1405130400,1,0.967078515555556,1,1,1,1,1,,1,1,1,1,1,1,1 1405134000,1,1,1,1,1,1,1,,1,1,1,1,1,1,1 1405137600,1,1,1,1,1,1,1,,1,1,1,1,1,1,1 1405141200,1,0.920520648333333,1,1,1,1,1,,1,1,1,1,1,1,1 1405144800,1,0.9539186725,1,1,1,1,1,,1,1,1,1,1,1,1 1405148400,1,0.981826185277778,1,1,1,1,1,,1,1,1,1,1,1,1 1405152000,1,1,1,1,1,1,1,,1,1,1,1,1,1,1 1405155600,1,1,1,1,1,1,1,,1,1,1,1,1,1,1 1405159200,1,1,1,1,1,1,1,,1,1,1,1,1,1,1 1405162800,1,0.996330343333333,1,1,1,1,1,,1,1,1,1,1,1,1 1405166400,1,1,1,1,1,1,1,,1,1,1,1,1,1,1 1405170000,1,1,1,1,1,1,1,,1,1,1,1,1,1,1 1405173600,1,1,1,1,1,1,1,,1,1,1,1,1,1,1 1405177200,1,1,1,1,1,1,1,,1,1,1,1,1,1,1 [cut]
The below example checks to see when the mailbox service was reported as NOT available 100% or the time but was NOT 100% unavailable either. Mailbox is the 3rd column.
[zimbra@zcs806 data]$ /opt/zimbra/libexec/zmrrdfetch -f zmstatuslog -h zcs806.us.DOMAIN.com -s 1388534400 -e 1405618603 | awk -F, '$3 ~ 0' [cut] 1405076400,1,0.964354991388889,1,1,1,1,1,,1,1,1,1,1,1,1 1405080000,1,0.946143796944445,1,1,1,1,1,,1,1,1,1,1,1,1 1405105200,1,0.987032061666667,1,1,1,1,1,,1,1,1,1,1,1,1 1405116000,1,0.982143184166667,1,1,1,1,1,,1,1,1,1,1,1,1 1405130400,1,0.967078515555556,1,1,1,1,1,,1,1,1,1,1,1,1 1405141200,1,0.920520648333333,1,1,1,1,1,,1,1,1,1,1,1,1 1405144800,1,0.9539186725,1,1,1,1,1,,1,1,1,1,1,1,1 1405148400,1,0.981826185277778,1,1,1,1,1,,1,1,1,1,1,1,1 1405162800,1,0.996330343333333,1,1,1,1,1,,1,1,1,1,1,1,1 [cut]
An example of a zmcontrol restart and what zmrrdfetch will show. Note I adjusted the ending flag to be : -e `date +%s --date="1 minute ago" : as compared to the above examples :
[zimbra@zcs806 data]$ /opt/zimbra/libexec/zmrrdfetch -f zmstatuslog -h zcs806.us.DOMAIN.com -s `date +%s --date="15 minute ago"` -e `date +%s --date="1 minute ago"` timestamp,opendkim,zmconfigd,mailbox,proxy,spell,logger,antivirus,archiving,snmp,ldap,memcached,convertd,stats,antispam,mta 1405621920,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 1405621950,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 1405621980,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 1405622010,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 1405622040,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 1405622070,0.105026416666667,0.1050323,1,1,0.105029991666667,1,0.105016,0.105017466666667,0.105028733333333,1,1,1,0.10503115,0.105014483333333,0.105025008333333 1405622100,0.105026416666667,0.1050323,1,1,0.105029991666667,1,0.105016,0.105017466666667,0.105028733333333,1,1,1,0.10503115,0.105014483333333,0.105025008333333 1405622130,0.105026416666667,0.1050323,1,1,0.105029991666667,1,0.105016,0.105017466666667,0.105028733333333,1,1,1,0.10503115,0.105014483333333,0.105025008333333 1405622160,0.105026416666667,0.1050323,1,1,0.105029991666667,1,0.105016,0.105017466666667,0.105028733333333,1,1,1,0.10503115,0.105014483333333,0.105025008333333 1405622190,,0,,,,,,,,,,,,, 1405622220,,0,,,,,,,,,,,,, 1405622250,,0,,,,,,,,,,,,, 1405622280,,0,,,,,,,,,,,,, 1405622310,,0,,,,,,,,,,,,, 1405622340,,0.893621444444444,,,,,,,,,,,,, 1405622370,,0.893621444444444,,,,,,,,,,,,, 1405622400,,0.893621444444444,,,,,,,,,,,,, 1405622430,,1,,,,,,,,,,,,, 1405622460,,1,,,,,,,,,,,,, 1405622490,,1,,,,,,,,,,,,, 1405622520,,1,,,,,,,,,,,,, 1405622550,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 1405622580,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
Logger Related Bugs
5.0.11 - Fixed in 5.0.12 But See Below Before Upgrading
UPDATE: From release notes: kill all zmlogger processes before upgrading to 5.0.12 from 5.0.10+
- "zmlogger fails to terminate at zmcontrol stop"
- Which generally is causing a whole host of problems. Shows up in 5.0.11 release
- http://bugzilla.zimbra.com/show_bug.cgi?id=33730 dup of below
- Please get the script (attachment) within this bug that updates the control script.
- http://bugzilla.zimbra.com/show_bug.cgi?id=33604
Steps To Resolve
- Edit /opt/zimbra/conf/my.logger.cnf, and modify this line for 20 connections.
- max_connections = 20
- Review the following bug and download the zmlogswatchctl script listed in the attachments section.
- Shutdown logger.
-
zmloggerctl stop
- find any orphaned logger or swatch processes, and kill them
-
ps -ef | grep logg
-
ps -ef | grep watch
-
- Replace the logswatch control file
-
mv /opt/zimbra/bin/zmlogswatchctl /opt/zimbra/bin/original.zmlogswatchctl
-
- Add the new zmlogswatchctl file from the above bug to /opt/zimbra/bin
- as root
chown root:root /opt/zimbra/bin/zmlogswatchctl
- as root
chmod 755 /opt/zimbra/bin/zmlogswatchctl
- as root
-
- Start up the logger process.
-
zmloggerctl start
-
You can be checking the output in the following as well to see if any errors are still being reported:
- /tmp/logprocess.out
- /tmp/gengraphs.out
- /opt/zimbra/logger/db/data/<hostname>.err
Logger Table Check And Repair
Other items to check:
Also, check the logger tables to see if any of the tables need to be repaired
logmysql -e "check table zimbra_logger.amavis" logmysql -e "check table zimbra_logger.amavis_aggregate" logmysql -e "check table zimbra_logger.config" logmysql -e "check table zimbra_logger.disk_aggregate" logmysql -e "check table zimbra_logger.disk_status" logmysql -e "check table zimbra_logger.mta" logmysql -e "check table zimbra_logger.mta_aggregate" logmysql -e "check table zimbra_logger.processing_history" logmysql -e "check table zimbra_logger.raw_logs" logmysql -e "check table zimbra_logger.service_status"
If any of the tables need to be repaired, you replace 'check' with 'repair'. Example:
logmysql -e "repair table zimbra_logger.amavis"
/tmp/logprocess.out Shows MySQL Can't Connect
Please follow these instructions:
Logger Not Working , No Stats, Services Show Not Running In Admin Console
ZCS 6 And Above
On The Logger Host Server
On the Logger monitor host [zmprov gacf |grep zimbraLogHostname] start with the following. Note: run below steps in non-peak hours.
su - zimbra zmcontrol stop ; exit
Run as root user:
/opt/zimbra/libexec/zmfixperms -e -v
On the logger monitor host, you must enable syslog [if your running rsyslog, see below] to log statistics from remote machines. Run the following as root also :
- Edit the /etc/sysconfig/syslog file, add -r to the SYSLOGD_OPTIONS setting, SYSLOGD_options=”-r -m 0”
- Run : /opt/zimbra/libexec/zmsyslogsetup
- Stop the syslog daemon. Type : /etc/init.d/syslogd restart
- Or by: service syslog restart
- Use stop / start if restart isn't available.
If you are using rsyslog instead of syslog, then you will need the following changes in rsyslog config. First, enable the module for remote logging on the logger host. Edit the rsyslog config file "/etc/rsyslog.conf" and enable "imudp" module by uncommenting the same:
$ModLoad imudp $UDPServerRun 514
After the above changes to the following if you are running rsyslog: restart rsyslog service.
- Run : /opt/zimbra/libexec/zmsyslogsetup
- Restart rsyslog with : /etc/init.d/rsyslog restart
- Or by: service rsyslog restart
- Use stop / start if restart isn't available.
Your last steps are to then run:
su - zimbra zmcontrol start /opt/zimbra/libexec/zmloggerinit /opt/zimbra/bin/zmsshkeygen /opt/zimbra/bin/zmupdateauthkeys
On The Other Servers
On all other servers (if you have multiple zimbra servers in your setup). Verify the LogHostname (it should be set to name of Logger monitor Host on all servers) if its different, change the same to Logger monitor Host using below command.
su - zimbra zmprov gacf |grep zimbraLogHostname
If it is set wrong, you can correct it by doing:
zmprov mcf zimbraLogHostname <Logger monitor Hostname>
Then run the following after the zimbraLogHostname variable is confirmed or set correctly:
/opt/zimbra/bin/zmsshkeygen /opt/zimbra/bin/zmupdateauthkeys ; exit /opt/zimbra/libexec/zmsyslogsetup (run as root user) Restart either syslogd or rsyslog, depending on what your server is using service syslog restart or service rsyslog restart su - zimbra zmcontrol restart
Reference Link:
- http://www.zimbra.com/docs/ne/latest/administration_guide/wwhelp/wwhimpl/js/html/wwhelp.htm (Pleaserefer Chapter 15: Monitoring ZCS Servers)
This Section Written For ZCS5
Check the following log files first to gather some information:
- Make sure the /etc/hosts details make the actual hostname and the zmhostname output
- If someone recently changed the hostname variables for this box, logger can be effected if done improperly and will not log the obvious issue.
- /tmp/logprocess.out
- /tmp/gengraphs.out
- /opt/zimbra/logger/db/data/<hostname>.err
- /var/log/zimbra.log (logswatch monitors this file)
- grep'ing for things such as:
egrep 'postfix|amavis|STATUS|DISK|QUEUE' /var/log/zimbra.log
- grep'ing for things such as:
- You might also want to look at the following directory:
- /opt/zimbra/logger/db/work/
- You should see data in here, gif and rrd files.
Then proceed with the following wiki pages, as ordered:
- Logger
- If you find that tables are in need of repair, also consult the following wiki:
- If all else fails, you can clear the old logger database and reinitalize it. Please see:
Large Logger Database Killing Performance Of ZCS
Review the following to see what might be best option for you:
- King0770-Notes#Logger_Issues_-_Improve_Disk_Utilization_for_the_logger_service
- Adjusting the [ zimbraLogRawLifetime: 31d ] & [ zimbraLogSummaryLifetime: 730d ] variables.
- Ajcody-Logger-Issues#Reinitializing_Logger_Database_From_Scratch
Reinitializing Logger Database From Scratch
This will effectively blow away your old logger database, allowing you to start over.
zmloggerctl stop cd /opt/zimbra/logger/db
Remove the old database:
mv db db-old
or data , if db doesn't exist
mv data data-old
You can remove (rm -rf db or data) the directory if your not worried about old directory being perserved
Reinitialize a new logger database:
/opt/zimbra/libexec/zmloggerinit
Logger is probably running after this, but to make sure
zmloggerctl start
You'll need to manually start this one though
zmlogswatchctl start
You'll have to allow some time to pass for there to be enough data for the graphs to be built in the web interface.
Turning Off Logger
To not have logger startup [ use `hostname` or type in hostname] :
zmprov ms `hostname` -zimbraServiceEnabled logger
To manually shutdown logger
zmloggerctl stop
Customization Or Modification Of Swatch Config
The swatch config file is :
/opt/zimbra/conf/swatchrc.in
If you make a customization, you'll need to do the following for it to take effect:
zmsnmpinit zmlogswatchctl stop zmlogswatchctl start zmswatchctl stop zmswatchctl start
Lucene
Actual Lucene Topics Homepage
Please see Ajcody-Lucene-Topics
Other References to Lucene Index
Please see:
Some General Questions On The Lucene Indexing
Index Directory Numbering
We know the directory under the index volume path is like the following:
- /opt/zimbra/index/ "X" / "Y" / index / "Z" /
We believe that "X" is the number which is determined by bitshifting the mailbox_id to the right by 12 bits. That the "Y" is the maibox_id of the user. However, how do you get "Z"?
- Answer: It's always '0'.
When Is User Message Store Directory Created
When is the directory for the message data for an account (/opt/zimbra/store/0/...) created? When a message is stored for the first time? Which would also mean, that it would not be created if message data does not exist, correct?
- Answer: Yes.
When Is User Index Directory And Index Files Created
Concerning the index directory. We know the index directory already exists even when mail data does not exist [see question above]. When will the index directory be created? With the account's first login?
- Answer: The directory is created with user creation. The index files that will exist in the user's directory are created with the first indexing or search event.
Example Walk Through
On my 5.0.24 test box.
Create a test account:
[zimbra@mail37 ~]$ zmprov gmi index-test@`zmhostname` mailboxId: 6 quotaUsed: 0
Notice that the 'store' directory ISN'T automatically created for the user upon user creation :
[zimbra@mail37 ~]$ ls -latr /opt/zimbra/store/0 total 20 drwxr-x--- 3 zimbra zimbra 4096 Sep 13 14:57 1 drwxr-xr-x 4 zimbra zimbra 4096 Sep 13 14:57 .. drwxr-x--- 3 zimbra zimbra 4096 Sep 13 14:57 2 drwxr-x--- 3 zimbra zimbra 4096 Sep 13 15:05 3 drwxr-x--- 5 zimbra zimbra 4096 Sep 13 15:05 .
Notice that the 'index' directory IS automatically created for the user upon user creation but the actual indexing files are not :
[zimbra@mail37 ~]$ ls -latr /opt/zimbra/index/0/6/index/0/ total 8 drwxr-x--- 3 zimbra zimbra 4096 Oct 21 12:11 .. drwxr-x--- 2 zimbra zimbra 4096 Oct 21 12:11 .
Let's see what changes when the user is sent and email BUT they still have not logged in yet:
[zimbra@mail37 ~]$ mail index-test@`zmhostname` tSubject:test from localhost test . Cc:
Checking the relevant user directory for changes. Notice we now have a 6 directory, matching the users mailboxId. We don't see any index files though under their index directory:
[zimbra@mail37 ~]$ ls -latr /opt/zimbra/store/0/ mailboxId: 6 quotaUsed: 1563 total 24 drwxr-x--- 3 zimbra zimbra 4096 Sep 13 14:57 1 drwxr-xr-x 4 zimbra zimbra 4096 Sep 13 14:57 .. drwxr-x--- 3 zimbra zimbra 4096 Sep 13 14:57 2 drwxr-x--- 3 zimbra zimbra 4096 Sep 13 15:05 3 drwxr-x--- 3 zimbra zimbra 4096 Oct 21 12:13 6 drwxr-x--- 6 zimbra zimbra 4096 Oct 21 12:13 . [zimbra@mail37 ~]$ ls -latr /opt/zimbra/index/0/6/index/0/ total 8 drwxr-x--- 3 zimbra zimbra 4096 Oct 21 12:11 .. drwxr-x--- 2 zimbra zimbra 4096 Oct 21 12:11 .
Let's see if logging into the webclient as the user changes anything. Log into the webclient and then check the user directories again. Still no change, no index files created.
[zimbra@mail37 ~]$ ls -latr /opt/zimbra/store/0/ mailboxId: 6 quotaUsed: 1563 total 24 drwxr-x--- 3 zimbra zimbra 4096 Sep 13 14:57 1 drwxr-xr-x 4 zimbra zimbra 4096 Sep 13 14:57 .. drwxr-x--- 3 zimbra zimbra 4096 Sep 13 14:57 2 drwxr-x--- 3 zimbra zimbra 4096 Sep 13 15:05 3 drwxr-x--- 3 zimbra zimbra 4096 Oct 21 12:13 6 drwxr-x--- 6 zimbra zimbra 4096 Oct 21 12:13 . [zimbra@mail37 ~]$ ls -latr /opt/zimbra/index/0/6/index/0/ total 8 drwxr-x--- 3 zimbra zimbra 4096 Oct 21 12:11 .. drwxr-x--- 2 zimbra zimbra 4096 Oct 21 12:11 .
Let's do a manual index of the user account and confirm index files are made.
[zimbra@mail37 ~]$ zmprov rim index-test@`zmhostname` start status: started [zimbra@mail37 ~]$ ls -latr /opt/zimbra/index/0/6/index/0/ total 20 drwxr-x--- 3 zimbra zimbra 4096 Oct 21 12:11 .. -rw-r----- 1 zimbra zimbra 45 Oct 21 12:15 segments_2 -rw-r----- 1 zimbra zimbra 20 Oct 21 12:15 segments.gen -rw-r----- 1 zimbra zimbra 2455 Oct 21 12:15 _0.cfs drwxr-x--- 2 zimbra zimbra 4096 Oct 21 12:15 .
So far, we've confirm user creation doesn't create the store directory until a message or something similar is processed. That the users index directory path will be created with user creation but the index files will not be. That the index files aren't created when the user first logs in but are created with a manual index [zmprov rim user@domain].
Let's confirm if a 'search' creates the index files. First, I'll remove the existing index files that were made. Then log into the webclient as the user and do an email search. Confirming after words that the index files were made from that search - which it does.
[zimbra@mail37 ~]$ cd /opt/zimbra/index/0/6/index/0/ [zimbra@mail37 0]$ ls _0.cfs segments.gen segments_2 [zimbra@mail37 0]$ rm -rf * [zimbra@mail37 0]$ ls
Perform webclient search and check index directory again.
[zimbra@mail37 0]$ ls segments.gen segments_1
Delete Flag
Does lucene create delete flag when index is deleted?
- Answer: Yes.
Delete Flag Operational Details
If so, we believe that it creates only delete flag, and files having an actual index (such as segment file) will be deleted (reuse of disk space) only when segment is merged, or any function for optimization is called, is this correct?
- Answer: Yes.
- Update
- See also this bug/rfe:
- "Index data needs to reclaim disk space after deletes"
- http://bugzilla.zimbra.com/show_bug.cgi?id=54969
- See also this bug/rfe:
Is It The Same For zmmailboxmove With purgeOld
The above behavior is the same when executing zmmailboxmove with purgeOld?
- Answer: No, it physically deletes the entire files.
Cleaning Up Or Shrinking Index For Users
From the ZCS 8 Release Notes:
- "large mail volume DOS's lucene"
- http://bugzilla.zimbra.com/show_bug.cgi?id=76414
- Index data for mailboxes is never deleted so a mailbox index can become very large over time and might be consuming excess disk space because of the large index data. In 8.0, a new zmprov CLI, compactIndexMailbox (cim) was created to compact index data. This command can be used to reclaim disk space when the index volume starts to become full. To compact a mailbox’s index, type:
- zmprov cim <name@domain|id> start
- Note - Depending on the size of the mailbox and the number of deletes this might take awhile. This might require additional free space on the index directory.
- You can run this command concurrently. It is recommended to run this command during off peak hours. You cannot cancel the command once it is started.
- To see the status of index compaction on a mailbox, type:
- zmprov getIndexStats <name@domain|id>
- http://bugzilla.zimbra.com/show_bug.cgi?id=76414
- "Sorting by recipient does not appear to work correctly"
- http://bugzilla.zimbra.com/show_bug.cgi?id=74521
- Customers currently on ZCS 7.x upgrading to latest version of ZCS will require full re-indexing mailboxes for sort-by recipients feature to work properly. Without full re-indexing the mailbox, sorting by "To" field in the "Sent" folder message view will skip all the mess ages from the sorted results added before the upgrade. Note: re-indexing mailbox is an expensive operation and if this feature is NOT so required then, its NOT recommended to do mailbox re-indexing.
- http://bugzilla.zimbra.com/show_bug.cgi?id=74521
Manually Deleting Lucene Index Directories
Please see King0770-Notes#Manually_Delete_Index_Directories
Performance Tuning
Please see Performance_Tuning_Guidelines_for_Large_Deployments#Lucene_Index
Some smaller notes:
- Upgrade to 6.0.8:
- See Bug 47890
- http://bugzilla.zimbra.com/show_bug.cgi?id=47890
- Search in soap SendMsg dosen't scale
- FIXED: 6.0.8 or 6.0.9
- See Bug 47890
- These last 2 will decrease Indexing overhead, but obviously with a loss of functionality
- set zimbraPrefAutoAddAddressEnabled to FALSE
- set zimbraAttachmentsIndexingEnabled to FALSE
Ajcody Notes Archive Discovery
Actual Archive & Discovery Notes Homepage
Ajcody-Notes-Archive-Discovery
References for A&D
Updated A&D Documentation In Admin Manual
Please see:
Zimbra ZSC Version 8.x
The version 7.x manual is more comprehensive. Version 8 Documentation is missing a lot of content available in Version 7 documentation.
Zimbra ZSC Version 7.x
Older Notes About ZAD
Important Note:
I think we need to clean up the documentation that refers to this "download" as no longer being necessary as it's bundled in the zcs-network edition tar ball now. I found an old email to the development team where I inquired about this - I didn't get a response from on it at the time.
If this assumption is true [Like I see with the 5.x setups I've helped with] then I think we need to adjust the documents for 4.5.x stuff to state:
- You'll need to download your version of 4.5.x zcs network edition tarball, untar it, and then run the install script . Which effectively will allow you to now select the "archive" package which will also include the search zimlet [zmbxsearch].
The two main A&D references are :
http://wiki.zimbra.com/index.php?title=ZAD
http://www.zimbra.com/pdf/Zimbra%20Archiving%20and%20Discovery%20Release%20Notes.pdf
But I Just Want Some BCC's To Happen - Not All This A&D Stuff
Please see Ajcody-MTA-Postfix-Topics#Automatic_BCC instead then.
But We Have A Non-Zimbra MTA - zimbraSmtpHostname & zimbraMtaRelayHost Pointed To External Device
Please see this RFE I made:
- "RFE: Ability to handle A&D when another MTA systems is being specified"
- http://bugzilla.zimbra.com/show_bug.cgi?id=45198
- Private note on this rfe explains the 'problem':
- "This feature requires the use of our MTA because amavis needs to process the message."
- Private note on this rfe explains the 'problem':
- http://bugzilla.zimbra.com/show_bug.cgi?id=45198
Notable Bugs Or RFE's
Update Jan 22, 2015 . I filed these while testing against ZCS 8.6 .
- "amavis needs to be a service if archiving is enabled"
- "Archiving To Get It's Own Specific Reporting And Monitoring Section - Also, Confirmation On Upgrades"
- "zmarchivesearch should accept -m "*" or multiple mailbox targets like zmmboxsearch does"
- "admin console mailbox search doesn't autocomplete/suggest for target mailbox account for search results"
- "crossmailbox / mailbox search in admin console limits still broken and documentation descriptions are poor"
- "zmmboxsearch zmarchivesearch -p switch does accept the * [unlimited] variable. Document and qa for each release."
- "zmmboxsearch zmarchivesearch -l does have a hard limit still - it's 1000"
- "zmmboxsearch and zmarchivesearch -p and -l options makes no sense, they need to be rewritten"
Older Bug/RFE's I've noted:
- "Need ability to restrict zmmboxsearch to specific domains"
- "Populate archive accounts from parent account"
- "automatic archive submail box creation by month"
- "Other collaboration data (IM, Docs, Calendars) need to be archived"
- "Archiving/Compliance: Detailed audit trail for all access/update to user archives"
- "Archiving/Compliance: COS-based user selection for archiving"
Archive Stop Working After Upgrade Or Disabling Anti-Spam - Anti-Virus
Prior to JP/8.5 , the archiving feature required the anti-spam or anti-virus service to be enabled. If you disabled both of them, then amavis as a whole was disabled. This is required for archiving to work. The following bug resolves this for JP/8.5 - it makes amavis its own service:
- "It should be possible to remove Amavis as a service"
Also note, my testing on ZCS 8.0.7 did confirm that disabling av/as [therefore, amavis] will cause archiving to not work. This is very confusing since zmcontrol status AND the admin console will show that the service for "archiving" is running - though archiving is not actually working since amavis is disabled.
Update Jan 22, 2015. New bug filed to deal with other upgrade issues we discovered.
- "amavis needs to be a service if archiving is enabled"
First - Short & Sweet How-To On CLI With Single ZCS 8.6 Server
In this example, I'll turn off the antivirus and antispam service in 8.6 and then enable amavis and archiving. Create an archive cos and then archive user. This was a single ZCS 8.6 server with all services installed during the installation - just using default values. This was NOT an upgrade to ZCS 8.6 .
[zimbra@ldap2 ~]$ zmcontrol -v Release 8.6.0_GA_1153.RHEL6_64_20141215151258 RHEL6_64 NETWORK edition. [zimbra@ldap2 ~]$ zmprov gs `zmhostname` | grep Service | egrep 'amavis|antivirus|antispam|archiving' zimbraServiceEnabled: amavis zimbraServiceEnabled: antivirus zimbraServiceEnabled: antispam zimbraServiceEnabled: archiving zimbraServiceInstalled: amavis zimbraServiceInstalled: antivirus zimbraServiceInstalled: antispam zimbraServiceInstalled: archiving [zimbra@ldap2 ~]$ zmprov ms `zmhostname` +zimbraServiceInstalled archiving +zimbraServiceEnabled archiving [zimbra@ldap2 ~]$ zmprov ms `zmhostname` -zimbraServiceEnabled antispam -zimbraServiceEnabled antivirus [zimbra@ldap2 ~]$ zmprov gs `zmhostname` | grep Service | egrep 'amavis|antivirus|antispam|archiving' zimbraServiceEnabled: amavis zimbraServiceEnabled: archiving zimbraServiceInstalled: amavis zimbraServiceInstalled: antivirus zimbraServiceInstalled: antispam zimbraServiceInstalled: archiving !! Note - zmmtactl restart didn't cause the amavisd.conf file to change, hence why I then went with zmcontrol restart. [zimbra@ldap2 ~]$ zmcontrol restart [zimbra@ldap2 ~]$ grep archive_quar /opt/zimbra/conf/amavisd.conf archive_quarantine_method => undef, # Don't run archiving a second time $archive_quarantine_method = 'smtp:[127.0.0.1]:10025'; $archive_quarantine_to = undef; [zimbra@ldap2 ~]$ zmprov cc archive 71f9d7f4-54cc-4bf3-a6e1-94a1fc38a129 [zimbra@ldap2 ~]$ zmarchiveconfig enable user1@`zmhostname` archive-cos archive [zimbra@ldap2 ~]$ vi /tmp/email.txt [zimbra@ldap2 attrs]$ cat /tmp/email.txt To: user1@ldap2.zimbra.DOMAIN.com Subject: Test For Archive - CLI From: admin@ldap2.zimbra.DOMAIN.com test [zimbra@ldap2 ~]$ /opt/zimbra/postfix/sbin/sendmail -t < /tmp/email.txt [zimbra@ldap2 ~]$ grep archive /var/log/zimbra.log Jan 15 16:09:43 ldap2 amavis[29283]: (29283-01) h9nw0WdCl1Tw(h9nw0WdCl1Tw) SEND from <> -> <user1-20150115@ldap2.zimbra.DOMAIN.com.archive>, ENVID=AM.h9nw0WdCl1Tw.20150115T210943Z@ldap2.zimbra.DOMAIN.com BODY=7BIT 250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 2DE506445C Jan 15 16:09:43 ldap2 amavis[29283]: (29283-01) Passed CLEAN {RelayedInbound,Archived}, <zimbra@ldap2.zimbra.DOMAIN.com> -> <user1@ldap2.zimbra.DOMAIN.com>, quarantine: user1-20150115@ldap2.zimbra.DOMAIN.com.archive, Message-ID: <20150115210943.087106438E@ldap2.zimbra.DOMAIN.com>, mail_id: h9nw0WdCl1Tw, Hits: -, size: 351, queued_as: 3049C64466, 138 ms Jan 15 16:09:45 ldap2 postfix/lmtp[3478]: 2DE506445C: to=<user1-20150115@ldap2.zimbra.DOMAIN.com.archive>, relay=ldap2.zimbra.homeunix.com[192.168.1.172]:7025, delay=2.2, delays=0/0.02/0.17/2, dsn=2.1.5, status=sent (250 2.1.5 Delivery OK)
When Was A ZCS Service Enabled Or Disabled
Note - single ZCS server deployment example. Have to double check on multi-server deployment if the command needs to be tweaked.
Check Current Status Of Services Enabled-Disable and Installed-NotInstalled
Example is done on the host in question:
zmprov -l gs `zmhostname` | egrep 'zimbraServiceEnabled|zimbraServiceInstall'
The -l is used in case mailboxd is the service in question, -l makes the call to ldap to check the configuration of the server.
Check Backups And What LDAP Has Stored
Do the following, adjust the backup path if your not using the default path:
for i in `find /opt/zimbra/backup/sessions/ -name ldap.bak.gz -print`; \ do echo $i; zgrep zimbraServiceEnabled $i; done
Will show you something like :
zimbraServiceEnabled: antivirus zimbraServiceEnabled: antispam zimbraServiceEnabled: opendkim zimbraServiceEnabled: logger zimbraServiceEnabled: mailbox zimbraServiceEnabled: mta zimbraServiceEnabled: convertd zimbraServiceEnabled: stats zimbraServiceEnabled: snmp zimbraServiceEnabled: ldap zimbraServiceEnabled: spell zimbraServiceEnabled: archiving
Check The History Of The Service Status In zimbra-stats.log
In /var/log/ you'll see zimbra-stats.log and archives of that file, for example - zimbra-stats.log-20140714 . Here's an example of a zgrep for the archive service:
[zimbra@zcs807 log]$ zgrep archiv zimbra-stats* | tail zimbra-stats.log:Jul 22 08:24:08 zcs807 zimbramon[27645]: 27645:info: 2014-07-22 08:24:01, STATUS: zcs807.us.zimbralab.com: archiving: Running zimbra-stats.log:Jul 22 08:26:09 zcs807 zimbramon[28689]: 28689:info: 2014-07-22 08:26:01, STATUS: zcs807.us.zimbralab.com: archiving: Running zimbra-stats.log-20140714:Jul 15 14:40:19 zcs807 zimbramon[21519]: 21519:info: 2014-07-15 14:40:01, STATUS: zcs807.us.zimbralab.com: archiving: Stopped zimbra-stats.log-20140714:Jul 15 14:42:06 zcs807 zimbramon[24998]: 24998:info: 2014-07-15 14:42:01, STATUS: zcs807.us.zimbralab.com: archiving: Stopped zimbra-stats.log-20140714:Jul 15 14:44:09 zcs807 zimbramon[29250]: 29250:info: 2014-07-15 14:44:01, STATUS: zcs807.us.zimbralab.com: archiving: Running zimbra-stats.log-20140714:Jul 15 14:46:08 zcs807 zimbramon[32188]: 32188:info: 2014-07-15 14:46:01, STATUS: zcs807.us.zimbralab.com: archiving: Running zimbra-stats.log-20140714:Jul 15 14:48:26 zcs807 zimbramon[3174]: 3174:info: 2014-07-15 14:48:07, STATUS: zcs807.us.zimbralab.com: archiving: Running zimbra-stats.log-20140714:Jul 15 14:50:15 zcs807 zimbramon[6466]: 6466:info: 2014-07-15 14:50:01, STATUS: zcs807.us.zimbralab.com: archiving: Running zimbra-stats.log-20140714:Jul 15 14:52:10 zcs807 zimbramon[10260]: 10260:info: 2014-07-15 14:52:02, STATUS: zcs807.us.zimbralab.com: archiving: Running zimbra-stats.log-20140714:Jul 15 14:54:10 zcs807 zimbramon[19004]: 19004:info: 2014-07-15 14:54:01, STATUS: zcs807.us.zimbralab.com: archiving: Running
Check The Logger/RRD Data And Service History Uptime
Let's pull the stats from the logger database going back to Jan 1st of this year. Here's an example on how to do that and what to expect. Please send me a copy of the output also. Notice in the example below the lines that have ",," for column 9 - which is for archiving. This is how I can tell when the service was first enabled and running. Ref for timestamp: http://www.epochconverter.com/
Note: The columns are identified by:
timestamp,opendkim,zmconfigd,mailbox,proxy,spell,logger,antivirus,archiving,snmp,ldap,memcached, convertd,stats,antispam,mta
Please adjust the commands below to suit your needs. I use `zmhostname` below in the command rather than typing out the localhosts hostname. Also, see https://www.gnu.org/software/coreutils/manual/html_node/Examples-of-date.html for examples on the --date string.
For this example, I'm looking to see when the "archiving" service was running 100%. Archiving is the 9th column - '$9 == 1' and the 1 means it was available 100% for the time period. I searched a year's worth of data by using this part below in the examples : "-s `date +%s --date="12 month ago"` -e `date +%s --date="1 minute ago"`"
/opt/zimbra/libexec/zmrrdfetch -f zmstatuslog -h `zmhostname` -s `date +%s \ --date="12 month ago"` -e `date +%s --date="1 minute ago"` | awk -F, '$9 == 1' timestamp,opendkim,zmconfigd,mailbox,proxy,spell,logger,antivirus,archiving,snmp,ldap,memcached, convertd,stats,antispam,mta [cut] 1405454400,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 1405458000,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 1405461600,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 1405465200,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 1405468800,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 1405472400,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 1405476000,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 1405479600,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 [cut]
For this example, I'm looking to see when the "archiving" service was NOT enabled or running at all. Archiving is the 9th column - '$9 == ""' and the absence of a number value means it was UNAVAILABLE 100% for the time period.
/opt/zimbra/libexec/zmrrdfetch -f zmstatuslog -h `zmhostname` -s `date +%s \ --date="12 month ago"` -e `date +%s --date="1 minute ago"` | awk -F, '$9 == ""' | head timestamp,opendkim,zmconfigd,mailbox,proxy,spell,logger,antivirus,archiving,snmp,ldap,memcached, convertd,stats,antispam,mta [cut] 1388538000,,,,,,,,,,,,,,, 1388541600,,,,,,,,,,,,,,, 1388545200,,,,,,,,,,,,,,, 1388548800,,,,,,,,,,,,,,, 1388552400,,,,,,,,,,,,,,, 1388556000,,,,,,,,,,,,,,, 1388559600,,,,,,,,,,,,,,, 1388563200,,,,,,,,,,,,,,, 1388566800,,,,,,,,,,,,,,, 1388570400,,,,,,,,,,,,,,, [cut]
For this example, I'm looking to see when the "zmconfigd" service was NOT 100% available during the time period BUT was greater than 0% of the time. Zmconfigd is the 3rd column - '$3 ~ 0' and by using ~ [NOT] 0 , I can see when it was greater than 0 [100% UNAVAILABLE] but not 1 [100% available].
/opt/zimbra/libexec/zmrrdfetch -f zmstatuslog -h `zmhostname` -s `date +%s \ --date="12 month ago"` -e `date +%s --date="1 minute ago"` | awk -F, '$3 ~ 0' timestamp,opendkim,zmconfigd,mailbox,proxy,spell,logger,antivirus,archiving,snmp,ldap,memcached, convertd,stats,antispam,mta 1400670000,0.926591142901235,0.882009858611111,0.962549540740741,0.962548086419753,0.926603197839506, 1,,,0.964051042283951,1,0.962549647839506,0.962515237345679,0.292491091358025,,0.926590777777778 1400756400,1,0.968276889722222,1,1,1,1,,,1,1,1,1,1,,1 1401678000,0.9323037375,0.937399301388889,1,0.964109132777778,0.932308961111111,1,,,0.932305973888889, 1,0.964109800277778,1,0.932309575,,0.932302677222222 1401692400,0.999979394166667,0.9999799825,1,0.9999993925,0.999979395277778,1,,,0.999979393333333,1, 0.9999993975,1,0.999979395555556,,0.999979393333333 1401966000,1,0.964610447777778,1,1,1,1,,,1,1,1,1,1,,1 1402052400,0.999603703008394,0.999722196864111,0.999615163422937,0.999602498779275,0.999597924831049, 0.999619443248889,,,0.99959995491499,0.999626231525528,0.99961180945684,0.999632334525742, 0.999591523017581,,0.999607517027221 1402765200,1,0.966623691358025,1,1,0.966623606481481,1,1,,0.966623565432099,1,1,1,0.966623647530864, 1,0.966623437345679 1402768800,0.999471892261905,0.999587652037617,0.999491736309524,0.999464918452381,0.999464358928571, 0.999495648214286,0.999508635119048,,0.999464445238095,0.999496001785714,0.999483839285714, 0.999503813095238,0.999461091071429,0.99951724702381,0.999478128571429 1402776000,0.9999910775,0.999972398888889,0.999993851388889,0.999991085555555,0.999972394722222, 0.999991074166667,0.999991234166667,,0.999972394722222,0.999995651111111,0.999991075833333, 0.999991235277778,0.999972394722222,0.999991233333333,0.999972392777778 1403175600,0.999841834656085,0.999841587301587,0.999841991402116,0.999841788690476,0.999841692791005, 0.999842046957672,0.999842196097884,,0.999841743386243,0.999842097222222,0.999841937830688, 0.99984214484127,0.999841638227513,0.999842260251323,0.999841883267196 1405076400,1,0.964354991388889,1,1,1,1,1,,1,1,1,1,1,1,1 1405080000,1,0.946143796944445,1,1,1,1,1,,1,1,1,1,1,1,1 1405105200,1,0.987032061666667,1,1,1,1,1,,1,1,1,1,1,1,1 1405116000,1,0.982143184166667,1,1,1,1,1,,1,1,1,1,1,1,1 1405130400,1,0.967078515555556,1,1,1,1,1,,1,1,1,1,1,1,1 1405141200,1,0.920520648333333,1,1,1,1,1,,1,1,1,1,1,1,1 1405144800,1,0.9539186725,1,1,1,1,1,,1,1,1,1,1,1,1 1405148400,1,0.981826185277778,1,1,1,1,1,,1,1,1,1,1,1,1 1405162800,1,0.996330343333333,1,1,1,1,1,,1,1,1,1,1,1,1
An example of a zmcontrol restart
/opt/zimbra/libexec/zmrrdfetch -f zmstatuslog -h `zmhostname` -s `date +%s \ --date="15 minute ago"` -e `date +%s --date="1 minute ago"` timestamp,opendkim,zmconfigd,mailbox,proxy,spell,logger,antivirus,archiving,snmp,ldap,memcached, convertd,stats,antispam,mta 1405621920,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 1405621950,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 1405621980,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 1405622010,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 1405622040,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 1405622070,0.105026416666667,0.1050323,1,1,0.105029991666667,1,0.105016,0.105017466666667,0.105028733333333, 1,1,1,0.10503115,0.105014483333333,0.105025008333333 1405622100,0.105026416666667,0.1050323,1,1,0.105029991666667,1,0.105016,0.105017466666667,0.105028733333333, 1,1,1,0.10503115,0.105014483333333,0.105025008333333 1405622130,0.105026416666667,0.1050323,1,1,0.105029991666667,1,0.105016,0.105017466666667,0.105028733333333, 1,1,1,0.10503115,0.105014483333333,0.105025008333333 1405622160,0.105026416666667,0.1050323,1,1,0.105029991666667,1,0.105016,0.105017466666667,0.105028733333333, 1,1,1,0.10503115,0.105014483333333,0.105025008333333 1405622190,,0,,,,,,,,,,,,, 1405622220,,0,,,,,,,,,,,,, 1405622250,,0,,,,,,,,,,,,, 1405622280,,0,,,,,,,,,,,,, 1405622310,,0,,,,,,,,,,,,, 1405622340,,0.893621444444444,,,,,,,,,,,,, 1405622370,,0.893621444444444,,,,,,,,,,,,, 1405622400,,0.893621444444444,,,,,,,,,,,,, 1405622430,,1,,,,,,,,,,,,, 1405622460,,1,,,,,,,,,,,,, 1405622490,,1,,,,,,,,,,,,, 1405622520,,1,,,,,,,,,,,,, 1405622550,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 1405622580,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
Check The audit.log File For Service Enable Changes
There is the /opt/zimbra/log/audit.log file that will note a change in a service - for example [ use: zgrep zimbraService /opt/zimbra/log/audit* ]:
audit.log:2014-07-21 12:15:44,745 INFO [qtp1097575009-2632:https://127.0.0.1:7071/service/admin/soap/ModifyServerRequest] [name=zimbra;ip=127.0.0.1;ua=zmprov/8.0.7_GA_6029;] security - cmd=ModifyServer; name=zcs807.us.DOMAIN.com; -zimbraServiceEnabled=archiving; audit.log:2014-07-21 12:16:51,609 INFO [qtp1097575009-2640:https://127.0.0.1:7071/service/admin/soap/ModifyServerRequest] [name=zimbra;ip=127.0.0.1;ua=zmprov/8.0.7_GA_6029;] security - cmd=ModifyServer; name=zcs807.us.DOMAIN.com; +zimbraServiceEnabled=archiving;
Check The zmsetup logs For Changes During Installation/Re-installs
In regards to the /opt/zimbra/log/zmsetup.* log files, here's an example from a test machine :
[Someone rerunning the installer/zmsetup, archiving was enabled - greping' for archiv below]
zmsetup.07152014-150104.txt:Tue Jul 15 14:51:43 2014 enabled packages zimbra-logger zimbra-store zimbra-mta zimbra-convertd zimbra-core zimbra-apache zimbra-archiving zimbra-proxy zimbra-snmp zimbra-ldap zimbra-spell zmsetup.07152014-150104.txt:Tue Jul 15 14:52:02 2014 archiving is enabled zmsetup.07152014-150104.txt:Tue Jul 15 14:52:29 2014 checking isEnabled zimbra-archiving zmsetup.07152014-150104.txt:Tue Jul 15 14:52:29 2014 zimbra-archiving is enabled zmsetup.07152014-150104.txt:Tue Jul 15 14:54:43 2014 Updating cached config attribute for Server zcs807.us.DOMAIN.com: zimbraServiceInstalled=archiving zmsetup.07152014-150104.txt:Tue Jul 15 14:54:43 2014 *** Running as zimbra user: /opt/zimbra/bin/zmprov -r -m -l ms zcs807.us.DOMAIN.com zimbraServiceInstalled 'antivirus' zimbraServiceInstalled 'antispam' zimbraServiceInstalled 'opendkim' zimbraServiceInstalled 'archiving' zimbraServiceInstalled 'logger' zimbraServiceInstalled 'mailbox' zimbraServiceInstalled 'mta' zimbraServiceInstalled 'convertd' zimbraServiceInstalled 'stats' zimbraServiceInstalled 'proxy' zimbraServiceInstalled 'snmp' zimbraServiceInstalled 'ldap' zimbraServiceInstalled 'spell' zmsetup.07152014-150104.txt:Tue Jul 15 14:54:46 2014 Updating cached config attribute for Server zcs807.us.DOMAIN.com: zimbraServiceEnabled=archiving zmsetup.07152014-150104.txt:Tue Jul 15 14:54:46 2014 *** Running as zimbra user: /opt/zimbra/bin/zmprov -r -m -l ms zcs807.us.DOMAIN.com zimbraServiceEnabled 'antivirus' zimbraServiceEnabled 'archiving' zimbraServiceEnabled 'antispam' zimbraServiceEnabled 'opendkim' zimbraServiceEnabled 'logger' zimbraServiceEnabled 'mailbox' zimbraServiceEnabled 'mta' zimbraServiceEnabled 'convertd' zimbraServiceEnabled 'stats' zimbraServiceEnabled 'proxy' zimbraServiceEnabled 'snmp' zimbraServiceEnabled 'ldap' zimbraServiceEnabled 'spell' zmsetup.07152014-150104.txt:Tue Jul 15 14:55:30 2014 *** Running as zimbra user: /opt/zimbra/bin/zmprov -r -m -l mcf +zimbraComponentAvailable archiving zmsetup.07152014-150104.txt: Stopping archiving...Done. zmsetup.07152014-150104.txt: Starting archiving...Done. zmsetup.07152014-150104.txt:Tue Jul 15 15:00:06 2014 com_zimbra_archive... zmsetup.07152014-150104.txt:Tue Jul 15 15:00:06 2014 *** Running as zimbra user: /opt/zimbra/bin/zmzimletctl -l deploy zimlets-network/com_zimbra_archive.zip zmsetup.07152014-150104.txt:[] INFO: Deploying Zimlet com_zimbra_archive in LDAP. zmsetup.07152014-150104.txt:[] INFO: Installing Zimlet com_zimbra_archive on this host. zmsetup.07152014-150104.txt:[] INFO: Upgrading Zimlet com_zimbra_archive to 7.1.0 zmsetup.07152014-150104.txt:[] INFO: Enabling Zimlet com_zimbra_archive
Showing the ldap backup data in regards to the archiving service being disabled and then enabled after the 07/15 setup :
$ zgrep "zimbraServiceEnabled:" full-20140716.070025.112/ldap/* incr-20140714.070016.382/ldap/* :from the day after the re-install: full-20140716.070025.112/ldap/ldap.bak.gz:zimbraServiceEnabled: opendkim full-20140716.070025.112/ldap/ldap.bak.gz:zimbraServiceEnabled: archiving << full-20140716.070025.112/ldap/ldap.bak.gz:zimbraServiceEnabled: logger full-20140716.070025.112/ldap/ldap.bak.gz:zimbraServiceEnabled: mailbox full-20140716.070025.112/ldap/ldap.bak.gz:zimbraServiceEnabled: mta full-20140716.070025.112/ldap/ldap.bak.gz:zimbraServiceEnabled: convertd full-20140716.070025.112/ldap/ldap.bak.gz:zimbraServiceEnabled: stats full-20140716.070025.112/ldap/ldap.bak.gz:zimbraServiceEnabled: proxy full-20140716.070025.112/ldap/ldap.bak.gz:zimbraServiceEnabled: snmp full-20140716.070025.112/ldap/ldap.bak.gz:zimbraServiceEnabled: ldap full-20140716.070025.112/ldap/ldap.bak.gz:zimbraServiceEnabled: spell :from the day before the re-install: incr-20140714.070016.382/ldap/ldap.bak.gz:zimbraServiceEnabled: logger incr-20140714.070016.382/ldap/ldap.bak.gz:zimbraServiceEnabled: mailbox incr-20140714.070016.382/ldap/ldap.bak.gz:zimbraServiceEnabled: mta incr-20140714.070016.382/ldap/ldap.bak.gz:zimbraServiceEnabled: convertd incr-20140714.070016.382/ldap/ldap.bak.gz:zimbraServiceEnabled: stats incr-20140714.070016.382/ldap/ldap.bak.gz:zimbraServiceEnabled: snmp incr-20140714.070016.382/ldap/ldap.bak.gz:zimbraServiceEnabled: ldap incr-20140714.070016.382/ldap/ldap.bak.gz:zimbraServiceEnabled: spell incr-20140714.070016.382/ldap/ldap.bak.gz:zimbraServiceEnabled: proxy incr-20140714.070016.382/ldap/ldap.bak.gz:zimbraServiceEnabled: opendkim
Check The Zimbra Users BASH History File and .zmprov_history
You could check your .bash_history file to see if the command is still referenced there - if it goes back long enough for your purposes. I think the default lines the history file will remember is 500.
[zimbra@zcs807 ~]$ zmprov ms `zmhostname` -zimbraServiceEnabled archiving [zimbra@zcs807 ~]$ zmcontrol status | grep -i arch [zimbra@zcs807 ~]$ zmprov gs `zmhostname` | grep Enabled | grep archiving [zimbra@zcs807 ~]$ zmprov ms `zmhostname` +zimbraServiceEnabled archiving [zimbra@zcs807 ~]$ zmcontrol status | grep -i arch archiving Running [zimbra@zcs807 ~]$ zmprov gs `zmhostname` | grep Enabled | grep archiving zimbraServiceEnabled: archiving [zimbra@zcs807 ~]$ grep archiving .bash_history zmprov ms `zmhostname` +zimbraServiceInstalled archiving +zimbraServiceEnabled archiving zmprov ms `zmhostname` -zimbraServiceEnabled archiving zmprov gs `zmhostname` | grep Enabled | grep archiving zmprov ms `zmhostname` +zimbraServiceEnabled archiving zmprov gs `zmhostname` | grep Enabled | grep archiving grep archiving .bash_history
Note, there is also a /opt/zimbra/.zmprov_history you can also review
Getting Duplicate Emails In The Archive Account
Please see the following:
- Duplicate Email Forwarded to External account when sending to a DL and user
- https://bugzilla.zimbra.com/show_bug.cgi?id=81996
- fixed in 807
- See also an RFE request to remove duplicates from archive accounts:
- Case 00124484: Incoming Call - NEW CASE WITH PREMIUM SUPPORT
- https://bugzilla.zimbra.com/show_bug.cgi?id=88184
- See also an RFE request to remove duplicates from archive accounts:
- fixed in 807
- https://bugzilla.zimbra.com/show_bug.cgi?id=81996
Archiving Issues When Using 3rd Party MTA's
Please see the following:
- RFE: Ability to handle A&D when another MTA systems is being specified
Pre-Deployment Type Questions
How To Add OLD Data Or Retroactively Add Data To A&D Account
You'll want to have A&D all setup and then you can use imapsync to 'sync' the old data from the one account into the A&D account.
Recommendations:
- Confirm imap is enabled on the mailstores
- Setup a sub-folder in A&D account to hold data that existed prior to the A&D account being in use.
- Test the various imapsync flags you'll want to use first before running against all your accounts.
See also:
Can we set the archive settings for only sent mail?
Question: Can we set the archive settings for only sent mail?
Answer: No, archiving is done for any message that passes through the MTA for an account that has archiving enabled. You can setup separate MTA's for in/out bound delivery and enable archiving for only the inbound servers to achieve this goal.
Can we set the archive settings for only form port 25?
Question: Can we set the archive settings for only form port 25?
Answer: No, there are no per port level configurations. You can configure which accounts have archiving enabled and you can enable/disable the service on a per server level.
If Zimbra implemented an archive feature, is something in the following MTA files changes?
Question: If Zimbra implemented an archive feature, is something in the following MTA files changed? [ zmmta.cf , main.cf , main.cf.default , master.cf.in , master.cf ]
Answer: Nothing is specifically changed in the files you listed but settings in zmmta.cf determine how the postfix content filter is configured when archiving is enabled. Archiving functionality is handled by the amavis process on the Zimbra MTA.
Using One Archive Account For Multiple Accounts
You could also include other variable's here if they are needed, ex. - archive-cos COS_NAME
zmarchiveconfig enable user1@domainname archive-address user-archives@domainname.archive zmarchiveconfig enable user2@domainname archive-address user-archives@domainname.archive archive-create FALSE zmarchiveconfig enable user3@domainname archive-address user-archives@domainname.archive archive-create FALSE
You'll see the mapping in the primary email account settings that state what archive account is being used:
zmprov ga user1@example.com zimbraArchiveAccount zimbraArchiveAccount: user-archives@domainname.archive
zmprov ga user2@example.com zimbraArchiveAccount zimbraArchiveAccount: user-archives@domainname.archive
zmprov ga user3@example.com zimbraArchiveAccount zimbraArchiveAccount: user-archives@domainname.archive
External Host For Archive Accounts Setup
I installed 5.0.11 on a test box, selecting the archiving package during the installation.
The main domain was "zimbra.INTERNAL.com" and the servername is mail3.zimbra.INTERNAL.com .
'Note, I did have an external MTA relay server setup for zimbra. I was doing this test from home.
Once it was done, I then created a test account - ajcody@zimbra.INTERNAL.com
I then ran this from the CLI [on a multi-server environment, this is ran on the mta server]:
zmprov ms mail3.zimbra.INTERNAL.com +zimbraServiceInstalled archiving +zimbraServiceEnabled archiving
I confirm that I can send emails to the external account that I will be using with the zimbra admin account:
- Logged into zimbra admin web console , accounts > admin > View Mail
- Composed new message for ajcody@EXTERNAL-DOMAIN.com
I confirmed the external account received the email and did a reply back. Again, confirming now that the admin account gets the email as well from the external account.
Created the archive account to be used:
zmarchiveconfig enable ajcody@zimbra.INTERNAL.com archive-address ajcody@EXTERNAL-DOMAIN.com archive-create false
I then stopped/started zimbra.
zmcontrol stop zmcontrol start
Confirmed that amavis (antispam & antivirus) and archive show up as running process:
[zimbra@mail3 ~]$ zmcontrol status Host mail3.zimbra.INTERNAL.com antispam Running antivirus Running archiving Running ldap Running logger Running mailbox Running mta Running snmp Running spell Running stats Running
Checked my zimbra account to confirm the archive variables:
[zimbra@mail3 ~]$ zmprov ga ajcody@`hostname -d` | egrep -i archive amavisArchiveQuarantineTo: ajcody@EXTERNAL-DOMAIN.com zimbraArchiveAccount: ajcody@EXTERNAL-DOMAIN.com zimbraArchiveAccountDateTemplate: yyyyMMdd zimbraArchiveAccountNameTemplate: ${USER}-${DATE}@${DOMAIN}.archive
Tests I then performed:
- I sent an email from the zimbra admin account to the ajcody@zimbra.INTERNAL.com account. Confirmed that the external account [ajcody@EXTERNAL-DOMAIN.com] received a copy.
- I sent an email to ajcody@zimbra.INTERNAL.com from my ajcody@BUSINESS.com account and confirmed a copy went to ajcody@EXTERNAL-DOMAIN.com .
- I sent an email from ajcody@zimbra.INTERNAL.com to the zimbra admin account, again confirming a copy went to ajcody@EXTERNAL-DOMAIN.com .
What didn't work as expected:
- Messages to/from the two accounts don't create copies. If ajcody@zimbra.INTERNAL.com sends to ajcody@EXTERNAL-DOMAIN.com a "copy" will not be generated and vis-versa .
- The subject lines weren't altered as stated in the official A&D document.
- p3 , "When a message is received to a mailbox with archiving enabled, a copy of the message is sent to the archive mailbox with the text “to be archived” added to the subject line."
I've sent off a request about these two items to the developers to get their feedback on them.
Multi-Server & New Mailstore A&D Setup
I also created a RFE for documentation on this.
http://bugzilla.zimbra.com/show_bug.cgi?id=25135
The following is a very rough draft document I made for multi-server / new mailstore A&D setups.
Ajcody Multi-Server & New Mailstore A&D Setup Homepage
Actual Multi-Server & New Mailstore A&D Setup Homepage
Please see Ajcody-Notes-Archive-Discovery-Mailstore-Setup
Issues That Have Caused Confusion
What Gets Installed Where?
RFE To Clear Up The Confusion
- "Clear Up "archiving" service/package confusion"
zimbra-archive package/rpm - Mailstores
zimbra-archive (the package/rpm you see from the installer) should be installed on all mailstores which you want to use for cross mailbox search. This also sets the zimbraComponentAvailable archiving config attribute which allows the mta(s) to turn on archiving. zimbra-archive is not installed directly on the mta, it's just enabled.
Note, you install zimbra-archive on a mailbox server but the service runs on the mta node.
MTA's - Require Configuration
If you add zimbra-archiving to an existing install you need to :
- Install zimbra-archiving on one or more of your mailbox servers
- Then set zimbraServiceInstalled archiving and zimbraServiceEnabled archiving on all the mta servers
- Restart the mta services
For example:
zmprov ms mta.example.com +zimbraServiceInstalled archiving +zimbraServiceEnabled archiving
On the mta server:
zmmtactl restart
To confirm the /opt/zimbra/conf/amavisd.conf was modified correctly, you should see on the mta:
#$archive_quarantine_method = 'smtp:[127.0.0.1]:10025';
Was uncommented out:
$archive_quarantine_method = 'smtp:[127.0.0.1]:10025';
You'll be able to then notice in the /var/log/zimbra.log file if the redirect to the A&D account is happening [once A&D accounts are setup that is]. Example uses example.com.archive as the archive domain I setup for the A&D accounts :
grep "example.com.archive" /var/log/zimbra.log Dec 11 13:38:52 mta-server amavis[1978]: (01978-19) SEND via SMTP: <> -> <user-20081211@example.com.archive>,ENVID=AM.8ISxcrQG8uAj.20081211T193852Z@mailstore.example.com BODY=7BIT 250 2.6.0 Ok, id=01978-19, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 5ADF8F120C4 Dec 11 13:38:52 mta-server postfix/lmtp[21864]: 5ADF8F120C4: to=<user-20081211@example.com.archive>, relay=archive.example.com[X.X.X.93]:7025, delay=0.07, delays=0/0/0/0.06, dsn=2.1.5, status=sent (250 2.1.5 OK)
Enabling Amavis And Archiving With 8.5+ While Antispam And AntiVirus Are Disabled
With 808 and 8.5 , archiving should be able to run without as/av being enabled.
- It should be possible to remove Amavis as a service
For example, disabling antispam and antivirus but enabling amavis [required] and archiving on a mta server [note - this server had the full mta package already installed on it and had antivirus, antispam, [amavis], and postfix running on it] :
[zimbra@850-mta1 ~]$ zmcontrol status | egrep 'amavis|antispam|antivirus|archiving' amavis Running antispam Running antivirus Running ## NOTE , the below command will disable antispam & anitvirus for this "test". ## [zimbra@850-mta1 ~]$ zmprov ms `zmhostname` +zimbraServiceEnabled archiving \ +zimbraServiceEnabled amavis -zimbraServiceEnabled antispam -zimbraServiceEnabled antivirus [zimbra@850-mta1 ~]$ zmcontrol restart Host 850-ldap1.zimbra.homeunix.com Stopping vmware-ha...Done. [cut] Stopping ldap...Done. Host 850-ldap1.zimbra.homeunix.com Starting ldap...Done. Starting zmconfigd...Done. Starting dnscache...Done. Starting logger...Done. Starting convertd...Done. Starting mailbox...Done. Starting memcached...Done. Starting proxy...Done. Starting amavis...Done. Starting opendkim...Done. Starting archiving...Done. Starting snmp...Done. Starting spell...Done. Starting mta...Done. Starting stats...Done. Starting service webapp...Done. Starting zimbra webapp...Done. Starting zimbraAdmin webapp...Done. Starting zimlet webapp...Done. [zimbra@850-ldap1 ~]$ zmcontrol status | egrep 'amavis|antispam|antivirus|archiving' amavis Running archiving Running
zimbra_xmbxsearch zimlet
For 5.x installs, this zimbra_xmbsearch zimlet will get configured on each mailstore that you install the zimbra-archive package on. The documentation in various places might cause confusion on this matter, because for the 4.x releases it was a separate step.
You should find the zimlet already located at /opt/zimbra/zimlets-network/zimbra_xmbxsearch.zip
After the installation, you should see when you go to the admin web console on the mailstore you install the zimbra-archive package on that the cross-mailbox search zimlet is there. It shows up in two locations:
- Left Pane : Configuration > Admin Extensions > zimbra_xmbxsearch
- Left Pane : Tools > Search Mail
If you wanted this zimlet to also be available on a server that didn't have the zimbra-archiving packaged installed you could then deploy it on that server.
cd /opt/zimbra/zimlets-network/ zmzimletctl deploy zimbra_xmbxsearch.zip ## ls the directory and confirm the full name - you might need this: zmzimletctl deploy com_zimbra_xmbxsearch.zip
The How-To
Reference Documents
http://www.zimbra.com/docs/ne/latest/multi_server_install/multi-server_install.5.1.html
http://www.zimbra.com/docs/ne/latest/administration_guide/Archiving.16.1.html
Assumptions
This install how-to assumes you have an existing LDAP/Mailstore/MTA server(s) for your normal production environment, the Zimbra license and logger are installed on the primary ZCS server(s), and that you are NOT running the proxy module.
Example archive mailstore hostname is : archive.example.com
Example primary ZCS hostname is : mail.example.com
Preliminary Items
Things to do or check before install:
- DNS entry for new mailstore and primary ZCS server(s) can resolve to it.
- DNS configured properly on mailstore server.
- Master Root LDAP Server mail.example.com
- Master Root LDAP Password
- On LDAP server do : su – zimbra ; zmlocalconfig –s | grep ldap_root_password
- Master LDAP port – default is 389
- SMTP Server
Installation Of New Mailstore That Will Have A&D
Install Modules
- Type y to install the zimbra-store, zimbra-archiving and zimbra-spell (optional) packages.
- Do Not Install MTA! These Instructions Do Not Take That Into Account.
- When zimbra-spell is installed the zimbra-apache package is also installed.
- Installing: zimbra-core zimbra-store zimbra-apache zimbra-spell
Modify Configuration
Press Enter to modify the system. The selected packages are installed on the server.
At this point the Main menu displays the default entries for the Zimbra component you are installing.
To expand the menu to see the configuration values type x and press Enter.
To navigate the Main menu, select the menu item to change. You can modify any of the defaults.
- Common Configuration
- LDAP
- Ldap master host: [set this to the FQDN of your LDAP server]
- Ldap port: 389 [set this if your LDAP server isn’t using default]
- Ldap Admin password: [this is your LDAP servers Root LDAP password]
- On LDAP server do : su – zimbra ; zmlocalconfig –s ldap_root_password
- TimeZone: [set this]
- LDAP
- For zimbra-store
- Set the Admin Password
- +License filename: UNSET [if you see this, then something is wrong with your
- LDAP configuration. It should of pulled the license info from the LDAP server.
- Set the SMTP host
- Set the Admin Password
Type r to return to the Main menu, if you aren’t there already.
When the mailbox server is configured, return to the Main menu and type a to apply the configuration changes.
Press Enter to save the configuration data.
When Save Configuration data to a file appears, press Enter.
The next request is where to save the files. To accept the default, press Enter.
To save the files to another directory, enter the directory and then press Enter.
When “The system will be modified - continue?” appears type y and press Enter.
The server is modified.
Installing all the components and configuring the server can take a few minutes.
When Installation complete - press return to exit displays, press Enter.
The installation of the mailbox server is complete.
After Install
Confirm server status
su – zimbra ; zmcontrol status
Populate the ssh keys, on each server in your environment
su - zimbra ; zmupdateauthkeys
The key is updated on /opt/zimbra/.ssh/authorized_keys.
Upgrading A Zimbra Server For An Archive & Discovery Mailstore
Adding Package For A&D
This will retain your current settings for the system. Your server will experience downtime during the upgrade.
untar zcs*.tar that matches your existing system
cd zcs-version-directory ./install choose upgrade select zimbra-archiving
The upgrade of the mailbox server is complete.
After Upgrade
Confirm server status
su – zimbra ; zmcontrol status
Note, zimbra-archiving only runs as a service on a MTA server.
Populate the ssh keys, on each server in your environment
su-zimbra ; zmupdateauthkeys
The key is updated on /opt/zimbra/.ssh/authorized_keys.
Configure Zimbra For Use Of The New Mailstore and A&D
Example A&D mailstore hostname is : archive.example.com
- Go to your primary admin console url. [https://[example.com]:7071/zimbraAdmin]
- Confirm you see the new mailstore under Configuration > Servers
- Under Configuration > Servers > [MTA servername(s)] > Services
- [each MTA server needs this]
- You’ll see a box for Archiving and Discovery
- Check this to enable the MTA server(s) for Archiving and Discovery. If this is grayed out, run the command below (modified for your server) on your one of your mailstores.
- This effectively does:
-
zmprov ms mta.example.com +zimbraServiceInstalled archiving +zimbraServiceEnabled archiving
- Remember, zmprov uses the variable below. A mta only server can't be set for localhost, change it to point to a mailstore.
-
[root@mta ~]# zmlocalconfig | grep zmprov
-
zimbra_zmprov_default_soap_server = localhost
-
[root@mta ~]# zmlocalconfig -e zimbra_zmprov_default_soap_server=mailstore.example.com
- Check this to enable the MTA server(s) for Archiving and Discovery. If this is grayed out, run the command below (modified for your server) on your one of your mailstores.
- Under Configuration > Servers > [MTA servername(s)] > Services
Configuring Your COS's - Normal COS's and Archiving COS
It's recommended that the archive accounts be created on a dedicated mailstore. You can limit what mailstores are used for new account creation by restricting what mailstores are used under "Server Pool" within a COS. Your normal COS's should excluded your archive mailstores and your archive COS should only have archive mailstores selected.
You'll also want to make sure your archive COS isn't using any 'features' that aren't necessary for archive accounts. No point in consuming certain license features when they aren't needed.
- Go to Configuration > Class of Service > default [or your primary domain] > Server Pool
- You’ll want to make sure it’s limited to the correct server pools
- Your new mailstore for A&D should be unchecked.
- Click on New for a new Class of Server (COS)
- Call it archive or something similar
- Under Server Pool > Limit > have only the new mailstore checked
- Call it archive or something similar
- Make sure your not using licensed features [EWS for example] that aren't necessary for your archive accounts.
- You’ll want to make sure it’s limited to the correct server pools
Setup Initial A&D With First Account - Creation Of The Archive Domain
Revisit To COS - Naming Scheme Of Archive Accounts
When archive accounts are created they use the zimbraArchiveAccountNameTemplate variable from the COS. The default is:
$ zmprov gc default | grep -i archive zimbraArchiveAccountDateTemplate: yyyyMMdd zimbraArchiveAccountNameTemplate: ${USER}-${DATE}@${DOMAIN}.archive
I, personally, don't like the use of the $DATE variable in this. I change my ARCHIVE COS to use the normal username but retain the .archive for the domain.
zmprov mc archive zimbraArchiveAccountNameTemplate '${USER}@${DOMAIN}.archive'
Bug to be aware of:
- "zimbraArchiveAccountNameTemplate is case sensitive - PDF doc is wrong"
The Creation
On server with zmarchiveconfig (most likely mailstore you installed A&D on) and as zimbra (su – zimbra) do the following to setup your first A&D account.
format : zmarchiveconfig –s servername enable user@example.com archive-cos <cos>
example :
zmarchiveconfig –s archive.example.com enable account@example.com archive-cos archive
NOTE
- If the above command doesn't seem to create the archive account/domain. Drop the use of [ -s servername ]. Basically, just run this on the A&D mailstore:
-
zmarchiveconfig enable account@example.com archive-cos archive
-
The above command will create the mail domain for the archive accounts using the template defaults, user@example.com to make example.com.archive
On your main ldap server or where ever you usually access the zimbra admin web console, login to the admin web console.
- Confirm the archive domain was setup.
- Configuration > Domains > [domainname].archive > General
- Confirm or adjust the archive domain to use the right COS
- Configuration > Domains > [domainname].archive > General Information
- Change “Default Class of Service” to your COS [archive], if needed for your configuration.
- Configuration > Domains > [domainname].archive > General Information
- Now check for the new archive account you made
- Address > Accounts
- Click on account and hit the edit button
- In the top summary section you'll be able to confirm the COS and Mail Server being used for the account.
- NOTE, if it's showing the account is on the primary mailstore and NOT the A&D mailstore.
- Remove the A&D account
-
zmprov ra [user]@[domainname].archive
-
- Add the account back again using the zmarchiveconfig command
-
zmarchiveconfig enable account@example.com archive-cos archive
-
- Now confirm, as above, that the account is using the A&D mailstore.
- This might be a bug related to the archive domain being created for the first time.
- Remove the A&D account
- NOTE, if it's showing the account is on the primary mailstore and NOT the A&D mailstore.
Send the primary account a test email and then shortly afterwards do a "View Mail" within the admin console for the archive account. You should see the archive message in the archive account.
Error: unknown document: EnableArchiveRequest
If you get this error when trying to create the archive account "Error: unknown document: EnableArchiveRequest" you most likely needed to install a new license for A&D and have not restart the mailboxd services . Updating the license is not enough, you'll need to restart ZCS on the mailstores also.
See the following bug:
- zimbra-archive extension fails to load when init() fails due to LDAP server outage
RFE's On Archive Accounts
- RFE: COS option to create archiving account automatically by default
Testing Of Archive Mail Flow
Send the primary account a test email and then shortly afterwards do a "View Mail" within the admin console for the archive account. You should see the archive message in the archive account.
You should confirm mail flow copies occur with the following:
- Inbound
- External Account (email) to the primary zimbra account setup for archive.
- A zimbra account that ISN'T the archive account in question to the primary account setup for archive.
- Outbound
- With primary account setup for archive, send an email to an external email address.
- With primary account setup for archive, send an email to another internal zimbra email address.
Archive Account Isn't Getting Email
Let's double check everything was done correctly up above.
Assumption on syntax of account creation:
zmarchiveconfig enable user@example.com archive-cos archive
Let's check what actually was done:
zmprov ga user@example.com | grep -i archive amavisArchiveQuarantineTo: user-20081211@example.com.archive zimbraArchiveAccount: user-20081211@example.com.archive zimbraArchiveAccountNameTemplate: ${USER}-${DATE}@${DOMAIN}.archive
It should reference an account that's like, if you are using the archive templates:
user-[date]@example.com.archive
that account should exist and reference lmtp, rather than smtp, for the transport:
zmprov ga user-20081211@example.com.archive | grep -i trans zimbraMailTransport: lmtp:archive.example.com:7025
Checking Logs For Archive Operations
On the mta-server, you should find a reference to the archive account in /var/log/zimbra.log
grep archive /var/log/zimbra.log Dec 11 13:38:52 mta-server amavis[1978]: (01978-19) SEND via SMTP: <> -> <user-20081211@example.com.archive>,ENVID=AM.8ISxcrQG8uAj.20081211T193852Z@mailstore.example.com BODY=7BIT 250 2.6.0 Ok, id=01978-19, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 5ADF8F120C4 Dec 11 13:38:52 mta-server postfix/lmtp[21864]: 5ADF8F120C4: to=<user-20081211@example.com.archive>, relay=archive.example.com[X.X.X.93]:7025, delay=0.07, delays=0/0/0/0.06, dsn=2.1.5, status=sent (250 2.1.5 OK)
On the archive-server, you should find reference to the delivery in /opt/zimbra/log/mailbox.log
grep archive /opt/zimbra/log/mailbox.log 2008-12-11 14:45:32,923 INFO [LmtpServer-9] [name=user-20081211@example.com.archive;mid=7;] mailop - Adding Message: id=257, Message-ID=<1350363939.41021229024728317.JavaMail.root@EXTERNAL-MTA.DOMAIN.com>, parentId=-1, folderId=2, folderName=Inbox.
Mass Accounts Configuration
- Update 5/28/15, I filed the following RFE:
- "Redesign archive account creation process [autocreate, mass creation/enabling, etc]"
https://bugzilla.zimbra.com/show_bug.cgi?id=99710
- Update, our 6.0 release will have a zmarchiveconfig -f command for batch processing from a file input.
CHECK YOUR AVAILABLE LICENSES BEFORE YOU PROCEED!!
One could put all the accounts in a txt file and then use a for-loop to process the account@example.com variable.
zmprov -l gaa > /tmp/accounts.txt
Remove any accounts you've already done and those not necessary for archiving (ex. admin, ham, spam, etc.)
You can give gaa other options, look at zmprov help account. For example, you could also narrow this down to a dump of accounts in a domain:
zmprov -l gaa [DOMAIN] > /tmp/accounts.txt
Note, the below uses the above setup for A&D - You'll need to modify for your environment.
for i in `cat /tmp/accounts.txt` do zmarchiveconfig –s archive.example.com enable $i archive-cos archive sleep 3 done
You can be tailing /opt/zimbra/log/mailbox.log on the archive server to watch the progress.
Searches After Configuration Is Done
Please see Ajcody-Server-Misc-Topics#Cross_Mailbox_Searches_and_Tracing
Searches Limited To 500 or 1000 Maximum Results
See Ajcody-Server-Misc-Topics#Searches_Limited_To_500_or_1000_Maximum_Results
Special Circumstance Case Scenarios
Need Primary Account Going To Two "Archive" Targets
Currently it isn't possible, I have submitted an RFE for this though:
- "Allow current archive account target to be multi-value for redirection, like zimbraArchiveAccount allows"
I also submitted an RFE to clarify the difference/intention between amavisArchiveQuarantineTo and zimbraArchiveAccount
- "describe amavisArchiveQuarantineTo and strong clarify difference/relationship to zimbraArchiveAccount"
Using Legal Intercept For Secondary Target
Note - since we are setting the legal intercept against the ARCHIVE account and not the production account, we avoid what might be an issue with legal intercept's limitations. See :
Other references:
- http://wiki.zimbra.com/wiki/Legal_Intercept
- Has information on customizing the modifications done to the legal intercepted message.
Primary Archive Account Setup [zimbra@zcs807 ~]$ zmarchiveconfig create archive-test@zcs807.us.DOMAIN.com archive-address archive-test-manual@zcs807.us.DOMAIN.com.archive Setup For The Legal Intercept One We'll Use - You could also use the 'normal' account creation process, but those defaults also will show up in the GAL. [zimbra@zcs807 ~]$ zmarchiveconfig create archive-test2@zcs807.us.DOMAIN.com archive-address archive-test-manual@zcs807.us.DOMAIN.com.archive [zimbra@zcs807 ~]$ zmprov ga archive-test@zcs807.us.DOMAIN.com | egrep -i 'archive|amavisArchiveQuarantine' [cut - notes] confirm that amavisArchiveQuarantineTo & zimbraArchiveAccount are using only ONE of the 'archive' accounts, the primary archive account. Not the one we'll setup later to be the legal intercept target. [zimbra@zcs807 ~]$ zmprov ma archive-test@zcs807.us.DOMAIN.com amavisArchiveQuarantineTo archive-test-manual@zcs807.us.DOMAIN.com.archive [zimbra@zcs807 ~]$ zmprov ma archive-test@zcs807.us.DOMAIN.com zimbraArchiveAccount archive-test-manual@zcs807.us.DOMAIN.com.archive [note] by using just the variable name and not including a + or - in front of it, we'll set it to only be one variable if there were multiple ones set. [zimbra@zcs807 ~]$ zmprov ga archive-test@zcs807.us.DOMAIN.com | egrep -i 'archive|amavisArchiveQuarantine' # name archive-test@zcs807.us.DOMAIN.com amavisArchiveQuarantineTo: archive-test-manual@zcs807.us.DOMAIN.com.archive cn: archive-test mail: archive-test@zcs807.us.DOMAIN.com sn: archive-test uid: archive-test zimbraArchiveAccount: archive-test-manual@zcs807.us.DOMAIN.com.archive zimbraArchiveAccount: archive-test-manual2@zcs807.us.DOMAIN.com.archive zimbraArchiveAccountDateTemplate: yyyyMMdd zimbraArchiveAccountNameTemplate: ${USER}-${DATE}@${DOMAIN}.archive zimbraArchiveEnabled: TRUE zimbraMailDeliveryAddress: archive-test@zcs807.us.DOMAIN.com Set Up your Legal Intercept Variable Now To The Production Account [zimbra@zcs807 ~]$ zmprov ma archive-test@zcs807.us.DOMAIN.com zimbraInterceptAddress archive-test-manual2@zcs807.us.DOMAIN.com.archive For Testing - I'm purging the Inbox on all three test accounts. [zimbra@zcs807 ~]$ zmmailbox -z -m archive-test-manual2@zcs807.us.DOMAIN.com.archive ef /Inbox [zimbra@zcs807 ~]$ zmmailbox -z -m archive-test-manual@zcs807.us.DOMAIN.com.archive ef /Inbox [zimbra@zcs807 ~]$ zmmailbox -z -m archive-test@zcs807.us.DOMAIN.com ef /Inbox Create An Email That We Can Send From The CLI [zimbra@zcs807 ~]$ cat /tmp/email-archive.txt To: archive-test@zcs807.us.DOMAIN.com From: admin@zcs807.us.DOMAIN.com Subject: Test message test [zimbra@zcs807 ~]$ /opt/zimbra/postfix/sbin/sendmail -t < /tmp/email-archive.txt ; tail -f /var/log/zimbra.log | grep archive-test Jul 18 11:10:27 zcs807 amavis[31986]: (31986-02) ESMTP:[127.0.0.1]:10024 /opt/zimbra/data/amavisd/tmp/amavis-20140718T105435-31986-BmFt0jbd: <zimbra@zcs807.us.DOMAIN.com> -> <archive-test@zcs807.us.DOMAIN.com> SIZE=341 Received: from zcs807.us.DOMAIN.com ([127.0.0.1]) by localhost (zcs807.us.DOMAIN.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP for <archive-test@zcs807.us.DOMAIN.com>; Fri, 18 Jul 2014 11:10:27 -0600 (MDT) Jul 18 11:10:27 zcs807 amavis[31986]: (31986-02) Checking: qeJtNl1F-X9w <zimbra@zcs807.us.DOMAIN.com> -> <archive-test@zcs807.us.DOMAIN.com> Jul 18 11:10:27 zcs807 amavis[31986]: (31986-02) SEND from <> -> <archive-test-manual@zcs807.us.DOMAIN.com.archive>,ENVID=AM.qeJtNl1F-X9w.20140718T171027Z@zcs807.us.DOMAIN.com BODY=7BIT 250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as E7236E05EA Jul 18 11:10:27 zcs807 amavis[31986]: (31986-02) FWD from <zimbra@zcs807.us.DOMAIN.com> -> <archive-test@zcs807.us.DOMAIN.com>,BODY=7BIT 250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as EDAEBE0B7C Jul 18 11:10:27 zcs807 amavis[31986]: (31986-02) Passed CLEAN {RelayedInbound,Archived}, <zimbra@zcs807.us.DOMAIN.com> -> <archive-test@zcs807.us.DOMAIN.com>, quarantine: archive-test-manual@zcs807.us.DOMAIN.com.archive, Message-ID: <20140718171027.C8881E0B7B@zcs807.us.DOMAIN.com>, mail_id: qeJtNl1F-X9w, Hits: -, size: 341, queued_as: EDAEBE0B7C, 122 ms Jul 18 11:10:27 zcs807 postfix/smtp[12085]: C8881E0B7B: to=<archive-test@zcs807.us.DOMAIN.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.22, delays=0.09/0/0/0.12, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as EDAEBE0B7C) Jul 18 11:10:28 zcs807 postfix/lmtp[12088]: E7236E05EA: to=<archive-test-manual@zcs807.us.DOMAIN.com.archive>, relay=zcs807.us.DOMAIN.com[10.137.27.38]:7025, delay=0.15, delays=0.02/0.01/0/0.12, dsn=2.1.5, status=sent (250 2.1.5 Delivery OK) Jul 18 11:10:28 zcs807 postfix/lmtp[12090]: EDAEBE0B7C: to=<archive-test@zcs807.us.DOMAIN.com>, relay=zcs807.us.DOMAIN.com[10.137.27.38]:7025, delay=0.21, delays=0.01/0.01/0/0.19, dsn=2.1.5, status=sent (250 2.1.5 Delivery OK) Jul 18 11:10:28 zcs807 postfix/smtp[12093]: 1C4ADE05EA: to=<archive-test-manual2@zcs807.us.DOMAIN.com.archive>, relay=127.0.0.1[127.0.0.1]:10030, delay=0.13, delays=0.05/0.01/0.01/0.06, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 2B480E0B9F) Jul 18 11:10:28 zcs807 postfix/smtp[12096]: 2B480E0B9F: to=<archive-test-manual2@zcs807.us.DOMAIN.com.archive>, relay=127.0.0.1[127.0.0.1]:10025, delay=0.09, delays=0.06/0.01/0/0.02, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 3B6C6E05EA) Jul 18 11:10:28 zcs807 postfix/lmtp[12088]: 3B6C6E05EA: to=<archive-test-manual2@zcs807.us.DOMAIN.com.archive>, relay=zcs807.us.DOMAIN.com[10.137.27.38]:7025, delay=0.15, delays=0.02/0/0/0.13, dsn=2.1.5, status=sent (250 2.1.5 Delivery OK) Let's Confirm That All Three Accounts Show A New Message [zimbra@zcs807 ~]$ zmmailbox -z -m archive-test-manual@zcs807.us.DOMAIN.com.archive gaf | grep Inbox 2 mess 1 1 /Inbox [zimbra@zcs807 ~]$ zmmailbox -z -m archive-test-manual2@zcs807.us.DOMAIN.com.archive gaf | grep Inbox 2 mess 1 1 /Inbox [zimbra@zcs807 ~]$ zmmailbox -z -m archive-test@zcs807.us.DOMAIN.com gaf | grep Inbox 2 mess 1 1 /Inbox [zimbra@zcs807 ~]$ zmmboxsearch -m archive-test@zcs807.us.DOMAIN.com,archive-test-manual@zcs807.us.DOMAIN.com.archive,archive-test-manual2@zcs807.us.DOMAIN.com.archive -q "Test Message" 1) ID: 12d3b4cf-61b8-4ba7-805f-be1d9ab6c0c2:283 Subject: Test message Address: [f] <admin@zcs807.us.DOMAIN.com> Date: 1405703428000 Size: 1041 Conv: -283 Flags: u Folder: 2 Fragment: test 2) ID: 0b283721-857e-4bdc-967a-c5f9e7ec7db2:257 Subject: Test message Address: [f] <admin@zcs807.us.DOMAIN.com> Date: 1405703428000 Size: 1269 Conv: -257 Flags: u Folder: 2 Fragment: test 3) ID: 3cb67670-1ad9-48c0-8f9b-372adaa2fe3f:258 Subject: Intercepted message for archive-test@zcs807.us.DOMAIN.com: Test message Address: [f] Postmaster <postmaster@zcs807.us.DOMAIN.com> Date: 1405703428000 Size: 2769 Conv: -258 Flags: au Folder: 2 Fragment: Intercepted message for archive-test@zcs807.us.DOMAIN.com. Operation=add message, folder=Inbox, folder ID=2.
Using Another Archive Account Against the Primary Archive Account
To Do
Domain Admin Searches For ZCS6
For setting up domain admin rights, please see the following : User:Vladimir-DomainAdminSetup-v6
And you'll see about half way down a screen shot of the "Rights" panel view -- the screen shot shows the ACL right called :
- adminConsoleCrossMailboxSearchRights --- Admin Console Cross Mailbox Search Rights
You'll also need to make sure domain admins have the following ACL right :
- AdminLoginAs
service.UNKNOWN_DOCUMENT Error When Trying Search
The service.UNKNOWN_DOCUMENT error generally means that there is no handler for specified document. Try redeploying the zimlet, restarting the mailboxd service and let us know how it goes. The xmbxsearch zimlet is located in /opt/zimbra/zimlets-network directory.
su - zimbra cd /opt/zimbra/zimlets-network zmzimletctl undeploy zimbra_xmbxsearch.zip zmzimletctl deploy zimbra_xmbxsearch.zip zmmailboxdctl restart
How To Turn Off / Disable ALL A&D Processing From Admin Web Console
From a "server" level, you would uncheck the "Archiving and Discovery" box in the admin web console under:
Configurations > Servers > [MTA's] > right pane > Services tab
This would stop the mta's from splitting the emails for archive.
How To Turn Off / Disable A&D For An Account
Disabling A&D at a user level, requires it to be done via the CLI:
zmarchiveconfig disable user@domainname
What Accounts Are Set For Archive And Checking Against License Usuage
Note - in regards to closing the parent account but leaving the "archive" accounts or multiple archive accounts enabled, the actual archive account doesn't count against the license - either the normal or archive limit. It's consumed based upon the variables and status of the parent email address. See :
- "Request to exclude closed accounts within license count"
- "3rd party Archiving consumes Archiving Account license"
This example below is done on a ZCS 8.6 server. The license usage is based upon the 'parent' account having amavisArchiveQuarantineTo set to something. :
$ zmprov -l gaa admin@ldap2.zimbra.DOMAIN.com spam.gktt7hym36@ldap2.zimbra.DOMAIN.com ham.0zrc899s@ldap2.zimbra.DOMAIN.com virus-quarantine.o944yi8wwl@ldap2.zimbra.DOMAIN.com galsync.cs_37n5wp@ldap2.zimbra.DOMAIN.com user1@ldap2.zimbra.DOMAIN.com user1-archive1@ldap2.zimbra.DOMAIN.com.archive user1-archive2@ldap2.zimbra.DOMAIN.com.archive galsync@test2.zimbra.DOMAIN.com testuser2@test2.zimbra.DOMAIN.com $ zmprov -l sa "amavisArchiveQuarantineTo=*" user1@ldap2.zimbra.DOMAIN.com $ zmprov ga user1@`zmhostname` | egrep -i "zimbraArchiveEnabled|amavisArchiveQuarantineTo|\ zimbraArchiveAccount:|zimbraIsSystemResource" amavisArchiveQuarantineTo: user1-archive1@ldap2.zimbra.DOMAIN.com.archive, user1-archive2@ldap2.zimbra.DOMAIN.com.archive zimbraArchiveAccount: user1-archive1@ldap2.zimbra.DOMAIN.com.archive zimbraArchiveAccount: user1-archive2@ldap2.zimbra.DOMAIN.com.archive zimbraArchiveEnabled: TRUE zimbraIsSystemResource: FALSE $ zmprov -l sa "zimbraIsSystemResource=TRUE" galsync.cs_37n5wp@ldap2.zimbra.DOMAIN.com galsync@test2.zimbra.DOMAIN.com ham.0zrc899s@ldap2.zimbra.DOMAIN.com spam.gktt7hym36@ldap2.zimbra.DOMAIN.com user1-archive1@ldap2.zimbra.DOMAIN.com.archive user1-archive2@ldap2.zimbra.DOMAIN.com.archive virus-quarantine.o944yi8wwl@ldap2.zimbra.DOMAIN.com $ zmprov -l sa "zimbraIsSystemResource=FALSE" user1@ldap2.zimbra.DOMAIN.com $ zmprov fc -a all ; zmsoap -z GetLicenseRequest | egrep 'TotalAccounts|ArchivingAccounts' <attr name="ArchivingAccountsLimit">10000</attr> <attr name="TotalAccounts">3</attr> <attr name="ArchivingAccounts">1</attr>
Need To Find A&D Accounts On Wrong MailStore To Move Them
Searching For Accounts On A Particular Mailstore
To do ldapsearch for the account, and see if there are any related entries in ldap.
su - zimbra source ~/bin/zmshutil zmsetvars ldapsearch -x -H $ldap_master_url -D $zimbra_ldap_userdn -w $zimbra_ldap_password "zimbraMailHost=YOURMAILSTORE.COM" | grep "archive.domain.com"
Renaming Production Domain And Want To Also Rename Archive Domain
- This was tested against ZCS 608p1.
There is no 'automatic' process to rename the associated targeted archive email addresses of the user or the archive domain when changing/renaming the domain.
- Get all the account details from the production users in regards to the archive acct they are using
- zimbraMailDeliveryAddress & amavisArchiveQuarantineTo
- Example via CLI. My initial production domain was primary.DOMAIN.com and the archive domain was primary.DOMAIN.com.archive :
- $ zmprov ga arch-prod@primary.DOMAIN.com zimbraArchiveAccount
- [Returns] zimbraArchiveAccount: arch-prod@primary.DOMAIN.com.archive
- $ zmprov ga arch-prod@primary.DOMAIN.com amavisArchiveQuarantineTo
- [Returns] amavisArchiveQuarantineTo : arch-prod@primary.DOMAIN.archive
- $ zmprov ga arch-prod@primary.DOMAIN.com zimbraArchiveAccount
- Prepare a script that will redo those variables, you'll run it after the domain renames.
- Example via CLI. My initial archive domain was primary.zimbra.homeunix.com.archive :
- $ zmprov ma arch-prod@primary71.DOMAIN.com zimbraArchiveAccount arch-prod@primary71.DOMAIN.com.archive
- $ zmprov ma arch-prod@primary71.DOMAIN.com amavisArchiveQuarantineTo arch-prod@primary71.DOMAIN.archive
- Since this is ran after the domain renames, both references in the command about a domain will use the 'new' domainnames.
- Ref: Bulk_Provisioning
- Example via CLI. My initial archive domain was primary.zimbra.homeunix.com.archive :
- Put domains into maintenance mode during a schedule downtime window
- Example:
- zmprov md primary.DOMAIN.com zimbraDomainStatus maintenance
- zmprov md primary.DOMAIN.com.archive zimbraDomainStatus maintenance
- Ref: Ajcody-Server-Misc-Topics#Domain_And_User_.22Status.22_Changes
- Example:
- Rename/forward the production domain
- Rename/forward the archive domain
- Run the script you had prepared earlier that will reset the user variable to their new archive domain.
- Put domains into active mode:
- Example [notice I have the 'new' domainname here] :
- $ zmprov md primary71.DOMAIN.com zimbraDomainStatus active
- $ zmprov md primary71.DOMAIN.com.archive zimbraDomainStatus active
- Example [notice I have the 'new' domainname here] :
- Send a test message to a prod address and you can see/confirm the transaction in the /var/log/zimbra.log on the mta .
Confirmation of things working [examples]:
### From /var/log/zimbra.log on the MTA ### Nov 17 14:42:27 mail71 amavis[7210]: (07210-01) SEND via SMTP: <> -> <arch-prod@primary71.DOMAIN.com.archive>, ENVID=AM.BYPyb4z8Cl0N.20101117T204227Z@mail71.DOMAIN.com BODY=7BIT 250 2.0.0 Ok, id=07210-01, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as C54F623E0E Nov 17 14:42:27 mail71 postfix/smtpd[7446]: DDA5323E10: client=localhost[127.0.0.1] Nov 17 14:42:27 mail71 postfix/cleanup[7262]: DDA5323E10: message-id=<201011172042.oAHKgKG1024723@mail3.zimbra.homeunix.com> Nov 17 14:42:27 mail71 postfix/qmgr[7530]: DDA5323E10: from=<root@mail3.DOMAIN.com>, size=1644, nrcpt=1 (queue active) Nov 17 14:42:27 mail71 amavis[7210]: (07210-01) FWD via SMTP: <root@mail3.DOMAIN.com> -> <arch-prod@primary71.DOMAIN.com>,BODY=7BIT 250 2.0.0 Ok, id=07210-01, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as DDA5323E10
You can also use the CLI to confirm delivery into the archives & production accounts Inbox. For example:
$ zmmailbox -z -m arch-prod@primary71.DOMAIN.com gaf | grep Inbox 2 mess 3 3 /Inbox $ zmmailbox -z -m arch-prod@primary71.DOMAIN.com.archive gaf | grep Inbox 2 mess 3 3 /Inbox
On Why You Have To Change The User Variables
I confirmed in my test that you do have to reset the user variables rather than just relying on the archive domain having a global forwarding. This is what shows up in /var/log/zimbra.log if you just use the domain rename/forwarding and don't reconfigure the user variable.
Nov 17 14:27:05 mail71 postfix/error[26043]: 8E5DD23E0E: to=<arch-prod@primary.DOMAIN.com.archive>, relay=none, delay=0.04, delays=0/0/0/0.03, dsn=5.0.0, status=bounced (User unknown in virtual alias table)
sending directly to archive account, works:
Nov 17 14:37:28 mail71 amavis[7209]: (07209-01) FWD via SMTP: <root@mail3.DOMAIN.com> -> <arch-prod@primary71.DOMAIN.com.archive>,BODY=7BIT 250 2.0.0 Ok, id=07209-01, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 1FCA523E0E
Ajcody HSM Or Hierarchical Storage Management
Actual HSM Or Hierarchical Storage Management Homepage
Please see Ajcody-HSM-Notes
General Q&A
What's It Look Like - Big Picture
HSM requires a new "volume" on the mailstore(s), i.e. the mailbox server. The Zimbra mailbox server(s) starts with dedicated volumes for the [Default paths listed]:
Reference is Zimbra Mailbox Server
- Message Store [/opt/zimbra/store]
- All email messages reside, including the message body and any file attachments.
- Messages are stored in MIME format.
- Each mailbox has a dedicated directory named after its internal Zimbra mailbox ID.
- Note: Mailbox IDs are unique per server, not system-wide.
- HSM Message Store (optional) [there is no default path, you use whatever partition you make for it]
- Hierarchical Storage Management (HSM) allows you to configure storage volumes for older messages.
- To manage your email storage resources, you can implement a different HSM policy for each message server.
- Messages and attachments are moved from a primary volume to the current secondary volume based on the age of the message.
- The messages are still accessible.
- Single-Copy Message Storage
- Single copy storage allows messages with multiple recipients to be stored only once in the file system.
- On UNIX systems, the mailbox directory for each user contains a hard link to the actual file.
- Note - this is limited by the variable in postfix called, default_destination_recipient_limit , which defaults to 50. See the following for more details - Ajcody-Hardlinks-And-Postfix-default_destination_recipient_limit
- Single copy storage allows messages with multiple recipients to be stored only once in the file system.
- All email messages reside, including the message body and any file attachments.
- Index Store [/opt/zimbra/index]
- Data (MySQL) Store [/opt/zimbra/db]
- Backup [/opt/zimbra/backup]
- Log files [/opt/zimbra/log].
Backup And HSM
Please see Bugs/RFE:
- "RFE: HSM and backup should not run at the same time if initated."
- "Separate Restore Mechanism for Primary/Secondary Volumes" [Helix]
- http://bugzilla.zimbra.com/show_bug.cgi?id=18566
- "add backup/restore for HSM only" [marked as duplicate of above]
- http://bugzilla.zimbra.com/show_bug.cgi?id=18566
HSM Impact With Backups
Zimbra mailbox servers cannot see, read, or write to another Zimbra server. The HSM store data is integrated into the mailbox servers normal backup process - they are NOT separate processes. If you find the HSM disks are having an impact on your backup times and you need to get the backup times shorter please look at the following:
- Improving backup performance issues
- See Ajcody-Notes-ServerPlanning#What_About_Backups.3F_I_Need_A_Plan
- Specifically look at Auto-group Backups
- User submitted bug below. I don't think this is going to be possible but activity on the bug might push the dev's & PM's to pursue other options. I believe the current answer to the issue is above, Auto-group backups.
- Add backup/restore for HSM only
- http://bugzilla.zimbra.com/show_bug.cgi?id=28200
- Which was marked as a duplicate of the following RFE
- "Separate Restore Mechanism for Primary/Secondary Volumes"
- Which was marked as a duplicate of the following RFE
- http://bugzilla.zimbra.com/show_bug.cgi?id=28200
- Add backup/restore for HSM only
HSM Impact To Server Performance
HSM currently iterates all mailboxes without pausing. This can result in a big disk/CPU hit. Please see below for more details.
- HSM should run as a background thread
HSM Running During ZCS Restarts
I created this RFE:
- "RFE: batch HSM option to avoid large redolog operations if interrupted"
Customer reported that mailboxd was manually restart during their hsm operation and it resulted in an extended downtime during the zimbra start processes because the hsm activity was in the redologs and had to be processed that way before mailboxd was fully running.
How Does HSM Determine When To Move Message?
Taken from an internal thread within bugzilla.
Question is:
- What date/timestamp does HSM use to determine when to move the message? The time a message is injected or the date/time in the Date: header?
Answer is:
- HSM uses the date that's stored in the database. This is either the time that the message was added or the value specified in the X-Zimbra-Received header.
HSM And Attachments - Any Options?
If you would like to remove attachments (to another type of storage), please see the RFE/bug below. Comment #9 says:
- Today most customers use our built-in HSM to allow for very large mailboxes but
- use cheaper storage. We don't have a way to strip attachments but are looking
- at some options of providing a way to move large attachments optionally to
- either online or offline storage.
Please see the RFE/bug below. Vote on this if you like it.
- Ability to remove attachment from received message
Aging Policy Options For HSM Data
This is needed otherwise your HSM volume would grow indefinitely.
Please see the following RFE and vote on it.
- Zimbra Message Store & HSM Aging Policies
What Doesn't Get HSM'd?
It's basically messages that get HSM'd. Here's some RFE/bug's I've found for missing items.
Wiki Items
RFE filed, please see:
- Zmhsm does not move wiki blobs
Document & Wiki Version Items
Please see:
- HSM should be able to handle Document revisions.
Briefcase Items
RFE filed, please see:
- RFE: moving briefcase items to secondary storage during HSM process
Does The Mailbox Go Into Maintenance Mode?
This was fixed in 5.0.3. Please see the following bug.
- HSM should not put mailbox in maintenance mode
HSM Logging
I found this RFE, it might prove useful.
- HSM logging improvements
More Than One HSM Volume (Secondary Message Store)
There is a RFE for this, please see the following:
- Add support for more than one current secondary storage volume in HSM
HSM/Secondary Volume for Spam & Junk
I'm not sure exactly what the details and dependencies are with this bug. I added a comment for clarity.
Please see the follow:
- Junk mail storage (secondary/HSM volume for Spam messages)
Consistency Checking Tool For HSM
This is available with zmblobchk, which checks messages in general.
Please see the RFE that it was built for for more information:
- Tool to do consistency checks and repair for missing blob for ID x
What If HSM Volume Becomes Full?
Q: What would happen if the HSM volume filled up while the HSM process was moving messages from the primary store to HSM store? Would it detect the full volume and abort the transaction(s) or would it keep trying? Is it possible that any mail would be lost if the HSM store filled up during an HSM run?
- A. It's transactional, so it will fail gracefully. More specifically, if anything goes wrong during the file copying process, we delete any copied files and abort. The volume id of messages processed before the failure remains the same. HSM runs one mailbox at a time, so the rollback only happens for the last mailbox.
Restoring HSM Volumes - RFE
Please see:
- "Separate Restore Mechanism for Primary/Secondary Volumes"
- http://bugzilla.zimbra.com/show_bug.cgi?id=18566
- Work around in the meantime is in bug notes [private]. Support can help you with this.
- http://bugzilla.zimbra.com/show_bug.cgi?id=18566
A How-To Example - CLI
Introduction
This is a testing example. You should adjust these steps to use a REAL PARTITION and NOT A DIRECTORY in the steps listed below.
Create The HSM Volume
Normally you would have the HSM volume as a separate partition on the server - the lower performance disks when compared to the partition the mailstore is using.
To do a "dry" test, I did the following.
As root.
[root@mail3 ~]mkdir /opt/zimbra/hsm [root@mail3 ~]chown zimbra:zimbra /opt/zimbra/hsm
Then switch to zimbra.
[zimbra@mail3 ~]su - zimbra [zimbra@mail3 ~]zmvolume -a -n hsm-volume -t secondaryMessage -p /opt/zimbra/hsm [zimbra@mail3 ~]zmvolume -l Volume id: 2 name: index1 type: index path: /opt/zimbra/index compressed: false current: true Volume id: 1 name: message1 type: primaryMessage path: /opt/zimbra/store compressed: false current: true Volume id: 3 name: hsm-volume type: secondaryMessage path: /opt/zimbra/hsm compressed: false current: false
Set HSM Volume To Current
Now let's set the hsm-volume to "current". Otherwise, if you try to run zmhsm you'll get a error of "invalid request: None of the secondary message volumes are marked as current."
[zimbra@mail3 ~]$zmvolume -sc -id 3 [zimbra@mail3 ~]$zmvolume -l Volume id: 2 name: index1 type: index path: /opt/zimbra/index compressed: false current: true Volume id: 1 name: message1 type: primaryMessage path: /opt/zimbra/store compressed: false current: true Volume id: 3 name: hsm-volume type: secondaryMessage path: /opt/zimbra/hsm compressed: false current: true
Starting HSM For First Time
This is example is on a test server of mine. I don't have any messages older than 30 days. The default global configuration for HSM Age is 30 days.
[zimbra@mail3 ~]$ ls /opt/zimbra/hsm/ [zimbra@mail3 ~]$ crontab -l | grep -i hsm [zimbra@mail3 ~]$ zmhsm -t HSM process started. [zimbra@mail3 ~]$ zmhsm -u Last HSM Session Stats ---------------------- Start time: Fri Aug 15 15:48:58 EDT 2008 End time: Fri Aug 15 15:48:58 EDT 2008 Not currently running. Moved 0 blobs dated earlier than Wed Jul 16 15:48:58 EDT 2008 to volume 3. Mailboxes processed: 7 out of 7. [zimbra@mail3 ~]$ ls /opt/zimbra/hsm/ [zimbra@mail3 ~]$ zmprov gacf | grep zimbraHsmAge zimbraHsmAge: 30d
So, it worked but didn't have anything to Age.
Adjusting the zimbraHsmPolicy variable - ZCS 6+
Default policy [ZCS 8.6] :
$ zmprov gacf zimbraHsmPolicy zimbraHsmPolicy: message,document:before:-30days
$ zmprov desc -a zimbraHsmPolicy zimbraHsmPolicy The policy that determines which mail items get moved to secondary storage during HSM. Each value specifies a comma-separated list of item types and the search query used to select items to move. See the spec for <SearchRequest> for the complete list of item types and query.txt for the search query spec. type : string value : callback : immutable : false cardinality : multi requiredIn : optionalIn : globalConfig,server flags : serverInherited defaults : message,document:before:-30days min : max : id : 1024 requiresRestart : since : 6.0.0_BETA2 deprecatedSince :
Adjusting the zimbraHsmAge variable - Deprecated since: 6.0.0_BETA2.
$ zmprov desc -a zimbraHsmAge zimbraHsmAge Deprecated since: 6.0.0_BETA2. deprecated in favor for zimbraHsmPolicy. Orig desc: Minimum age of mail items whose filesystem data will be moved to secondary storage.. Must be in valid duration format: {digits}{time-unit}. digits: 0-9, time-unit: [hmsd]|ms. h - hours, m - minutes, s - seconds, d - days, ms - milliseconds. If time unit is not specified, the default is s(seconds). type : duration value : callback : immutable : false cardinality : single requiredIn : optionalIn : globalConfig,server flags : serverInherited defaults : 30d min : 0 max : id : 8 requiresRestart : since : deprecatedSince : 6.0.0_BETA2
zimbraHsmAge must be a valid duration of: nnn[hsmd]
- "zimbraHsmAge variables unclear from output"
[zimbra@mail3 ~]$ zmprov mcf zimbraHsmAge 30d ### example initially had to reproduce issue for my RFE - please don't use 1d ### ### [zimbra@mail3 ~]$ zmprov mcf zimbraHsmAge 1d ### [zimbra@mail3 ~]$ zmprov gacf | grep zimbraHsmAge zimbraHsmAge: 1 [zimbra@mail3 ~]$ zmhsm -t HSM process started. [zimbra@mail3 ~]$ zmhsm -u Last HSM Session Stats ---------------------- Start time: Fri Aug 15 15:56:39 EDT 2008 End time: Fri Aug 15 15:56:40 EDT 2008 Not currently running. Moved 63 blobs dated earlier than Fri Aug 15 15:56:38 EDT 2008 to volume 3. Mailboxes processed: 7 out of 7. [zimbra@mail3 ~]$ ls /opt/zimbra/hsm/ 0 [zimbra@mail3 ~]$ ls /opt/zimbra/hsm/0/ 1 14 15 3
The above commands modified the zimbraHsmAge as a global setting. You can also modify it on a server basis.
[zimbra@mail3 ~]$ zmprov gs mail3.internal.homeunix.com | grep zimbraHsmAge zimbraHsmAge: 1d [zimbra@mail3 ~]$ zmprov gacf | grep zimbraHsmAge zimbraHsmAge: 1d [zimbra@mail3 ~]$ zmprov ms mail3.internal.homeunix.com zimbraHsmAge 30d [zimbra@mail3 ~]$ zmprov gs mail3.internal.homeunix.com | grep zimbraHsmAge zimbraHsmAge: 30d [zimbra@mail3 ~]$ zmprov gacf | grep zimbraHsmAge zimbraHsmAge: 1d
Moving zimbraHsmAge Back To A Lower Number
Continuing after the above steps, let's see what happens if we now run zmhsm.
[zimbra@mail3 ~]$ zmhsm -t HSM process started. [zimbra@mail3 ~]$ zmhsm -u Last HSM Session Stats ---------------------- Start time: Fri Aug 15 16:09:05 EDT 2008 End time: Fri Aug 15 16:09:05 EDT 2008 Not currently running. Moved 0 blobs dated earlier than Fri Aug 15 16:08:35 EDT 2008 to volume 3. Mailboxes processed: 7 out of 7.
Did the message files get moved back?
[zimbra@mail3 ~]$ find /opt/zimbra/store/0/15 -name *.msg -print [zimbra@mail3 ~]$ find /opt/zimbra/hsm/0/15 -name *.msg -print /opt/zimbra/hsm/0/15/msg/0/269-21.msg /opt/zimbra/hsm/0/15/msg/0/263-10.msg /opt/zimbra/hsm/0/15/msg/0/268-14.msg /opt/zimbra/hsm/0/15/msg/0/261-8.msg /opt/zimbra/hsm/0/15/msg/0/266-13.msg /opt/zimbra/hsm/0/15/msg/0/259-4.msg /opt/zimbra/hsm/0/15/msg/0/265-12.msg /opt/zimbra/hsm/0/15/msg/0/257-2.msg
Nope. I'm not sure what else to add here. Don't know if there's actually a way to move them back.
RFE - To Move Msg's Back To Primary Store
Please see:
- "HSM - should move messages back to main store if date to HSM was changed" [marked as WONTFIX]
It is possible to move blobs between volumes using the zmsoap command for ZCS 6 and above. Please read the source documents on this on your ZCS server in /opt/zimbra/docs - the two files are soap-admin.txt and soap.txt . The reference your looking for is MoveBlobsRequest, in the soap-admin.txt guide. To build the proper query, you'll also want to consult the soap.txt guide. As of ZCS 8, it reads as:
<MoveBlobsRequest types="{types}" sourceVolumeIds="{volume-ids}" destVolumeId="{volume-id}" [maxBytes="{n}"]> [<query>{search-query}</query>] </MoveBlobsRequest> <MoveBlobsResponse numBlobsMoved="{n}" numBytesMoved="{n}" totalMailboxes="{n}"/> Moves blobs between volumes. Unlike HsmRequest, this request is synchronous, and reads parameters from the request attributes instead of zimbraHsmPolicy. types: a comma-separated list of item types, or "all" for all types. See the spec for <SearchRequest> for details. volume-ids: a comma-separated list of volume ids. query: if specified, only items that match this query will be moved. maxBytes: Limit for the total number of bytes of data to move. Blob move will abort if this threshold is exceeded.
Some examples are listed below, please check your volume id's with zmvolume -l - you will NOT want to run these examples without updating the volume id's. The HSM policy and MoveBlobsRequest are search based, so you can add a query like this:
zmsoap -z MoveBlobsRequest @types=all @sourceVolumeIds=3 @destVolumeId=4 query=is:anywhere
An "is:anywhere" query will look in all folders, including /Trash for messages to move.
A query just in junk would be like the following below. This will move every blob for every mailbox located in volume 1 to volume 3 that is under the junk folder.
zmsoap -z MoveBlobsRequest @sourceVolumeIds=1 @destVolumeId=3 query=in:junk
Or you can specify a date:
zmsoap -z MoveBlobsRequest @sourceVolumeIds=1 @destVolumeId=3 query=before:1/1/2012
MoveBlobsRequest will move the blob and update mysql mail_item table accordingly.
Old Note Below
The desperate, could review the following. This would be an unsupported procedure. I'll try to engage developers on this and get some feedback though:
Now What? Place In Cron
You will have to manually put in the zimbra crontab file a line to run the zmhsm command.
Something like the following at the end of the crontab [ su - zimbra ; crontab -e ] :
# HSM 0 6 * * * /opt/zimbra/bin/zmhsm -t
This will run every morning at 0600. The question of each administrator is what is the right time to run this. I'm initial thought is to try and kick it off after your backups. One might want to have two entries for the zmhsm command, one after your daily incremental and another time frame for you full backup days.
Checking For The HSM Zimlet
In the Admin web console, you'll see the reference to the HSM zimlets in this path:
Configuration > Admin Extensions > com_zimbra_hsm
Deploying The HSM Zimlet
To deploy the zimlet for HSM
su - zimbra zmzimletctl deploy /opt/zimbra/zimlets-network/com_zimbra_hsm.zip
Log into the admin web console - fresh session.
What Can I Do For HSM In The Admin Web Console?
Confirm the HSM zimlet is installed first.
Setup The HSM Volume
Configuration > Servers > [Server For HSM Volume]
Then select the Volumes tab on the right-hand section.
Clicking on "Add", you'll be given a drop down chooser for "Volume Type". For HSM, you would select "Secondary Message".
The "Assign Current Volumes" section will show you what volume is in use for what function.
You will also see "HSM" on this page to set the zimbraHsmAge variable for the SERVER - rather than globally.
Adjust The zimbraHsmAge Date
Per Server
Configuration > Servers > [Server For HSM Volume]
Then select the Volumes tab on the right-hand section.
You will see "HSM" on this page to set the zimbraHsmAge variable for the SERVER - rather than globally.
Global
Configuration > Global Settings
The select the HSM tab on the right-hand section.
This will set the global (default) message age for HSM.
Starting & Stopping HSM (zmhsm)
Configurations > Servers > [Server With HSM Volume]
The on the right-hand section, above the details area for the server you'll see a button/tab HSM. Click on this and you'll be given the option to Start HSM Session. It will output progress details.
References From Official Documentation
zmhsm - command for HSM
Please see:
CLI_zmhsm_Network_Edition_only
zmvolume - command for volumes
Please see:
http://wiki.zimbra.com/index.php?title=CLI_zmvolume
Global HSM Session Setting
Reference: http://www.zimbra.com/docs/ne/latest/administration_guide/Managing_ZCS.10.1.html#1111022
Global Settings HSM (Hierarchical Storage Management) sets the default message age threshold to 30 days. The HSM global setting is the default unless you change the schedule in the Server configuration. See “Scheduling HSM Sessions” .
Scheduling HSM Sessions
Reference: http://www.zimbra.com/docs/ne/latest/administration_guide/Managing_ZCS.10.1.html#1111045
HSM can be configured for secondary storage volumes for older messages. Messages and attachments are moved from a primary volume to the current secondary volume based on the age of the message. Users are not aware of any change and do not see any noticeable difference when opening an older message that has been moved.
To manage your email storage resources, you can implement a different HSM policy for each mailbox server. The message age threshold for HSM is set globally on the HSM tab or for individual servers from the Server Volume tab. The default is 30 days. The thresholds configured on individual servers override the threshold configured as the global setting. Sessions to move messages to the secondary volume are scheduled in your cron table. From the administration console, when you select a server, you can manually start a session, monitor sessions, and abort sessions that are in progress from the Volumes tab.
When you abort a session and then restart the process, the HSM session looks for entries in the primary store that meet the HSM age criteria. Any entries that were moved in the previous run would be excluded, as they would no longer exist in the primary store.
![]() |
A Proxy On You!
Actual Proxy Notes Homepage
Please see Ajcody-Proxy-Notes
Very Rough Draft For Proxy Trouble Shooting Script - More of steam of consciousness really
Do the following on one of your ZCS servers:
$ su - zimbra $ touch /tmp/proxy_support.sh $ chmod +x /tmp/proxy_support.sh
Now just vi /tmp/proxy_support.sh again and cut and paste the contents below and save the file. Make sure your not getting odd line wrapping. If you do, try clicking on the view source option at the top of the wiki page and see if that allows your paste into your shell/vi to work better. Note - I removed the leading spaces one would normally use to make the script an easier read since it causes a paste to be a horrible format.
To Do Items: Have a table formatted output, like "Variable Name | Global | ServerA | ServerB | Server C | Server D | Server E | Description of Var | Recommendations" and to include a * next to a variable if we know it should be set to something else when compared to other vars in the environment.
#!/bin/bash printf "\nProxy Trouble Shooting Script For ZCS 8+ Servers\n\n" printf "\n\n Reference: https://wiki.zimbra.com/wiki/Ajcody-Proxy-Notes#Very_Rough_Draft_For_Proxy_Trouble_Shooting_Script_-_More_of_steam_of_consciousness_really.\n\n" ### Global Configurations printf "\n\n## Getting Some Global Variables ##\n\n" printf "## GARPU [getAllReverseProxyURLs] - Used to publish into nginx.conf what servers should be used for reverse proxy lookup.\n" printf "## Output from zmprov garpu ##\n\n `zmprov garpu` \n\n" printf "## GARPB [getAllReverseProxyBackends] - no description at this time.\n" printf "## Output from zmprov garpb ##\n\n `zmprov garpb` \n\n" printf "## GARPD [getAllReverseProxyDomains] - no description at this time.\n" printf "Output from zmprov -l garpd ##\n\n `zmprov -l garpd` \n\n" printf "## GAMCS [getAllMemcachedServers] - Used to list memcached servers (for nginix use).\n" printf "Ouput from zmprov gamcs ##\n\n `zmprov gamcs` \n\n" ; printf "## Some Global Configs from the following command: ##\n" printf "## [zimbra@]$ zmprov gcf | egrep 'zimbraWebClientLogoutURL|zimbraWebClientLoginURL|zimbraMailURL|zimbraMailReferMode|zimbraReverseProxySSLToUpstreamEnabled|zimbraMailProxyReconnectTimeout|zimbraMailProxyMaxFails' \n\n" zmprov gacf | egrep 'zimbraWebClientLogoutURL|zimbraWebClientLoginURL|zimbraMailURL|zimbraMailReferMode|zimbraReverseProxySSLToUpstreamEnabled|zimbraMailProxyReconnectTimeout|zimbraMailProxyMaxFails' printf "## [For ZCS8+] If zimbraReverseProxySSLToUpstreamEnabled is set to TRUE then zimbraMailMode on the server should NOT be set to http. It should be either https or both. \n\n" printf "## For details on zimbraMailProxyReconnectTimeout & zimbraMailProxyMaxFails , see https://bugzilla.zimbra.com/show_bug.cgi?id=80135 . Recommendation [ZCS8+] is to set to 0 , when encountering 502/504 timeout errors. \n\n" printf "\n\n Continuing To The Specific Server Variables...\n\n" zmlicense -p ### Server Configuration for server_hostname in `zmprov gas` do printf "## Need IP Information For Server $server_hostname . Using /etc/resolv.conf on local server to resolve.##\n\n" printf "`host $server_hostname` \n\n" printf "## Checking Enabled Services For Server $server_hostname ##\n\n" zmprov gs $server_hostname | grep ServiceEnabled printf "\n## Checking Running Services For $server_hostname ##\n\n" zmcontrol -H $server_hostname status printf "\n\n## Checking for Some Proxy Variables On $server_hostname ##\n\n" zmprov gs $server_hostname | egrep 'zimbraReverseProxyHttpEnabled|zimbraReverseProxyMailEnabled|zimbraMailReferMode|zimbraMailMode|zimbraReverseProxySSLToUpstreamEnabled|zimbraMailProxyReconnectTimeout|zimbraMailProxyMaxFails' printf "## [For ZCS8+] If zimbraReverseProxySSLToUpstreamEnabled is set to TRUE then zimbraMailMode on the server should NOT be set to http. It should be either https or both. \n\n" printf "## For details on zimbraMailProxyReconnectTimeout & zimbraMailProxyMaxFails , see https://bugzilla.zimbra.com/show_bug.cgi?id=80135 . Recommendation [ZCS8+] is to set to 0 , when encountering 502/504 timeout errors. \n\n" printf "\n\n## Checking for Some Proxy Port Variables On $server_hostname ##\n\n" zmprov gs $server_hostname | grep Port printf "\n\n## Checking for zimbraReverseProxyLookupTarget ; if TRUE then you should be able to telnet to port 7072 on that server. ##\n" printf "## telnet $server_hostname:7072 \n" printf "## If $server_hostname shouldn't be a part of the lookup pool. You can remove it by doing:\n" printf "## [zimbra@]$ zmprov ms $server_hostname zimbraReverseProxyLookupTarget FALSE \n" printf "## Then check the output of zmprov garpu:\n" printf "## [zimbra@]$ zmprov garpu \n" printf "## Then rebuild the configs on all the PROXIES and restart (one at a time is fine):\n" printf "## [zimbra@]$ zmnginxctl restart \n" printf "## After doing this, check that $server_hostname is no longer listed in any proxy configs on all proxies:\n" printf "## [zimbra@]$ grep $server_hostname /opt/zimbra/conf/nginx/includes/*\n" printf "## $server_hostname Currently has zimbraReverseProxyLookupTarget set to:\n\n" zmprov gs $server_hostname | grep zimbraReverseProxyLookupTarget printf "\n\n Finished Getting Variables for $server_hostname.\n\n" done ### Domain Configuration for domain in `zmprov gad` do printf "## Getting Some Domain Information.##\n\n" printf "Getting Information for $domain \n\n" printf "## Getting zimbraVirtualHostName And zimbraVirtualIPAddress Information for $domain ##\n\n" zmprov gd $domain | grep zimbraVirtual printf "## Getting zimbraPublicServiceHostname, zimbraPublicServicePort And zimbraPublicServiceProtocol for $domain ##\n\n" zmprov gd $domain | grep zimbraPublicService printf "\n\n Finished Getting Variables for $domain.\n\n" done printf "\n\n Script Complete.\n\n"
Not Finished Part
Not Finished - Need to now adjust how to handle non-zcs commands to be executed on remote hosts . I would like to be able to add to this script but can't with a default multi-server ZCS environment.
Notes on limitations:
- The below isn't effective for what we need because of the limitation noted after it.
- ssh -i .ssh/zimbra_identity -o strictHostKeyChecking=no zimbra@server.domain.com -p 22
- cat /opt/zimbra/.ssh/authorized_keys will give you something like:
- command="/opt/zimbra/libexec/zmrcd" ssh-dss AAAAB3NzaC1kc3MAA [cut] A== zcs806.us.zimbralab.com
- zmrcd restricts what commands can be ran, cat /opt/zimbra/libexec/zmrcd to see.
## cut - ifconfig output instead of using host $server_hostname for server_hostname in `zmprov gas` do printf "## Need IP Information For Server $server_hostname ##\n\n" printf "`ifconfig -a` \n\n" ## cut printf "\n\n## Checking for Some Proxy Port Variables On $server_hostname ##\n\n" zmprov gs $server_hostname | grep Port printf "\n\n## Confirmig Ports Are Available ## \n\n" ZCSPXYPORTS=\'`zmprov gs $server_hostname | grep Port | cut -d':' -f2 | tr '\n' '|' | tr -d ' ' | xargs echo`\' netstat -plnt | egrep `echo $ZCSPXYPORTS` ## cut
UPDATE PLEASE SEE THESE FIRST
No Route To Host
[working draft]
If your getting "No route to host" errors in /opt/zimbra/log/nginx.log files on the proxy servers, you should check:
- The resolution [DNS] to the host from the proxy servers is correct and working. This might happen more when you've deployed a new ZCS server in your environment.
- Following step one, you also have to confirm there is port level access to between proxy servers and the server it's trying to reach. memcache port is 11211 .
- The server/s are too busy to serve the request.
- You have a server in the list that shouldn't be in the lookup pool or you should remove the trouble server from the pool to avoid any more customer issues to deescalate the situation.
50X Errors
- 500 Internal Server Error
- A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.
- 502 Bad Gateway
- The server was acting as a gateway or proxy and received an invalid response from the upstream server.
- 503 Service Unavailable
- The server is currently unavailable (because it is overloaded or down for maintenance). Generally, this is a temporary state. Sometimes, this can be permanent as well on test servers.
- 504 Gateway Timeout
- The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.
These following configuration changes for an upstream mailbox server can improve proxy behavior related to timeouts:
- This will configure proxy to immediately reconnect to all mailbox server on any failure
-
$ zmprov mcf zimbraMailProxyReconnectTimeout 0
- If necessary, for each mailbox server
-
$ zmprov ms <mailbox server hostname> zimbraMailProxyReconnectTimeout 0
-
-
- This will configure proxy to ignore failures in regards to disconnects to all mailbox servers
-
$ zmprov mcf zimbraMailProxyMaxFails 0
- If necessary, for each mailbox server
-
$ zmprov ms <mailbox server hostname> zimbraMailProxyMaxFails 0
-
-
- Then, restart all the proxies to regenerate the nginx config files with the updated values for 'fail_timeout' & 'max_fails':
-
$ zmproxyctl restart
See the following bug for more details on this recommendation:
- "Improved proxy timeout defaults"
Admin Guide Update
Our Administration Guide now has everything you should need to setup your proxy server.
Please see:
How To Enable Proxy
And Also Another More Current How-To Enable Proxy here:
My Own Proxy How-To For Setup
Note: We are working on improving the official documentation. I haven't seen the document yet for the 5.0.11 release, but I've been told it will have many improvements.
- See - http://bugzilla.zimbra.com/show_bug.cgi?id=32551
- The final results of this RFE are here now:
Here's my attempt at writing something better in the meantime.
High Level Overview
One Package
First, there's only ONE package or rpm in the installer for "proxy".
Where Does It Get Installed?
It can be installed with any of your Zimbra servers (a complete ZCS install, ZCS MTA, ZCS LDAP, ZCS Mailstore) or on its own server. ( Reference )
Other proxy documentation might give the impression it needs to go onto a zimbra server that is running some other function - mta, ldap, or mailstore.
Three Components To The Package
This package, can be broken down into THREE components.
Nginx
Nginx is a high performance IMAP/POP3 proxy server which handles all incoming POP/IMAP requests. In addition to this, it is also able to reverse proxy HTTP requests to the right backend (mailstore) server. This helps to hide the hostnames of the backend mailbox servers from end users. The steps involved in this lookup are described in more detail under the Flow_Process_For_Proxy_Target_Lookups below.
Memcached
Memcached is a high performance, distributed memory object caching system (an open source distributed in-memory hashtable). Route information is cached for further use in order to increase performance.
Memcache does not have authentication and security features so the servers should have a firewall set up appropriately. The default port is 11211 and is controlled by zimbraMemcacheBindPort conf setting in zimbraserver.
- Note: Memcached will be split into its own service in the future. Meaning, for example, that you'll be able to configure a server to solely perform this function of providing the cache results. This will give more flexibility in managing performance issues, as related to the proxy environment. Rather than the same server having to share cpu/memory resources with nginx. It will also allow you to configure your different servers running nginx to quiry against a "shared" cached table of memcached. Currently, each nginx will have unique results in their memcached tables.
What is being cached, are the prior results of pop and imap lookups of users and their corresponding mailbox server they should be routed to. The process is described below in Flow_Process_For_Proxy_Target_Lookups.
Zimbra Proxy Route Lookup Handler
Zimbra Proxy Route Lookup Handler is a servlet located on the ZCS mailbox servers. This servlet handles queries for the user account route information (the server and port number where the user account resides). This is more about a difference in functionality when the proxy package is being used rather than a "new" software package being installed. The functionality difference is coming from the "software" related to nginx and memcached. The process is described in more detail in Flow_Process_For_Proxy_Target_Lookups.
- NOTE - Again, don't let the reference to "mailbox server" confuse you. The mailbox servers don't need the proxy package installed on them directly to see this effect. The proxy server (whatever one you install it on, will make configuration changes global to handle this function. The referenced servlet is already on a base mailbox server install. This is referring to how the proxy package components will or can interact with that pre-existing servlet on the mailbox server.
Flow Process For Proxy Target Lookups
Here's the flow of the process for pop and imap lookups:
- Nginx will query the LOCAL memcached service first to see if the lookup result has a cached result. [FYI - Memcache runs over port 11211]
- Note: when memcached is allowed to run on another server besides the one where nginx is at, you'll need to account for this port 11211 access between the servers. For now, it's all occurring locally to the server. If you can't access this memcache process, confirm you don't have any firewall/port level blocking occur for the local machine communicating over port 11211.
- If the initial lookups by nginx against the LOCAL memcached service have no results, nginx will then proceed to query against the "Zimbra Proxy Route Lookup Handler" services.
- By default, all mailbox servers participate in this lookup process via the "Zimbra Proxy Route Lookup Handler".
- This "where" to lookup is determined by the zimbraReverseProxyLookupTarget server attribute on servers running the mailbox service.
- The lookups are performed in a round-robin fashion across configured mailbox servers.
- Now that there is a successful lookup, the results are then cached in LOCAL memcached service and future lookups will bypass the "Zimbra Proxy Route Lookup Handler" steps for that specific lookup.
- Meaning, the lookups will solely operate between nginx and LOCAL memcached service and no longer involve the "Zimbra Proxy Route Lookup Handler"/mailbox stores.
- By default, all mailbox servers participate in this lookup process via the "Zimbra Proxy Route Lookup Handler".
Here's the flow of the process for reverse proxy http lookups:
- Nginx will query against the "Zimbra Proxy Route Lookup Handler" services.
- By default, all mailbox servers participate in this lookup process via the "Zimbra Proxy Route Lookup Handler".
- This "where" to lookup is determined by the zimbraReverseProxyLookupTarget server attribute on servers running the mailbox service.
- The lookups are performed in a round-robin fashion across configured mailbox servers.
- Ngninx will perform this lookup for every http request, it does not involve the memcached server for cache results.
- By default, all mailbox servers participate in this lookup process via the "Zimbra Proxy Route Lookup Handler".
Three Functions That Can Be Done With Proxy Package
There are THREE functions or options within Zimbra that relate to "proxy".
IMAP - POP Proxy
IMAP/POP Proxy is about the use of an IMAP/POP proxy server routes users of these services to the Zimbra mailbox server on which their mailbox resides.
For example, proxying allows users to enter imap.example.com as their IMAP server. The proxy running on imap.example.com inspects their IMAP traffic, does a lookup to determine which backend mailbox server a user’s mailbox lives on (mbs1.example.com, for example), and transparently proxies the connection from user’s IMAP client to the correct mailbox server.
Flow Of The Login Process: When an IMAP or POP3 client logs in through the proxy, the following takes place:
- The proxy analyzes the login sequence
- Extracts the user name of the user trying to login
- Does a HTTP lookup on a mailbox server to find out which server the mailbox of the user attempting to login lives on
- This lookup service runs on mailbox servers on port 7072, and this port on mailbox servers should be available from all proxy servers.
- Which mailbox servers participate in this lookup is determined by the zimbraReverseProxyLookupTarget server attribute on servers running the mailbox service.
- By default all mailbox servers participate in this lookup.
- Lookup is performed round-robin across configured mailbox servers.
- The result of the login name to mailbox server lookup are cached in memcached (an open source distributed in-memory hashtable).
- The memcached process is run alongside all IMAP/POP proxy services (nginx). Meaning wherever the proxy package was install and is configured to run.
- Which mailbox servers participate in this lookup is determined by the zimbraReverseProxyLookupTarget server attribute on servers running the mailbox service.
- This lookup service runs on mailbox servers on port 7072, and this port on mailbox servers should be available from all proxy servers.
- Also see Flow_Process_For_Proxy_Target_Lookups, if you have not.
Port Changes For IMAP/POP Proxying: When the proxy server is configured, the service ports on backend Zimbra mailbox server are changed to alternate ports. The proxy now services the standard ports for these protocols. This change is applied even if the proxy services are run on their own independent hosts, in order to distinguish and avoid confusion between the services.
- Here's the changes that will be made on the mailbox servers and what ports will now be handled by the proxy server(s).
- Note: If you have any other services running on these ports, turn them off.
- Standard Ports now server or handled by Proxy server(s)
- IMAP proxy port 143
- IMAP SSL proxy port 993
- POP proxy port 110
- POP proxy port 995
- Mailbox Servers will now work on these alternate ports
- IMAP port 7072
- IMAP SSL port 7143
- POP port 7110
- POP SSL port 7995
- Route Lookup Handler (new port) 7072
- This was described above in regards to the "Flow Of The Login Process".
- Standard Ports now server or handled by Proxy server(s)
- Note: If you have any other services running on these ports, turn them off.
Reverse HTTP Proxy
- Reverse HTTP Proxy
- Using an nginx-based reverse proxy for HTTP helps to hide names of backend mailbox servers from end users. For example, users can always use their web browser to visit the proxy server at http://mail.example.com. The connection from users whose mailbox lives on mbs1. example.com will be proxied to mbs1.example.com by the proxy running on the mail.example.com server. In addition to the ZCS web interface, clients such as REST and CalDAV clients, Zimbra Connector for Outlook and Zimbra Mobile Sync devices are also supported by the proxy.
- HTTP reverse proxy routes requests as follows:
- If the request has an auth token cookie (ZM_AUTH_TOKEN), the request is routed to the backend mailbox server of the authenticated user.
- If the requesting URL can be examined to determine the user name, then the request is routed to the backend mailbox server of the user in the URL. REST, Ca lDAV, and Zimbra Mobile Sync are supported through this mechanism.
- If the above methods do not work, the IP hash method is used to load balance the requests across the backend mailbox servers which are able to handle the request or do any necessary internal proxying.
- HTTP reverse proxy routes requests as follows:
- Using an nginx-based reverse proxy for HTTP helps to hide names of backend mailbox servers from end users. For example, users can always use their web browser to visit the proxy server at http://mail.example.com. The connection from users whose mailbox lives on mbs1. example.com will be proxied to mbs1.example.com by the proxy running on the mail.example.com server. In addition to the ZCS web interface, clients such as REST and CalDAV clients, Zimbra Connector for Outlook and Zimbra Mobile Sync devices are also supported by the proxy.
Virtual Hosting
Please see Ajcody-Server-Misc-Topics#Proxy_.5BNGINX.5D_Virtual_Hosting
Proxy References
NGINX Open-Source Project Homepage
Proxy documentation BUG/RFE's:
- "nginx: update docs"
- "add nginx section to the performance tunning guide"
- "need wiki page on setting up public service hostname and reverse proxy"
From Install Guide':
- Multiple-Server Installation - Installing the Zimbra-proxy package
- Configuring IMAP and POP Proxy Server
- Configuring ZCS HTTP Proxy (Beta 5.0.6)
- Configuring for Virtual Hosting
- Working With Zimbra Proxy (IMAP/POP)
- Working With Zimbra Proxy (HTTP) "...able to reverse proxy HTTP requests to the right backend server"
- Please note, that ZCS HTTP Proxy (http reverse proxy) is Beta, first released in 5.0.6.
- http://www.zimbra.com/docs/os/latest/administration_guide/ZimbraProxy.7.1.html#1099560
From Wiki:
- NGINX Configuration Tips
- Zimbra Proxy Guide (5.x)
- Configuring Perdition (4.5.x)
- Multiple SSL Virtual Hosts 5.0
zmproxyinit Help Output [Oct 16, 2008 - From 5.0.9 I believe]:
[zimbra@mail2 libexec]$ ./zmproxyinit Usage: ./zmproxyinit [-h] [-o] [-m] [-w] [-d [-r] [-s] [-a w1:w2:w3:w4] [-i p1:p2:p3:p4] [-p p1:p2:p3:p4] [-x mailmode]] [-e [-a w1:w2:w3:w4] [-i p1:p2:p3:p4] [-p p1:p2:p3:p4] [-x mailmode]] [-f] -H hostname -h: display this help message -H: Hostname of server on which enable/disable proxy functionality. -a: Colon separated list of Web ports to use. Format: HTTP-STORE:HTTP-PROXY:HTTPS-STORE:HTTPS-PROXY (Ex: 8080:80: 8443:443) -d: disable proxy -e: enable proxy -f: Full reset on memcached port and search queries and POP/IMAP throttling. -i: Colon separated list of IMAP ports to use. Format: IMAP-STORE:IMAP-PROXY:IMAPS-STORE:IMAPS-PROXY (Ex: 7143:14 3:7993:993) -m: Toggle mail proxy portions -o: Override enabled checks -p: Colon separated list of POP ports to use. Format: POP-STORE:POP-PROXY:POPS-STORE:POPS-PROXY (Ex: 7110:110:799 5:995) -r: Disable reverse proxy lookup target for store server. Only valid with -d. Be sure that you intend for all p roxy function for the server to be disabled -s: Set cleartext to FALSE (secure mode) on disable -w: Toggle Web proxy portions -x: zimbraMailMode to use on disable (Default: http) hostname is the value of the zimbra_server_hostname LC key for the server being modified. Required options are -f by itself, or -f with -d or -e. Note that -d or -e require one or both of -m and -w. Note that -i or -p require -m. Note that -a requires -w. Note that -x requires -w and -d for store. Note that -x requires -w for proxy. The following are the defaults for -a, -i, -p, and -x if they are not supplied as options. -a default on enable: 8080:80:8443:443 -a default on disable: 80:0:443:0 -i default on enable: 7143:143:7993:993 -i default on disable: 143:7143:993:7993 -p default on enable: 7110:110:7995:995 -p default on disable: 110:7110:995:7995 -x default on store disable: http -x default on proxy enable/disable: http
What's Wrong?
Did you check in /opt/zimbra/log/nginx.log ?
Notable Proxy Bugs
Unresolved At This Time (Sept 25, 2008)
- "RFE: Provide way to have different proxy backends and lookup urls on different Nginx hosts"
- "Proxy: unable to add a buddy"
- "In reverse-proxied mode, when redirecting with a 302, web client should set Location to proxy provided Host header"
- "nginx fails to redirect the request to mail server if i request using the alias of proxy"
- "Nginx: httpproxy infinite loop scenario"
- "multiple SSL certificates on one server"
- See : http://bugzilla.zimbra.com/show_bug.cgi?id=8128
- Allot of private comment details unfortunately.
- See : http://bugzilla.zimbra.com/show_bug.cgi?id=8128
Unsorted
- "ZCS Mailbox Server Proxy"
- See: http://bugzilla.zimbra.com/show_bug.cgi?id=9469
- From release notes, "HTTP proxy is supported (Beta). This includes REST sharing, Caldav, and Zimbra mobile. For Zimbra Mobile, ZCS redirect/forwards to the correct host. (Bug 9469)"
- Please note, that ZCS HTTP Proxy (http reverse proxy) is Beta, first released in 5.0.6.
- Though, as of 5.0.8,""For activesync connection to go thru the proxy, they'll have to configure reversed proxy. However, there're already a few known bugs about sharing broken with reversed proxy enabled. They're better off waiting for 5.0.9 than to try to configure reversed proxy now."
- "need to support multi-server (proxy) for mobile clients"
- See: http://bugzilla.zimbra.com/show_bug.cgi?id=8174
- Is listed as a dup of http://bugzilla.zimbra.com/show_bug.cgi?id=9469
Resolved In 5.0.9
Those That Are Sort Of Client Side Impacting
- "Enabling http proxy breaks sharing"
- "Inconsistent default mail/proxy mode"
- "WRONG_HOST error while viewing a public shared doc using http proxy"
- "mailbox does not load with zimbraPublicServiceHostname and reverse proxy enabled"
- "Modify SOAP harness to handle session ID to work with proxy"
- "mod_zimbra_proxy infinite redirect"
Configuration / Initial Setup Issues
- "Remove requirement that zimbraPublicServiceHostname have a corresponding zimbraServer object"
- "Remove hostname argument from zmproxyinit"
- "Zmmtaconfig does not monitor several imap proxy variables"
- "Zmproxyconfgen should not generate from templates if critical values are missing"
- "Zmproxyconfgen does not set $? correctly on error"
- "zmproxyconfgen -P has no effect"
- "Webproxy https in mixed mode does not stay in https"
- "Upgrade: starttls mode changed in nginx.conf"
- "better GSSAPI support in nginx"
- "nginx mail proxy does not translate kerberos principal name to zimbra user-name"
Resolved in 5.0.7
- "Proxy section of admin guide needs to be updated"
- "Zmproxyinit -e -w -x is not allowed"
- "Zmproxyinit does not set zimbraReverseProxyLookupTarget for store only server"
- "Zmproxyinit -e -w port conflict on store only install"
- "Zmproxyinit -e -w failure on proxy only install"
- "Zmproxyinit: can not run zmproxyinit on mbs without proxy installed"
- "Need attribute to track proxy mailmode"
- "nginx: zmproxygen needs to get attributes from server if an attribute is server/global"
- "Zmproxyinit -e -w failure on single node install"
- "zimbra imap/pop clear text not enabled for mail proxy install"
- "nginx: http proxy needs to have the rewrite module built in"
- "nginx: HTTP proxy configuration scripts need to be updated to reflect various mail modes"
- "nginx: http proxy should support all mail modes"
- "nginx: improve http proxy Location header fudging capabilities"
- "nginx uses client-ip instead of proxy-ip when caching login alias"
- "nginx http proxy should route by zauthtoken query-string argument"
- "Improvements to zmproxyinit"
- "zmproxyinit sets the wrong mail mode"
- "nginx doesn't proxy caldav"
- Appears to be about webdav issues and others as well.
- http://bugzilla.zimbra.com/show_bug.cgi?id=27042
- "Zmproxyinit hard code port settings"
- "Isync (REST) Needs To Work With Nginx Http Proxy"
- Note, many issues were still unresolved with this "resolved" bug. You'll see them above.
- Also, see notes under "ZCS Mailbox Server Proxy" under the Ajcody-Server-Topics#Unsorted section below.
- See: http://bugzilla.zimbra.com/show_bug.cgi?id=25981
Resolved in 5.0.6
Public Service Hostname
- The variable is zimbraPublicServiceHostname , as referenced in /opt/zimbra/openldap/etc/openldap/schema/zimbra.schema . Bugs about the url's for shares that use spaces (%20), the redirection drops the %20
Resolved in 5.0.5
- Nginx: http proxy does not work with REST
- Note, this isn't "completely" resolved, as you'll notice by other targeted bugs with 5.0.5+ releases.
- See: Nginx: http proxy does not work with REST
Single ZCS Server
Need To Disable Pop/Imap Proxy And Use POP/IMAP Normally
Sometimes, people install/setup proxy services on their single ZCS server and they don't need them. Here's how you would disable the proxy stuff and get imap/pop working over the default ports.
do a zmprov -l gs `zmhostname` | grep -i port get the ports, then set variables to port 0: zmprov ms `zmhostname` zimbraImapProxyBindPort 0 zmprov ms `zmhostname` zimbraImapSSLProxyBindPort 0 zmprov ms `zmhostname` zimbraPop3ProxyBindPort 0 zmprov ms `zmhostname` zimbraPop3SSLProxyBindPort 0 then, set the non "Proxy" ports to the desired standard ports zmprov ms `zmhostname` zimbraImapBindPort 143 zmprov ms `zmhostname` zimbraImapSSLBindPort 993 zmprov ms `zmhostname` zimbraPop3BindPort 110 zmprov ms `zmhostname` zimbraPop3SSLBindPort 995 once complete: zmprov ms `zmhostname` -zimbraServiceEnabled memcached zmprov ms `zmhostname` -zimbraServiceEnabled imapproxy zmproxyctl stop zmmemcachedctl stop zmmailboxdctl stop zmmailboxdctl start
Proxy Guide Rewrite Scratch Pad
Intro
Moved to Ajcody-Proxy-Guide-Rewrite-Project
Clustering Topics
Actual Clustering Topics Homepage
Please see Ajcody-Clustering
My Other Clustering Pages
- Ajcody-Notes-Upgrade-Options#Upgrade_Steps_for_Multi-Servers_with_Clustered_Mailstores
- Ajcody-Notes-Of-Customer-Cluster-Upgrade
RFE I made based upon the experience above:
- "QA & Corrections For Cluster Upgrade Document"
Clustering For ZCS 8 And Above
ZCS 8 Specifics
From the ZCS 8.0.5 Release Notes:
Red Hat Cluster Suite is not available with ZCS 8.0 To streamline support efforts, we will only test and certify in house availability solutions. Today VMware offers clustering failover and automated recovery through VMware HA. Zimbra integrates with the VMware HA cluster infrastructure to heartbeat Zimbra application services and provide automated recover in the event of a service failure. (Bugs 72215/72216)
- Private bugs about the EOL of RHCS
- Deprecate RHCS in 7.2
- EOL RHCS
If you use Zimbra Clustering
Zimbra Clustering is no longer available for ZCS 8.0. VMware provides integrated high availability between Zimbra and VMware HA for automated recovery of critical Zimbra application services and server components in the event of an application or infrastructure failure. Third party solutions such as network load balancers, storage mirroring, or OS clustering solutions like Red Hat Cluster Suite may be used in your deployment, but are not specifically tested or certified by VMware. (Bug75821)
- Clustering not in ZCS 8.0
Statement On Zimbra Support And "Clustering" For ZCS 8+ [In My Own Words - Ajcody]
I've sent this off to our PM team to review and to provide formal comments and documentation updates on it. - Ajcody
Official and Full support are NOT terms Zimbra Support applies to Redhat RHCS or Vmware's Clustering options since our team does not support either of those two options directly. We do not support customers in configuring or trouble-shooting the clustering components for Redhat's RHCS or Vmware's Clustering.
Will and can RHCS and Vmware's Clustering work with ZCS, yes. Does our team offer support in configuring, trouble-shooting, or diagnosing the clustering component of the setup - no. You would need to contact Redhat if you went with RHEL and RHCS or Vmware and your Linux OS distribution support channel if you went with Vmware Clustering.
Note - The zimbra clustering zimlets are completely removed with ZCS 8.6 . The Vmware clustering monitoring scripts are a separate issues that falls outside of general clustering support.
Future Releases After ZCS 8
Please see the following blog about our Always ON, Carrier Grade Architecture HA features we are hoping to have in future releases:
- http://blog.zimbra.com/blog/archives/2013/09/project-always-on.html
- http://blog.zimbra.com/blog/archives/2013/04/zimbra-judaspriest-release-update-1.html
Vmware Virtualization and Clustering
Overview
From the ZCS 8.0.5 Release Notes:
Red Hat Cluster Suite is not available with ZCS 8.0 To streamline support efforts, we will only test and certify in house availability solutions. Today VMware offers clustering failover and automated recovery through VMware HA. Zimbra integrates with the VMware HA cluster infrastructure to heartbeat Zimbra application services and provide automated recover in the event of a service failure. (Bugs 72215/72216)
- Private bugs about the EOL of RHCS
- Deprecate RHCS in 7.2
- EOL RHCS
VMware Heartbeat Service
ZCS utilizes the VMware application programming interface that allows software providers to deploy application monitoring components inside a VMware guest OS and inform VMware HA when problems arise. The VMware-heartbeat service provides information to the VMware HA components on the health and availability of the ZCS. If you have VMware HA components installed, the VMware HA service is shown as enabled on the Server>Services page.
General Description of VMware HA
VMware HA provides a simple, reliable way to increase the availability of virtual machines hosting critical applications. VMware HA is a visualization- based distributed infrastructure service of VMware vSphere 4.1+, which monitors the health of virtual machines and the VMware ESX® hosts upon which they reside. If a fault is detected, the virtual machine is automatically restarted on another ESX host with adequate capacity to host it. VMware HA is included in all vSphere editions and can be enabled on a VMware cluster with a single check box. As VMware HA utilizes the storage and network connectivity already in place to support vMotion, enabling high availability is as simple as ensuring you have adequate server capacity to handle failure of one or more ESX hosts.
ZCS Scripts For Vmware-HA
The three scripts for vmware-ha are:
- /opt/zimbra/bin/zmhactl
- /opt/zimbra/libexec/vmware-heartbeat
- /opt/zimbra/libexec/vmware-appmonitor
We have an open documentation RFE to better explain these :
- "Documentation for VMware HA scripts in Zimbra"
Some older bugs describing a little more about the vmware-heartbeat check:
- "VMware HA does not work with ZCS8 or ZCA8"
- "Service level control of VMware HA Clustering heartbeat"
Enable Vmware-HA Service
To confirm the service is available to enable:
[As the zimbra user]
zmprov gs `zmhostname` zimbraServiceInstalled | grep vmware-ha zimbraServiceInstalled: vmware-ha
To enable vmware-ha on a server:
[As the zimbra user]
su - zimbra zmprov ms `zmhostname` +zimbraServiceEnabled vmware-ha zmhactl start
Vmware Performance Recommendations For Vmware Clustering
See
VMware Host Based Replication (HBR)
Questions should be addressed to Vmware Support. This feature happens outside of Zimbra and is not QA tested by us.
Private Bug [Referenced here in case it's later made public]:
- Qualification of ZCS with VMware Host Based Replication (HBR)
Other References
See also:
- "Zimbra on NFS Storage through VMware ESX"
- http://bugzilla.zimbra.com/show_bug.cgi?id=50635
- This is NFS for the virtualized storage within ESX, not within the OS.
- Current NFS policy, when the nfs mount is done within the OS.
- "No support for RHEL Clustering on top of VMware"
Webinar On Virtualizing Zimbra with VMware vSphere and NetApp NFS
Learn how the combination of VMware vSphere and NetApp file-based storage provides full support for virtualization and all of vSphere's advanced features (vMotion, Storage vMotion, DRS), simplifies high availability through the use of VMware HA and server consolidation.
View Webinar Now (Duration: 45 minutes)
Critical Bugs/RFE's - False Restarts And So Forth
Log Rotation Causes Cluster Failover
See:
- "Log rotation causes cluster failover"
Recommendations to work around bug until fix is released - 2 methods:
- First Method - disable log rotation
- Remove the zmmtaconfigctl restart from the /etc/logrotate.d/zimbra file so that it will not attempt to restart the service that is being detected as down. We can remove the line that reads:
su - zimbra -c "/opt/zimbra/bin/zmmtaconfigctl restart"
- That will stop these failures, but will affect the logging for zmmtaconfigctl, probably causing it to write to a nonexistent file. We haven't seen problems in zmmtaconfig for a long time, so this is a pretty low risk workaround.
- Second Method - disable software monitoring in general
Software Monitoring Causes Problems
- "Request Modification to zmcluctl to support hardware only failover with Redhat Cluster Manager"
- http://bugzilla.zimbra.com/show_bug.cgi?id=25456
- Note: Beginning in ZCS 6.0, hardware only failover with Redhat Cluster Manager is supported.
- http://bugzilla.zimbra.com/show_bug.cgi?id=25456
- To Disable software monitoring.
- This will prevent failover if zmcluctl finds a service down. It will not prevent failover if there is a hardware fault detected by the cluster software.
- $zmcluctl mode hardware
- or
- $zmlocalconfig -e zimbra_cluster_mode=hardware
- Note from bug/rfe - Added switch for software or hardware only based fail-over implemented as a lc zimbra_cluster_mode attribute. default mode is software meaning any non-zero exit status from zmcontrol status will trigger a failover. hardware mode means that zmcluctl status will always return a zero exit status and will not consult zmcontrol status for the state.
- To also increase the chance of getting more information in the log on what might be going on:
- In /opt/zimbra-cluster/bin/zmcluctl you should see a line like:
- my @output = `su - zimbra -c 'zmcontrol status'`;
- Change that to:
- my @output = `su - zimbra -c 'date >> /opt/zimbra/log/zmcluster-status.log ; zmcontrol status >> /opt/zimbra/log/zmcluster-status.log 2>> /opt/zimbra/log/zmcluster-status.log'`;
- That should give us more logging. I believe zmcluctl is read every time from disk when it does the check, so no restart of services should be needed.
- In /opt/zimbra-cluster/bin/zmcluctl you should see a line like:
- This will prevent failover if zmcluctl finds a service down. It will not prevent failover if there is a hardware fault detected by the cluster software.
RHEL 5 Clusters And Cisco Switches
Please see the following:
- "Openais appears to fail, causing cluster member to fence"
- https://bugzilla.redhat.com/show_bug.cgi?id=469874
- The last comment mentions a cisco issue being the cause [cisco switches are used internally for ibm blades].
- Comment 9 states most likely hardware configuration issue w/ switch or iptables.
- https://bugzilla.redhat.com/show_bug.cgi?id=469874
- "Cman kills first node in initial cluster setup"
Mysql Related Items Impacting Cluster
Please see:
- "Mysql crash recovery causes repeated software failover"
- http://bugzilla.zimbra.com/show_bug.cgi?id=36690
- "finding root cause to failed failover situations as secondary issue from bug 36690"
- http://bugzilla.zimbra.com/show_bug.cgi?id=36690
- "Flush dirty innodb pages in mysql prior to shutting down."
Other Misc Bug/RFEs
Other bugs/rfe's you might be interested in looking at:
- "zmcluctl status can return errors even when services are up"
Failover Occurring Prior To Mysql Shutting Down - RHCS
Here is the summary of the situation that was sent for a case on the matter.
- Regarding RHCS desired configuration -
- In particular, it looks like mysqld can at times take quite a long time to shutdown, especially in situations when write IO is limited on the mysql db partition, and mysqld must write cache data to disk safely before shutting down. We believe this should be reflected in the "rc=1" output from "zmcontrol stop" - if mysqld does not stop within the 60 seconds via /opt/zimbra/bin/zmcontrol (via /opt/zimbra/bin/mysql.server), and then what appears to be happening is that RHCS either tries to unmount the filesystem and/or just kill -KILL the running process, which in turns causes mysqld to die ungracefully and cause the mysqld startup on the other box to go through a long log replay. The net result is one of two scenarios:
- (a) mysqld takes longer to startup than it would have taken to shutdown (normal shutdown can take 0-10 minutes if mysqld has to flush a bunch of data to write out)
- (b) mysqld is still running when RHCS tries to unmount the filesystem, which then fails, and therefore the failover fails
- What we'd like to be able to recommend is a more robust failover logic, such as:
- 1. Run zmcontrol stop, check output
- 2. If failed, wait X seconds (e.g., 120 seconds)
- 3. Run zmcontrol stop again
- 4. If failed, wait X seconds
- 5. Run zmcontrol third time
- 6. If failed third time, try a kill -KILL and force unmount
- If RHCS can be configured to do this, it would be the best way to handle this situation. The problem with modifying zmcontrol to have this logic internally is that it should not be granted the decision to wait indefinitely, in the case that mysqld is having a critical problem and is not shutting down. Having an external process manage this logic allows for additional triangulation on the determination of the situation, and allows additional capabilities such as monitoring the files in /opt/zimbra/db/data to confirm that files are changing. For example, if mysqld is still running and no files have changed in /opt/zimbra/db/data for a significant amount of time, it may indicate that mysqld is locked up, and other steps may be required. zmcontrol would not be able to handle all of this logic internally due to the needs for additional external monitoring outside of the zmcontrol process, including return code from the script.
RFE that was made about Zimbra adjusting the our script and the wait time:
- "mysql.server should wait longer to stop mysqld"
Good Summary For RHEL Clustering
This is a good solid summary about RHEL clustering:
http://www.linuxjournal.com/article/9759
Active-Active Clustering
There is a bug(rfe) for active-active configuration. Please see:
http://bugzilla.zimbra.com/show_bug.cgi?id=19700
Non-San Based Fail Over HA/Cluster Type Configuration
This RFE covers issues when your wanting a "copy" of the data to reside on an independent server - LAN/WAN.
Please see:
- "Disaster recovery through server to server sync (beta)"
- "HA/DR through Log Shipping"
RFE's/Bug Related To Supporting Clustering Options
- "Add VCS cluster support for Suse ES 10"
- http://bugzilla.zimbra.com/show_bug.cgi?id=24303
- SuSE Clustering resources - These might be useful.
- "Cluster Configuration on SLES"
- "Clustering Your Novell Groupwise Servers - Xen & Heartbeat2 on SLES"
- "SuSE paper about HA and Virtual Servers - PDF"
- What SLES has for clustering - Linux Virtual Server
- "Add support for otther cluster software lifekeeper and mc/service guard"
- "Add clustering support for Mac OS X"
Other Clustering RFE's And Bugs
- "RFE: How-to for adding additional mounts on existing cluster deployment"
- "RFE: Expand documentation or installer for 1+1 to X+1"
HA-Linux (Heartbeat)
HA-Linux How-To For Testing And Educational Use
References:
- HA-Linux Project Homepage
- Howto: Highly available Zimbra cluster using Heartbeat and DRBD
- DRBD Homepage
- DRBD currently unsupported at this time.
- 1. "disaster recovery through server to server sync (beta)"
- 2. "add active-active support to zcs" , marked as a dup of the above.
- DRBD currently unsupported at this time.
Actual HA-Linux How-To For Testing And Educational Use Homepage
Please see Ajcody-Notes-HA-Linux-How-To
Motive Behind How-To
I hope this gives an easy way to setup through some clustering concepts for an administrator to gain some real-world experience when they currently have none. I plan on walking through each "function" that is behind clustering rather than jumping to an end setup (Linux-HA, Shared Storage, And Zimbra).
The structure will be:
- Setup two machines (physical or virtual)
- Emphasis physical hostname / ip vs. the hostname and ip address that will be for HA.
- Setup virtual hostname and ip address for HA.
- Explain and do ip failover between the two machines.
- Setup a disk mount, we'll use probably use a nfs export from a third machine.
- This will give us an example of expanding the HA conf files to move beyond the ip address failover.
- Adjust HA conf's to now export via nfs a local directory from each server. This will not be a shared physical disk of course.
- Setup a shared disk between the two servers and include it in the HA conf files.
- Can use drbd or maybe figure out a way to share a virtual disk between the two vm's.
- Setup a very simple application to include between the two machines. Something like apache or cups.
- Go back and now readjust all variables between monitoring type (automatic) failover and simple manually initiated.
Virtualization Issues
Actual Virutalization Issues Homepage
Please see Ajcody-Virtualization
Vmware - ESX - Performance & Support Resources
Internal Resources:
- Update - Great New Resource Available!!!! [May 17, 2010]
- Document under the Zimbra Appliance stuff, but still relevant for all Vmware configurations.
- When working with Zimbra for VMware related issues, you should review the following and provide the information about your vmware setup.
- "Collecting diagnostic information for VMware ESX Server 2.5, 3.0, 3.5 and 4.0"
External Resources:
- "Performance Tuning for VI3"
- "Isolating Performance Problems (PDF)"
- "Representing Physical Machines in the Virtual World (PDF)"
- "Using esxtop to Troubleshoot Performance Problems (PDF)"
- "ESX Performance Tips and Tricks (PDF)"
- "Performance Tuning Best Practices for ESX Server 3"
- "ESX Workload Analysis: Lessons Learned"
- "VM Performance Monitoring and Logging"
- "Understanding Performance in a Virtualized Environment'
- "Interpreting Performance Statistics in V13"
- "Top 12 ways to Improve Guest Server Performance under VMware ESX Server"
Vmware And Clustering
Please see Ajcody-Clustering#Vmware_Virtualization_and_Clustering
Introduction To Using VMWare ESX For ZCS Test Servers
References
References I ended up consulting to resolve and develope my notes below. There appears to be many alterations on how to do this depending on the version of the Vmware software you are using.
- Moving or copying a virtual machine within a VMware environment
- How work without vCenter Server
- Cannot open Virtual Machine Console
Introduction To Notes
I just did this and I plan on going through it and improving it once I have time.
- I believe the hard coded reference to the volumes could use the sym-link for the path:
- /vmfs/volumes/Storage vs. /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af
- Setup /etc/hosts file on first vmimage to have entries for other machines
- Configure first vmimage to use ESX server for DNS [/etc/resolv.conf] , NTP , and other network services
- Setup ESX for DNS, DHCP, NTP [below for more details]
- Configure vm configuration files, *.vmx , to use manual set MAC addresses and had last number matched number used in hostname.
- Configure ESX server to act as DNS & DHCP server using to auto-allocate ip address and hostnames and set each hostname to have proper A, PTR, and MX records using hostname of image equally domainname for mail.
- for example:
- I would create three groups of images, if possible:
- host.dev.DOMAIN.com
- DEV is for pure testing
- host.qa.DOMAIN.com
- QA is for testing of changes prior to roll out to production
- host.prod.DOMAIN.com
- PROD would be replica's of production and used to test against production issues
- host.dev.DOMAIN.com
- Images configured as:
- image hostname = centos5-30.dev.DOMAIN.com
- server centos5-31.dev.DOMAIN.com has ip address of 192.168.0.31 - set A and PTR record
- MX equals centos5-31.dev.DOMAIN.com / 192.168.0.31
- Use more expansive descriptions in hostnames for standards and predictability.
- Note, underscores ARE NOT vaild DNS hostnames per RFC 1034 - http://www.ietf.org/rfc/rfc1034.txt
- Add the DEV - QA - PROD if your using that as well.
- Primary Domain = example.com
- LDAP Master hostname = ldap-1.DOMAIN.com
- LDAP Replica hostnames = ldap-2.DOMAIN.com , ldap-3.DOMAIN.com , etc.
- First MTA hostname = mta-1.DOMAIN.com
- Other MTA hostnames = mta-2.DOMAIN.com , mta-3.DOMAIN.com , etc.
- First Mailstore hostname = mailstore-1.DOMAIN.com
- Other Mailstore hostnames = mailstore-2.DOMAIN.com , mailstore-3.DOMAIN.com , etc.
- On proxy server hostname =
- Proxy on MTA's: mta-1.DOMAIN.com , mta-2.DOMAIN.com , etc.
- Though the proxy package can be installed on other servers, usually it is installed on the mta's or on it's own.
- Proxy on it's own: proxy-1.DOMAIN.com , proxy-2.DOMAIN.com , etc.
- Proxy on MTA's: mta-1.DOMAIN.com , mta-2.DOMAIN.com , etc.
- On archive [A&D] hostname:
- First Archive hostname = archive-1.DOMAIN.com
- Other Archive hostnames = archive-2.DOMAIN.com , archive-3.DOMAIN.com , etc.
- Configure proxy/firewall to be route point for primary domain and then pass to appropriate server for subdomain mail.
- All external requess for *.zimbra.DOMAIN.com and zimbra.DOMAIN.com route to ESX server which in turns routes to appropriate vm server for subdomain.
- Ports open on firewalls to allow vsphere connection to esx server:
- http://wiki.zimbra.com/index.php?title=Ajcody-Server-Topics#Using_VMWare_ESX_For_ZCS_Test_Servers_-_How-To
- 443, 902, 903, 5989 -- all of those?
- http://wiki.zimbra.com/index.php?title=Ajcody-Server-Topics#Using_VMWare_ESX_For_ZCS_Test_Servers_-_How-To
- Add post-clone script to the "gold image" to reconfigure the cloned image for things like hostname & network information. [Thanks Tony for the idea]
How-To Setup ESX For ZCS Test Servers
Creating Initial x64 VM
Initial Setup Of Guest Image In vSphere
- Right Click on ESX server name in left column listing in vSphere Client.
- Select "New Virtual Machine"
- Select "Typical"
- Name - ex. "Centos5-x64-30"
- Format being - Distro & Distro Version - platform x32 or x64 - last octet of ip address
- Datastore - your local esx data storage you'll be using
- Guest OS > Linux > RHEL5 64bit - RHEL for Centos [using my example]
- Create a disk
- Defaults to 8GB, but this isn't enough for ZCS because ZCS requires at least 5GB's free. The OS will take about 4-6+GB's between the swap partition, /boot , and /. Using installer defaults that is.
- I make the root image for 12GB. This will be enough to get a basic ZCS install done. One can add more later if needed.
- For a 'test' environment, I would recommend leaving the other options UNCHECKED.
- Leave UNCHECKED - Allocate and commit space on demand
- Leave UNCHECKED - Support clustering features such as Fault Tolerance.
- For a 'test' environment, I would recommend leaving the other options UNCHECKED.
- Ready to Complete - Check the box that says:
- check - "Edit the virtual machine settings before completion"
- Memory > Adjust Memory to be 1024 MB or 1 GB
- CD/DVD Drive 1 >
- Check "Connected at power on"
- Check "Datastore ISO File" and select the iso image for your OS - ex. CentOS-5.4-x86_64-bin-DVD.iso.
- Centos default disk partitioning will do:
- Also, see - need wiki section - about how to prep your server to host iso images via the datastore.
- The rest can be left as the defaults for now.
- check - "Edit the virtual machine settings before completion"
- Select "New Virtual Machine"
Initial Setup Of Guest Image Operating System - CentOS/RHEL Example
- In the vSphere Client and right click on Guest image, ex. "Centos5-x64-30", and select power on.
- Prep our 'base image' prior to cloning it.
- The image should give you your Distro's installer screen. Go through the OS installation.
- Note about CentOS example
- First stage of installer
- The partitioning example if using the defaults will give you:
-
/dev/sda1 /boot ext3 101 MB
-
/dev/sdb2 VolGroup00 LVM PV 12182 MB
-
LogVol00 / ext3 10144 MB
-
LovVol01 swap 2016 MB
-
-
- The Network Devices
- Network Devices > click on edit
- Leave CHECKED - "Enabled IPv4 support"
- UNCHECKED "Enable IPv6 support"
- Network Devices > click on edit
- Package Selection
- Check the "Server" option and then click "Next"
- Installer will now finish the first stage of the installation and reboot.
- Check the "Server" option and then click "Next"
- The partitioning example if using the defaults will give you:
- Second state of installation.
- Firewall > Disable firewall.
- SELinux > Disable SELinux
- Date and Time
- Network Time Protocol - Enable NTP if you'll be able to reach the NTP servers.
- Check the "Synchronize system clock before starting service"
- Network Time Protocol - Enable NTP if you'll be able to reach the NTP servers.
- Create User > No need to create additional users for ZCS purposes.
- Finish installation.
- Post-Installation
- Note - Ctrl+Alt allows you to switch the focus of the mouse in and out of the VM guest image showing in vSphere's client.
- Note - The client 'screen' is under the "Console" tab.
- Install VMwareTools
- In the vSphere Client and right click on Guest image, ex. "Centos5-x64-30", and select Guest > Install\Upgrade VMware Tools.
- Double click on the VMwareTools rpm or install it via CLI.
- You can also run the vmware-tool configuration script
- vmware-config-tools.pl
- Allows you to adjust the screen resolution and cut-n-paste between workstation and the guest vm.
- Launch a terminal. Applications > Accessories > Terminal
- Disable sendmail from being used. Note - CentOS/RHEL uses sendmail as default, for another distro you might need to disable postfix from being used.
- In terminal, paste [if you installed vmware tools] or type the following command.
-
chkconfig sendmail off ; /etc/init.d/sendmail stop
- Install some prereq packages that you might not already have installed - CentOS example:
-
yum install compat-libstdc++-33 compat-libstdc++-296 sysstat
-
- Umount the vmware-tools mount - example
-
umount /media/VMware\ Tools/
- confirm with df -h
-
- Reboot server now - the guest OS image.
- Disable sendmail from being used. Note - CentOS/RHEL uses sendmail as default, for another distro you might need to disable postfix from being used.
- See also Ajcody-Virtualization#RHEL_or_CentOS for adding 'disk/partitions' to an image.
- First stage of installer
- Note about CentOS example
Manual Cloning of x32 Setup
My Version of Vmware ESX does not have a cloning option - I was actually given the ESX box rebuilt. So here's what I did to 'clone' an image the manual way. See Ajcody-Virtualization-Named-DNS about setting up BIND/DNS for this example.
# Vmware ESX 4.0.0 Build 208167 # vSphere Client 4.0.0. Build 208111 # # Copy some iso files to the server, here's is what I used. # Please note the vmx files below in my examples to my iso name for the centos dvd. # [ /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/iso/CentOS/CentOS-5.4-i386-bin-DVD.iso ] # Create your first VM - I called my Centos5-30 and that standard and naming convention is used throughout. # I left the hostname just to use the localhost and installed the vmware tools. # I then shutdown the image and did a snapshot of it. pwd /vmfs/volumes ls -la total 1024 drwxr-xr-x 1 root root 512 Apr 9 23:59 . drwxrwxrwt 1 root root 512 Apr 9 00:39 .. drwxr-xr-t 1 root root 4200 Apr 9 23:20 4bbaf57f-6230127f-d432-00101849e4af lrwxr-xr-x 1 root root 35 Apr 9 23:59 Storage1 -> 4bbaf57f-6230127f-d432-00101849e4af cd Storage1/ ls Centos5-30/ esxconsole-4bbb574e-eae0-2eb3-9d5b-00101849e4af/ iso/ # Download and copy the various OS iso's you'll want and copy them underneath your storage volume, # I made an iso directory for them all. # Also, I used Firefox and the add-on DownThemAll and went to the Zimbra download pages # http://www.zimbra.com/downloads/ne-downloads.html # http://www.zimbra.com/downloads/ne-downloads-previous.html # And downloaded all the versions of ZCS that I wanted to test against. I then used K3B under Linux # to make iso files of the tar balls. Copy the iso files to your ESX server under the iso directory # you made. If you want to mount them remotely to confirm they are ok to or to review what they have: # ex. mount -t iso9660 ./zcs-x32-installs.iso /mnt/cdrom -o ro,loop # Having the Zimbra iso files like that will allow your images to easily install Zimbra . ls -R iso/ CentOS/ openSUSE/ SLES/ Ubuntu/ ZCS/ ./CentOS: CentOS-5.4-i386-bin-DVD.iso CentOS-5.4-x86_64-bin-DVD.iso ./openSUSE: openSUSE-11.2-Addon-NonOss-BiArch-i586-x86_64.iso openSUSE-11.2-DVD-i586.iso openSUSE-11.2-DVD-x86_64.iso ./SLES: SLES-10-SP3-DVD-i386-GM-DVD1.iso SLES-10-SP3-DVD-x86_64-GM-DVD1.iso SLES-11-DVD-i586-GM-DVD1.iso SLES-10-SP3-DVD-i386-GM-DVD2.iso SLES-10-SP3-DVD-x86_64-GM-DVD2.iso SLES-11-DVD-i586-GM-DVD2.iso ./Ubuntu: ubuntu-8.04.4-desktop-amd64.iso ubuntu-8.04.4-desktop-i386.iso ubuntu-8.04.4-server-amd64.iso ubuntu-8.04.4-server-i386.iso ./ZCS: zcs-x32-606-02_5023-018.iso zcs-x64-5018-23.iso zcs-x64-603-06.iso vmware-cmd -l /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-30/Centos5-30.vmx pwd /vmfs/volumes/Storage1 # Make more directories for you to copy the initial image vitrual disks to mkdir Centos5-{31..49} # Now you'll do a copy operation of your first image to the new directories you made pwd /vmfs/volumes/Storage1 vmkfstools -i ./Centos5-30/Centos5-30.vmdk ./Centos5-31/Centos5-31.vmdk vmkfstools -i ./Centos5-30/Centos5-30.vmdk ./Centos5-32/Centos5-32.vmdk vmkfstools -i ./Centos5-30/Centos5-30.vmdk ./Centos5-33/Centos5-33.vmdk vmkfstools -i ./Centos5-30/Centos5-30.vmdk ./Centos5-34/Centos5-34.vmdk vmkfstools -i ./Centos5-30/Centos5-30.vmdk ./Centos5-35/Centos5-35.vmdk vmkfstools -i ./Centos5-30/Centos5-30.vmdk ./Centos5-36/Centos5-36.vmdk vmkfstools -i ./Centos5-30/Centos5-30.vmdk ./Centos5-37/Centos5-37.vmdk vmkfstools -i ./Centos5-30/Centos5-30.vmdk ./Centos5-39/Centos5-39.vmdk vmkfstools -i ./Centos5-30/Centos5-30.vmdk ./Centos5-39/Centos5-39.vmdk vmkfstools -i ./Centos5-30/Centos5-30.vmdk ./Centos5-40/Centos5-40.vmdk vmkfstools -i ./Centos5-30/Centos5-30.vmdk ./Centos5-41/Centos5-41.vmdk vmkfstools -i ./Centos5-30/Centos5-30.vmdk ./Centos5-42/Centos5-42.vmdk vmkfstools -i ./Centos5-30/Centos5-30.vmdk ./Centos5-43/Centos5-43.vmdk vmkfstools -i ./Centos5-30/Centos5-30.vmdk ./Centos5-44/Centos5-44.vmdk vmkfstools -i ./Centos5-30/Centos5-30.vmdk ./Centos5-45/Centos5-45.vmdk vmkfstools -i ./Centos5-30/Centos5-30.vmdk ./Centos5-46/Centos5-46.vmdk vmkfstools -i ./Centos5-30/Centos5-30.vmdk ./Centos5-47/Centos5-47.vmdk vmkfstools -i ./Centos5-30/Centos5-30.vmdk ./Centos5-48/Centos5-48.vmdk vmkfstools -i ./Centos5-30/Centos5-30.vmdk ./Centos5-49/Centos5-49.vmdk pwd /vmfs/volumes/Storage1 # Now you'll copy the inital images configuration file to the directory above the image directories # so we can modify it and make it a template file cp Centos5-30/Centos5-30.vmx ./Centos5-31.vmx vi Centos5-31.vmx change variables to be more generic cat Centos5-31.vmx #!/usr/bin/vmware .encoding = "UTF-8" config.version = "8" virtualHW.version = "7" pciBridge0.present = "TRUE" pciBridge4.present = "TRUE" pciBridge4.virtualDev = "pcieRootPort" pciBridge4.functions = "8" pciBridge5.present = "TRUE" pciBridge5.virtualDev = "pcieRootPort" pciBridge5.functions = "8" pciBridge6.present = "TRUE" pciBridge6.virtualDev = "pcieRootPort" pciBridge6.functions = "8" pciBridge7.present = "TRUE" pciBridge7.virtualDev = "pcieRootPort" pciBridge7.functions = "8" vmci0.present = "TRUE" nvram = "Centos5-31.nvram" deploymentPlatform = "windows" virtualHW.productCompatibility = "hosted" unity.customColor = "|23C0C0C0" tools.upgrade.policy = "useGlobal" powerType.powerOff = "soft" powerType.powerOn = "default" powerType.suspend = "hard" powerType.reset = "soft" displayName = "Centos5-31" extendedConfigFile = "Centos5-31.vmxf" floppy0.present = "TRUE" scsi0.present = "TRUE" scsi0.sharedBus = "none" scsi0.virtualDev = "lsilogic" memsize = "1024" scsi0:0.present = "TRUE" scsi0:0.fileName = "Centos5-31.vmdk" scsi0:0.deviceType = "scsi-hardDisk" ide1:0.present = "TRUE" ide1:0.clientDevice = "FALSE" ide1:0.deviceType = "cdrom-image" ide1:0.startConnected = "TRUE" floppy0.startConnected = "FALSE" floppy0.clientDevice = "TRUE" ethernet0.present = "TRUE" ethernet0.networkName = "VM Network" ethernet0.addressType = "generated" guestOSAltName = "Red Hat Enterprise Linux 5 (32-bit)" guestOS = "rhel5" uuid.location = "56 4d 41 ed 87 cc a2 03-77 97 48 8c 65 16 7e ed" uuid.bios = "56 4d 41 ed 87 cc a2 03-77 97 48 8c 65 16 7e ed" vc.uuid = "52 9e a1 5c 02 25 0f c2-20 03 f8 bb 21 93 74 c7" ethernet0.generatedAddress = "" tools.syncTime = "FALSE" cleanShutdown = "TRUE" replay.supported = "FALSE" sched.swap.derivedName = "/vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-31/Centos5-31-d6823091.vswp" scsi0:0.redo = "" vmotion.checkpointFBSize = "4194304" pciBridge0.pciSlotNumber = "17" pciBridge4.pciSlotNumber = "21" pciBridge5.pciSlotNumber = "22" pciBridge6.pciSlotNumber = "23" pciBridge7.pciSlotNumber = "24" scsi0.pciSlotNumber = "16" ethernet0.pciSlotNumber = "32" vmci0.pciSlotNumber = "33" ethernet0.generatedAddressOffset = "0" vmci0.id = "-876333085" hostCPUID.0 = "0000000b756e65476c65746e49656e69" hostCPUID.1 = "000106a500100800009ce3bdbfebfbff" hostCPUID.80000001 = "00000000000000000000000128100800" guestCPUID.0 = "0000000b756e65476c65746e49656e69" guestCPUID.1 = "000106a500010800809822010febfbff" guestCPUID.80000001 = "00000000000000000000000128100800" userCPUID.0 = "0000000b756e65476c65746e49656e69" userCPUID.1 = "000106a500100800009822010febfbff" userCPUID.80000001 = "00000000000000000000000128100800" evcCompatibilityMode = "FALSE" ide1:0.fileName = "/vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/iso/CentOS/CentOS-5.4-i386-bin-DVD.iso" floppy0.fileName = "/dev/fd0" debugStub.linuxOffsets = "0xa356145,0xffffffff,0xfc052084,0xffffffff,0x0,0x0,0xa356150,0x0,0xa35616f,0x0,0xfc052088,0xffffffff,0x0,0x0" tools.remindInstall = "TRUE" sched.cpu.affinity = "all" sched.swap.hostLocal = "disabled" # Now we'll copy this template to the other image directories cp Centos5-31.vmx Centos5-31/Centos5-31.vmx cp Centos5-31.vmx Centos5-32/Centos5-32.vmx cp Centos5-31.vmx Centos5-33/Centos5-33.vmx cp Centos5-31.vmx Centos5-34/Centos5-34.vmx cp Centos5-31.vmx Centos5-35/Centos5-35.vmx cp Centos5-31.vmx Centos5-36/Centos5-36.vmx cp Centos5-31.vmx Centos5-37/Centos5-37.vmx cp Centos5-31.vmx Centos5-38/Centos5-38.vmx cp Centos5-31.vmx Centos5-39/Centos5-39.vmx cp Centos5-31.vmx Centos5-40/Centos5-40.vmx cp Centos5-31.vmx Centos5-41/Centos5-41.vmx cp Centos5-31.vmx Centos5-42/Centos5-42.vmx cp Centos5-31.vmx Centos5-43/Centos5-43.vmx cp Centos5-31.vmx Centos5-44/Centos5-44.vmx cp Centos5-31.vmx Centos5-45/Centos5-45.vmx cp Centos5-31.vmx Centos5-46/Centos5-46.vmx cp Centos5-31.vmx Centos5-47/Centos5-47.vmx cp Centos5-31.vmx Centos5-48/Centos5-48.vmx cp Centos5-31.vmx Centos5-49/Centos5-49.vmx # You'll want to swap the references of the initial image name [ Centos5-3