• Strange email sender

  • 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.
 #45158  by gennari
 
Hi there,
I configured ldap and tomcat email successfully in OpenKM 6.3.4. Now notifications are sent regularly, but there is a little issue in email from address. I have set tomcat mail in this manner:
Code: Select all
<Resource name="mail/OpenKM" type="javax.mail.Session" 
      mail.transport.protocol="smtp" mail.smtp.auth="true"
      mail.smtp.host="mail.diakont.it"
      mail.smtp.user="admin@diakont.it" password="xxxxxxxxxxx"
      mail.smtp.from="admin@diakont.it"
      mail.user="admin@diakont.it"
      mail.smtp.quitwait="false" mail.smtp.port="xxxxxx"
      mail.debug="true"/>
I have to use mail.user parameter because I have some smtp authentication errors, and in email from address I have this:
Code: Select all
"admin@diakont.it"@webserver
webserver is hostname of machine where OpenKM is installed.

How can I remove @webserver from sender address?

Thanks in advance.

Genna
 #45160  by jllort
 
I think your issue is with your LDAP integration, take a look at the value of the attribute principal.ldap.mail.attribute=mail ( if you are using another take a look at your ldap attribute list if this exists and the value what is into. If there's not attribute with right mail admin@diakont.it and all of them comes in this format "admin@diakont.it"@webserver then you should create your own LdapPrincipalAdapter to solve from code side ( it's quite easy simplye removing the @webserver from the captured mail address ).

Take a look at the class, it's quite easy to solve it :
https://github.com/openkm/document-mana ... .java#L142
 #45161  by gennari
 
I checked my configuration, and principal.ldap.mail.attribute=mail.

However I am not sure the problem come from LDAP. I try to clarify: I have to use mail.user attribute in tomcat mail config due to authentication problems in my mail server. For example, befor configuration I have posted, I set mail.user=openkm and resulting from field was openkm@webserver.

Now mail.user=admin@diakont.it, and from field is "admin@diakont.it"@webserver.


I hope I was enough clear.

Regards.

genna
 #45173  by jllort
 
I have never observed this behaviour. Try setting this atrribute
Code: Select all
mail.smtp.from="<sender email>"
 #45175  by gennari
 
I can't set mail.smtp.from as you write in last message (tomcat can't start, it gives this error: org.xml.sax.SAXParseException; systemId: file:/opt/openkm/tomcat-7.0.61/conf/server.xml; lineNumber: 57; columnNumber: 24; The value of attribute "mail.smtp.from" associated with an element type "Resource" must not contain the '<' character.).

I already set it to admin@diakont.it, and the behavior is that described.


Bye.


Genna
 #45190  by jllort
 
Without coma, was wrong copy & paste I have done.
 #45198  by jllort
 
I ignore from where appears the "@webserver" at the end. You should debug the code in order to identify if really is set from OpenKM side or it comes from another place.

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.