Page 1 of 2

Error in sending document link as e-mail

PostPosted:Mon Feb 26, 2018 8:20 am
by saquib.akhtar
I am trying to send the link to any document via open km dashboard it's giving me an error:

can't send the command to SMTP host

what could be the error?

Openkm 6.3.4 on Ubuntu 16.04

Re: Error in sending document link as e-mail

PostPosted:Thu Mar 01, 2018 7:23 pm
by jllort
Did you configured tomcat mail poll https://docs.openkm.com/kcenter/view/ok ... -mail.html ?

Re: Error in sending document link as e-mail

PostPosted:Wed Aug 08, 2018 7:10 am
by saquib.akhtar
error

Re: Error in sending document link as e-mail

PostPosted:Wed Aug 08, 2018 8:31 am
by saquib.akhtar
getting following error while sending link to users

Re: Error in sending document link as e-mail

PostPosted:Fri Aug 10, 2018 5:56 am
by jllort
Seems you have some issue with the mail address, check for wrong mail address ( might be in catalina.log file into logs folders is shown more detailed information with the mail address text ).

Re: Error in sending document link as e-mail

PostPosted:Fri Aug 10, 2018 6:18 am
by saquib.akhtar
The problem is that the mail server hosted locally in DMZ Zone with IP: 172.31.X.X and same network IP for OPENKM.
I want open km to connect to 5555 port over DMZ ip for sending mails without any authentication.
But after checking logs from mail server and catalina.out I found it was making connections to port 25 and RCPT disconnect for wrong authentication.

This port 5555/tcp is open specially for OPENKM.

I have modified the file $TOMCAT_HOME/conf/server.xml file but still it is connecting to port 25.

$TOMCAT_HOME/conf/server.xml configuration:
Code: Select all
<Resource name="mail/OpenKM" auth="Container" type="javax.mail.Session"
          mail.transport.protocol="smtp"
          mail.smtp.auth="false"
          mail.smtp.host="172.31.XX.XX"
          mail.smtp.user="XXX@XXXX.com"
          password="XXXXX"
          mail.smtp.from="XXX@XXX.com"
          mail.smtp.starttls.enable="false"
          mail.port="5555"
          mail.smtp.port="5555"
          mail.debug="true"
 />

Re: Error in sending document link as e-mail

PostPosted:Sat Aug 11, 2018 10:00 am
by jllort
Did you restarted the OpenKM service, otherwise these changes into XML will not take effect.

Re: Error in sending document link as e-mail

PostPosted:Sun Aug 12, 2018 6:03 pm
by saquib.akhtar
Yes I have restarted the tomcat service many times but still it is making connections to port 25

Re: Error in sending document link as e-mail

PostPosted:Tue Aug 14, 2018 1:37 pm
by jllort
do you have only a single <Resource name="mail/OpenKM" uncomment in your server.xml file, might be you have more than one?

Re: Error in sending document link as e-mail

PostPosted:Thu Aug 16, 2018 5:55 am
by saquib.akhtar
I have checked the file thoroughly and it has only one Resource name="mail/OpenKM".
What could be the issue?
Is there any other configuration file?

Re: Error in sending document link as e-mail

PostPosted:Fri Aug 17, 2018 11:42 am
by jllort
This is the only configuration file and what is used for setting the mail poll, sincerely I have not any reason why the application is not using the ports assigned. Consider the port 5555 is not a standard mail port might the code when found strange port it is using default. This is not OpenKM code, we using standard JAVA mail support from tomcat and we do not take 100% control of what happens into.

Look at google if somebody have had some similar issue, might be a bug with mail.jar version, tomcat ? a possible solution might some nat from standard port to 5555 based in the IP what is trying to connect.

Re: Error in sending document link as e-mail

PostPosted:Fri Aug 17, 2018 11:47 am
by saquib.akhtar
The mail server and open KM server are in the same zone/network i.e. 172.31.255.X and port 5555 I have allowed especially for only same network members.
But still I can see the logs connecting to port 25 and then fails as no authentication is supplied !

Re: Error in sending document link as e-mail

PostPosted:Sun Aug 19, 2018 7:26 am
by jllort
You should not use parameter mail.port, you should use mail.smtp.port. If we take a look at the documentation https://tomcat.apache.org/tomcat-7.0-do ... l_Sessions it says:

WARNING - The default configuration assumes that there is an SMTP server listing on port 25 on localhost. If this is not the case, edit the <Context> element for this web application and modify the parameter value for the mail.smtp.host parameter to be the host name of an SMTP server on your network.

Also I suggest to replace the mail-XXXX.jar into the tomcat-XXX/lib by the latest release from here https://javaee.github.io/javamail/ might be it solve something ?

Re: Error in sending document link as e-mail

PostPosted:Tue Aug 21, 2018 1:22 pm
by saquib.akhtar
I downloaded the new mail-1.6.1 jar file and replaced under tomcat/lib with older one.
Removed the parameter mail.port and restarted the service.

But again same error pop up and log file error:
Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 554 5.7.1 <rimjhim.mishra@medhaj.com>: Recipient address rejected: SMTP AUTH is required for users under this sender domain

Re: Error in sending document link as e-mail

PostPosted:Thu Aug 23, 2018 9:33 am
by jllort
The error has changed, now it says you have not set SMTP user and password and that's the reason why is not able to send the mail.