Difference between revisions of "King0770-Notes"

(Distribution Lists and Duplicates)
(External Authentication with LDAP)
Line 127: Line 127:
Address unconfigured (**) items or correct ldap configuration  (? - help)
Address unconfigured (**) items or correct ldap configuration  (? - help)
==External Authentication with LDAP==
Requires one of the following:
1) set<br>
Set domain attribute zimbraAuthMech to ldap.<br>
<strong>zimbraAuthLdapSearchBindPassword</strong> => bind DN of the admin user of the external directory<br>
<strong>zimbraAuthLdapSearchBindDn</strong> => password of the admin user of the external directory<br>
<strong>zimbraAuthLdapSearchBase</strong> (optional, if not set "" will be used).<br>
Three things are needed for auth to the external LDAP server:<br>
- URL of the LDAP server: zimbraAuthLdapURL<br>
- password entered by user<br>
- the bind DN for the user, this can be setup using one of the following 3 ways.  <strong>(A)</strong> is preferred over <strong>(B)</strong> because <strong>(C)</strong> does an extra LDAP search.<br>
<strong>(A)</strong> zimbraAuthLdapBindDn<br>
This is the bind DN template<br>     
<strong>(B)</strong> zimbraAuthLdapSearchFilter<br>
If set, then zimbraAuthLdapSearchBindPassword, zimbraAuthLdapSearchBindDn, and zimbraAuthLdapSearchBase also need to be set. <br> 
Server uses the four attrs to get the bind DN for the user.<br> 
Server first does a LDAP search  using the zimbraAuthLdapSearchBindDn/zimbraAuthLdapSearchBindPassword credential by zimbraAuthLdapSearchFilter under zimbraAuthLdapSearchBase.  The search would return the bind DN for the user, if found.<br>
example for zimbraAuthLdapSearchFilter: (&(mail=%u@%d)(objectclass=person))  (whatever object class they are using)<br>
<strong>(C)</strong> Account attribute zimbraAuthLdapExternalDn<br>
Unlike (A) and (B), which are domain settings, this is an account level setting.  This overrides the bind template and/or search setting, and directly contains the DN for the user in the external ldap server.<br>
2) set<br>
Set domain attribute zimbraAuthMech to ldap.<br>
<strong>zimbraAuthLdapBindDn</strong> to the template filter for the user in the external directory.<br>
For example, if the user exists at uid=jsmith,cn=users,dc=zimbra,dc=com , set zimbraAuthLdapBindDn on the domain to: uid=%u,cn=users,dc=zimbra,dc=com<br>
Another example uid=%u,ou=people,%D  (whatever LDAP DIT structure they are using)<br>
zimbraAuthLdapBindDn and zimbraAuthLdapSearchFilter can contain expansion variables that are to be substituted by components in the account name:<br>
%n = username with @ (or without, if no @ was specified)<br>
%u = username with @ removed<br>
%d = domain as foo.com<br>
%D = domain as dc=foo,dc=com<br>
e.g. for user rking@zimbra.com<br>
%n => rking@zimbra.com<br>
%u => rking<br>
%d => zimbra.com<br>
%D => dc=zimbra,dc=com<br>
example for zimbraAuthLdapBindDn: uid=%u,ou=people,%D  (whatever LDAP DIT structure they are using)<br>
===External Authentication Errors===
525 - user not found<br>
52e - invalid credentials<br>
530 - not permitted to logon at this time<br>
532 - password expired<br>
533 - account disabled<br>
701 - account expired<br>
773 - user must reset password<br>
775 - user account locked<br>
Example in the /opt/zimbra/log/mailbox.log file:<br>
Caused by: javax.naming.AuthenticationException: [LDAP: error code 49 - 80090308: LdapErr: DSID-0C090334, comment: AcceptSecurityContext error, data 52e, vece^@]
        at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:2985)
        at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2931)
        at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2732)
        at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2646)
        at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:283)
        at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:175)
        at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:193)
<strong>Notable bugs:</strong><br>
===Mix external authentication users with local users===
Lets say, you are using external authentication; however, you would like to create a few users locally on the Zimbra system without provisioning users on the external authentication system (openldap, AD etc etc).<br>
This should be possible with setting the following domain attribute.
zmprov md yourdomain.com zimbraAuthFallbackToLocal TRUE

Revision as of 22:11, 5 December 2018

Additional Articles by King0770

https://wiki.zimbra.com/wiki/King0770-Notes-Emulate-a-user-login-via-the-command-line https://wiki.zimbra.com/wiki/King0770-Notes-SSL

Handy Commands

LDAP - DB Status

/opt/zimbra/sleepycat/bin/db_stat -c -h /opt/zimbra/openldap-data

LDAP - DB Recover

/opt/zimbra/sleepycat/bin/db_recover **make sure you are doing this as the zimbra user, and that slapd is not running**

LDAP - Slapindex

/opt/zimbra/openldap/sbin/slapindex -f /opt/zimbra/conf/slapd.conf

LDAP - Export & Reimport

1) su - zimbra
2) libexec/zmslapcat /tmp
3) mv /tmp/ldap.bak /tmp/ldap.ldif
4) zmcontrol stop
5) ps -aux | grep slapd **If ldap is still running, kill it**
6) su - root
7) mv /opt/zimbra/openldap-data /opt/zimbra/openldap-data.OLD
8) mkdir -p /opt/zimbra/openldap-data/logs && mkdir -p /opt/zimbra/openldap-data/accesslog/db
9) chown -R zimbra:zimbra /opt/zimbra/openldap-data/
10) su - zimbra
11) /opt/zimbra/openldap/sbin/slapadd -f /opt/zimbra/conf/slapd.conf -b "" -l /tmp/ldap.ldif 
12) zmcontrol start

Clear SA DB

This would be handy if you are getting a lot of false positives

/opt/zimbra/libexec/sa-learn -p /opt/zimbra/conf/salocal.cf.in --dbpath /opt/zimbra/amavisd/.spamassassin/ --siteconfigpath /opt/zimbra/conf/spamassassin --clear


/opt/zimbra/libexec/sa-learn -p /opt/zimbra/conf/salocal.cf --dbpath /opt/zimbra/amavisd/.spamassassin --siteconfigpath \ /opt/zimbra/conf/spamassassin --force -expire –sync

KeyTool Commands

keytool -list -keystore /opt/zimbra/mailboxd/etc/keystore -storepass `zmlocalconfig -s -m nokey mailboxd_keystore_password`

keytool -delete -alias jetty or tomcat -keystore /opt/zimbra/mailboxd/etc/keystore -storepass `zmlocalconfig -s -m nokey mailboxd_keystore_password`

Columns are MisMatch in the GAL using ZCO

1) Remove ZCO profile(s) from Outlook - Start ==> Control Panel ==> Mail

2) Once the ZCO profile is removed, go into the following directories and remove everything in the specified directories:
c:\documents and settings\<user>\local settings\application data\microsoft\outlook
c:\documents and settings\<user>\application data\microsoft\outlook

3) Recreate ZCO profile for Outlook - Start ==> Control Panel ==> Mail

Once you have recreated the zco profile, open Outlook, then have a look again at the GAL.

Upper Case Letters in the hostname in /etc/hosts will prevent the install from continuing

Make sure the hostname in the /etc/hosts do not contain upper case letters. Or else the install will not continue.

Main menu

   1) Common Configuration:                                                  
        +Hostname:                             KLAATU.blue.local
        +Ldap master host:                     klaatu.blue.local
        +Ldap port:                            389                           
        +Ldap Admin password:                  set                           
        +Require secure interprocess communications: yes                           
        +TimeZone:                             (GMT-08.00) Pacific Time (US & Canada)

   2) zimbra-ldap:                             Enabled                       
   3) zimbra-store:                            Enabled                       
   4) zimbra-mta:                              Enabled                       
   5) zimbra-snmp:                             Enabled                       
   6) zimbra-logger:                           Enabled                       
   7) zimbra-spell:                            Enabled                       
   8) Default Class of Service Configuration:                                
   9) Enable default backup schedule:          yes                           
   r) Start servers after configuration        yes                           
   s) Save config to file                                                    
   x) Expand menu                                                            
   q) Quit                                    

Address unconfigured (**) items or correct ldap configuration  (? - help)

Sending Attachments

If you are having trouble sending attachments, and you *think* you've set the zimbraFileUploadMaxSize & zimbraMtaMaxMessageSize, correctly, then find out how much larger a MIME version of a file will be after base-64 encode.

If you want to find out just how much larger a MIME version of a given file will be, run the file through UUDeview (windows app) - try 'base 64' in the encode settings. Won't wreck your current file, it creates a converted duplicate. This should give you an idea of what values to use if you don't want to use an arbitrary value. http://www.miken.com/uud/

Removing older version inside /opt/zimbra

Can I delete older versions of software that is in the /opt/zimbra directory? I have older version of amavisd, clamav, cyrus-sasl, etc.

Answer: I am not sure *why* the prior versions are still around after an upgrade. The answer I received was, we (Zimbra), shouldn't remove things during an upgrade. My impression was this was a policy decision. I'd say move those older versions out of the way into another directory. And if there are no problems, I'd say you are good to go. To be honest, I am paranoid - I never suggest remove anything on a system. :)

Hardware Support

In the server, one of the hard disks is showing a red light. It is Raid 5 configured. Not sure where to look.

Zimbra Support can't help very much here. We support the Zimbra software, not the server hardware or the OS RAID infrastructure. If it's a standard Linux RAID, you can remove it from the RAID group with mdadm, replace the device, and add a new device to replace it. If it's a separate array or something, you'll have to go to the manufacturer instructions to find the procedure for replacing the device. You'll probably find more information with a web search than you can get from us on this topic.

Zimbra Mobile and BIS

Customers using utilizing AT&T and Verizon for their Blackberry Internet Services (BIS) will need to make sure port 993 is accessible. Apparently, BIS services will authenticate using port 993. I had a case where the admin was using AT&T to setup an account; however, he was getting the "connection timed out" message, or "cannot authenticate" from the AT&T app. On a hunch I suggested opening port 993 through his firewall (because it wasn't accessible to the outside world) . After that was done, AT&T was able to authenticate.

Jump to: navigation, search