Strange email sender

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.
Post Reply
gennari
Fresh Boarder
Fresh Boarder
Posts: 10
Joined: Tue Jan 02, 2018 3:41 pm

Strange email sender

Post by gennari » Fri Jan 05, 2018 4:03 pm

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

jllort
Moderator
Moderator
Posts: 10244
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Strange email sender

Post by jllort » Sat Jan 06, 2018 9:57 am

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

gennari
Fresh Boarder
Fresh Boarder
Posts: 10
Joined: Tue Jan 02, 2018 3:41 pm

Re: Strange email sender

Post by gennari » Mon Jan 08, 2018 10:53 am

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

jllort
Moderator
Moderator
Posts: 10244
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Strange email sender

Post by jllort » Wed Jan 10, 2018 8:07 am

I have never observed this behaviour. Try setting this atrribute

Code: Select all

mail.smtp.from="<sender email>"

gennari
Fresh Boarder
Fresh Boarder
Posts: 10
Joined: Tue Jan 02, 2018 3:41 pm

Re: Strange email sender

Post by gennari » Wed Jan 10, 2018 2:13 pm

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

jllort
Moderator
Moderator
Posts: 10244
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Strange email sender

Post by jllort » Fri Jan 12, 2018 9:22 am

Was only a sample should be as mail.smtp.from="admin@diakont.it,"

gennari
Fresh Boarder
Fresh Boarder
Posts: 10
Joined: Tue Jan 02, 2018 3:41 pm

Re: Strange email sender

Post by gennari » Fri Jan 12, 2018 3:52 pm

With comma?

Without comma, the behaviour it that I described.

jllort
Moderator
Moderator
Posts: 10244
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Strange email sender

Post by jllort » Sat Jan 13, 2018 6:06 pm

Without coma, was wrong copy & paste I have done.

gennari
Fresh Boarder
Fresh Boarder
Posts: 10
Joined: Tue Jan 02, 2018 3:41 pm

Re: Strange email sender

Post by gennari » Mon Jan 15, 2018 8:56 am

Without the result is:

"admin@diakont.it"@webserver

jllort
Moderator
Moderator
Posts: 10244
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Strange email sender

Post by jllort » Wed Jan 17, 2018 8:16 am

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests