• Mails & OpenLDAP

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
OpenKM has many interesting features, but requires some configuration process to show its full potential.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #6341  by flekschas
 
Hi,
I'm running OpenKM 4.1 in connection with OpenLDAP.
The authentication process works fine but I'm having a problem with the mail service.
When notifying users during an upload of a document only one user is getting the notification. It's the one whose email account is used for sending the mails. And when looking up under "tools -> preferences -> user configuration" no email address has been found.

Here is my openkm.config
Code: Select all
restrict.file.mime=off
restrict.file.extension=*~,*.bak,._*
max.file.size=25
system.antivir=/usr/bin/clamscan
system.pdf2swf=/usr/bin/pdf2swf
system.openoffice=on
application.url=http://msc.charite.de:8080/OpenKM/es.git.openkm.frontend.Main/index.jsp
# application.url=http://msc.charite.de/docs/es.git.openkm.frontend.Main/index.jsp
repository.home=/data/application/openkm
system.ocr=/usr/bin/tesseract
wizard.keywords=on
wizard.categories=on

principal.adapter=es.git.openkm.principal.LdapPrincipalAdapter
principal.ldap.server=ldap://localhost:389
principal.ldap.security.principal=cn=admin,dc=thunderstorm,dc=charite,dc=de
principal.ldap.security.credentials=***

principal.ldap.user.search.base=ou=bcrt,dc=thunderstorm,dc=charite,dc=de
principal.ldap.user.search.filter=(objectclass=inetOrgPerson)
principal.ldap.user.atribute=uid
principal.ldap.role.search.base=ou=Roles,ou=okm,dc=thunderstorm,dc=charite,dc=de
principal.ldap.role.search.filter=(objectclass=groupOfNames)
principal.ldap.role.atribute=cn
principal.ldap.mail.search.base=ou=bcrt,dc=thunderstorm,dc=charite,dc=de
principal.ldap.mail.search.filter=(objectclass=inetOrgPerson)
principal.ldap.mail.atribute=mail

notification.message.subject= OpenKM - NOTIFICATION - $documentName
notification.message.body=<b>Document: </b><a href=\"$documentUrl\">$documentPath</a><br/><b>User: </b>$userId<br/><b>Message: </b>$notificationMessage<br/>
subscription.message.subject=OpenKM - $eventType - $documentPath
subscription.message.body=<b>Document: </b><a href=\"$documentUrl\">$documentPath</a><br/><b>User: </b>$userId<br/><b>Event: </b>$eventType<br/><b>Comment: </b>$subscriptionComment<br/>
My mail-service.xml
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: mail-service.xml 62349 2007-04-15 16:48:15Z dimitris@jboss.org $ -->
<server>
  <mbean code="org.jboss.mail.MailService" name="jboss:service=OpenKM">
    <attribute name="JNDIName">java:/mail/OpenKM</attribute>
    <attribute name="User">***</attribute>
    <attribute name="Password">***</attribute>
    <attribute name="Configuration">
      <configuration>	
	<property name="mail.transport.protocol" value="smtp"/>
	<property name="mail.smtp.host" value="postamt.charite.de"/>
	<property name="mail.smtp.port" value="25"/>
	<property name="mail.smtp.from" value="fr***.le***@charite.de"/>
	<property name="mail.smtp.user" value="***"/>
	<property name="mail.smtp.password" value="***"/>
	<property name="mail.smtp.auth" value="true"/>
	<property name="mail.debug" value="true"/>
      </configuration>
    </attribute>
    <depends>jboss:service=Naming</depends>
  </mbean>
</server>
The server.log
Code: Select all
2010-08-30 12:17:33,931 INFO  [STDOUT] DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
2010-08-30 12:17:33,942 INFO  [STDOUT] DEBUG SMTP: useEhlo true, useAuth true
2010-08-30 12:17:33,942 INFO  [STDOUT] DEBUG SMTP: useEhlo true, useAuth true
2010-08-30 12:17:33,942 INFO  [STDOUT] DEBUG SMTP: trying to connect to host "postamt.charite.de", port 25, isSSL false
2010-08-30 12:17:33,954 INFO  [STDOUT] 220 postamt.charite.de ESMTP Postfix
2010-08-30 12:17:33,954 INFO  [STDOUT] DEBUG SMTP: connected to host "postamt.charite.de", port: 25
2010-08-30 12:17:33,955 INFO  [STDOUT] EHLO thunderstorm.charite.de
2010-08-30 12:17:33,958 INFO  [STDOUT] 250-postamt.charite.de
250-PIPELINING
250-SIZE 209715200
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
2010-08-30 12:17:33,958 INFO  [STDOUT] DEBUG SMTP: Found extension "PIPELINING", arg ""
2010-08-30 12:17:33,959 INFO  [STDOUT] DEBUG SMTP: Found extension "SIZE", arg "209715200"
2010-08-30 12:17:33,959 INFO  [STDOUT] DEBUG SMTP: Found extension "VRFY", arg ""
2010-08-30 12:17:33,959 INFO  [STDOUT] DEBUG SMTP: Found extension "ETRN", arg ""
2010-08-30 12:17:33,959 INFO  [STDOUT] DEBUG SMTP: Found extension "STARTTLS", arg ""
2010-08-30 12:17:33,959 INFO  [STDOUT] DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
2010-08-30 12:17:33,959 INFO  [STDOUT] DEBUG SMTP: Found extension "8BITMIME", arg ""
2010-08-30 12:17:33,959 INFO  [STDOUT] DEBUG SMTP: Found extension "DSN", arg ""
2010-08-30 12:17:33,960 INFO  [STDOUT] DEBUG SMTP: use8bit false
2010-08-30 12:17:33,960 INFO  [STDOUT] MAIL FROM:<fr***.le***@charite.de>
2010-08-30 12:17:33,963 INFO  [STDOUT] 250 2.1.0 Ok
2010-08-30 12:17:33,963 INFO  [STDOUT] RCPT TO:[b][color=#FF0000]<fr***.le***@charite.de>[/color][/b]
2010-08-30 12:17:33,966 INFO  [STDOUT] 250 2.1.5 Ok
2010-08-30 12:17:33,966 INFO  [STDOUT] RCPT TO:[b][color=#FF0000]<fr***.le***@charite.de>[/color][/b]
2010-08-30 12:17:33,968 INFO  [STDOUT] 250 2.1.5 Ok
2010-08-30 12:17:33,968 INFO  [STDOUT] DEBUG SMTP: Verified Addresses
2010-08-30 12:17:33,968 INFO  [STDOUT] DEBUG SMTP:   [b][color=#FF0000]fr***.le***@charite.de[/color][/b]
2010-08-30 12:17:33,968 INFO  [STDOUT] DEBUG SMTP:   [b][color=#FF0000]fr***.le***@charite.de[/color][/b]
2010-08-30 12:17:33,968 INFO  [STDOUT] DATA
2010-08-30 12:17:33,969 INFO  [STDOUT] 354 End data with <CR><LF>.<CR><LF>
2010-08-30 12:17:33,973 INFO  [STDOUT] Date: Mon, 30 Aug 2010 12:17:33 +0200 (CEST)
From: fr***.le***@charite.de
To: [b][color=#FF0000]fr***.le***@charite.de, fr***.le***@charite.de[/color][/b]
Message-ID: <1545333939.01283163453928.JavaMail.root@thunderstorm.charite.de>
Subject: OpenKM - NOTIFICATION - test
MIME-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_0_1624142202.1283163453866"
charset: UTF-8

------=_Part_0_1624142202.1283163453866
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Document: /okm:root/test
User: lek***
Message: test

------=_Part_0_1624142202.1283163453866
Content-Type: text/html
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type"/>
</head>
<body>
<b>Document: </b><a href="http://msc.charite.de:8080/OpenKM/es.git.openkm.frontend.Main/index.jsp?docPath=%2Fokm%3Aroot%2Ftest">/okm:root/test</a><br/><b>User: </b>lek***<br/><b>Message: </b>test<br/>
</body>
</html>
------=_Part_0_1624142202.1283163453866--

.
2010-08-30 12:17:33,989 INFO  [STDOUT] 250 2.0.0 Ok: queued as 064385CB8B
2010-08-30 12:17:33,989 INFO  [STDOUT] QUIT
2010-08-30 12:17:33,992 INFO  [STDOUT] 221 2.0.0 Bye
As you can see in the logs OpenKM just sends mails to fr***.le***@charite.de no matter which person I want to notify.

What have I configured wrong?
Thanks for your help.
 #6344  by jllort
 
OpenKM.cfg is not correct, if you connect to OpenLDAP then all uses are in LDAP repository, that means you've configured succesfully login-config.xml but OpenKM need getting users and roles, and user mails that are in your ldap too.

Take a look here: http://wiki.openkm.com/index.php/Active_Directory
or this http://forum.openkm.com/viewtopic.php?f ... pter#p5890

look for it "principal.adapter=es.git.openkm.principal.LdapPrincipalAdapter" on forum, you can find some interesting post
 #6350  by flekschas
 
I've looked in the wiki and already found the post with the principal adapter but I'm wondering why OpenKM can find users (with their corresponding uid entry) but is unable to find mail addresses. I mean the only difference between finding an uid and a mail is the name of the entry, so why does OpenKM find nothing?
Last edited by flekschas on Wed Sep 01, 2010 2:56 pm, edited 2 times in total.
 #6354  by jllort
 
Params in OpenKM.cfg are used to filtering ( make queries ) in your ldap, the reason is the query done is not correctly, basically the param you put in mail could not be correctly typewritten, invalid, etc... for some reason the user query is good and mail not.
 #6356  by flekschas
 
I found out that OpenKM can find the mail addresses but is unable to link them to the relating user.
When sending a mail via notification LDAP is looking for an inetOrgPerson object's mail attribute. The first located mail attribute is used for recipient. But OpenKM does not look exclusively for the mail address of a selected user.

So is it possible to do something like
Code: Select all
principal.ldap.mail.search.filter=(&(objectclass=inetOrgPerson)(uid={0}))
{0} should be a placeholder for the corresponding user

I'm a bit confused because when looking in the wiki (http://wiki.openkm.com/index.php/Active_Directory)you think it's possible but this post (http://forum.openkm.com/viewtopic.php?f ... pter#p5878) says it's not.

And how does OpenKM integrate the selected users in the mail search. (E.g. I've selected JohnDoe to be notified after a document-upload. So I have to look for a mail address where the uid or cn is JohnDoe. Is there something like a placeholder for the selected users which can be used for the LDAP Search??)

I hope I could describe my problem more precisely.
 #6414  by mateusz
 
Hi,

Is there any update on this issue. I am having the exact same problem.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.