Page 1 of 1

mail config stopping server from starting

PostPosted:Mon Sep 15, 2014 1:05 pm
by gwaitsi
Hi, using the config as provided on the wiki/documention page i.e. below
Code: Select all
<Resource name="mail/OpenKM" auth="Container" type="javax.mail.Session"
    mail.transport.protocol="smtp"
    mail.smtp.auth="true"
    mail.smtp.host="smtp.gmail.com"
    mail.smtp.port="465"
    mail.user="<username>"
    mail.password="<password>"
    mail.smtp.from="<sender email>"
    mail.smtp.quitwait="false"
    mail.smtp.starttls.enable="true"
    mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"
    mail.debug="true"/>
i'm getting the below errors, preventing the server from starting.
Code: Select all
2014-09-15 14:57:36,416 [main] WARN  org.apache.catalina.startup.Catalina- Catalina.start using conf/server.xml: The value of attribute "mail.user" associated with an element type "null" must not contain the '<' character.
2014-09-15 14:57:36,416 [main] FATAL org.apache.catalina.startup.Catalina- Cannot start server. Server instance is not configured.
any ideas please.

Re: mail config stopping server from starting

PostPosted:Tue Sep 16, 2014 7:25 am
by Catscratch
Your config is wrong. You have the replace <username> by your mail account, <password> by your mail credentials and <sender email> by some valid email adress.

Re: mail config stopping server from starting

PostPosted:Tue Sep 16, 2014 10:03 pm
by gwaitsi
according to the documentation catscratch, that is not right.
http://wiki.openkm.com/index.php/Tomcat ... figuration

specifically,
Optionally, you can use mail.user="<username>" and mail.password="<password>" parameters

as i understand it, the <> are suppose to pass a variable, but this now seems to be invalid.

Re: mail config stopping server from starting

PostPosted:Wed Sep 17, 2014 8:58 am
by Catscratch
No, you can't use "<" or ">" in an XML file unless you quote it.

E.g. Let's assume your username is Mike@mail.com and your password is myawesomesecret.

Then the config would look like this:
Code: Select all
mail.user="Mike@mail.com"
mail.password="myawesomesecret"

Re: mail config stopping server from starting

PostPosted:Fri Sep 19, 2014 7:34 am
by gwaitsi
appreciate what you are saying catscratch, but according to the docs, it is supposed to be able to use the mail based on the individual user loggedin. hence the desire to use a variable and not a hard coded address.

Therefore i really need to solve the issue of using variables.

cheers

Re: mail config stopping server from starting

PostPosted:Fri Sep 19, 2014 7:56 am
by Catscratch
No, you can't use variables. Where should they come from? You have to specify ONE user account which is used for mail transfer. It is NOT possible to insert some kind of variables to use the mail account of each openkm user therefor. This is not how tomcat configuration works.