Page 1 of 1

Strange email sender

PostPosted:Fri Jan 05, 2018 4:03 pm
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

Re: Strange email sender

PostPosted:Sat Jan 06, 2018 9:57 am
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

Re: Strange email sender

PostPosted:Mon Jan 08, 2018 10:53 am
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

Re: Strange email sender

PostPosted:Wed Jan 10, 2018 8:07 am
by jllort
I have never observed this behaviour. Try setting this atrribute
Code: Select all
mail.smtp.from="<sender email>"

Re: Strange email sender

PostPosted:Wed Jan 10, 2018 2:13 pm
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

Re: Strange email sender

PostPosted:Fri Jan 12, 2018 9:22 am
by jllort
Was only a sample should be as mail.smtp.from="admin@diakont.it,"

Re: Strange email sender

PostPosted:Fri Jan 12, 2018 3:52 pm
by gennari
With comma?

Without comma, the behaviour it that I described.

Re: Strange email sender

PostPosted:Sat Jan 13, 2018 6:06 pm
by jllort
Without coma, was wrong copy & paste I have done.

Re: Strange email sender

PostPosted:Mon Jan 15, 2018 8:56 am
by gennari
Without the result is:

"admin@diakont.it"@webserver

Re: Strange email sender

PostPosted:Wed Jan 17, 2018 8:16 am
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.