problem with sending mail

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

Post Reply
Billyboy
Posts: 8
Joined: 19 Aug 2006, 08:30

problem with sending mail

Post by Billyboy »

I try to send mail by _server.sendMail function.

I set these properties in config.xml :

<Mailer>
<MailHost>server_ip</MailHost>
<MailUser>local_user</MailUser>
<MailPass></MailPass>
</Mailer>

where server_ip is the same as SFS ip, local_user was set to
a local user name or complete e-mail address, pass is empty
as sendmail does no validation. The server runs RedHat Linux and sendmail as
smtp server. Version of SFS is 1.4.0 and try at 1.4.2.

The same code works when I test it on my desktop and send mail
thru smtp on another local pc.

Whow do I configure SFS config.xml for sending mails?

jvm 1 | Exception in thread "ExtensionHandler-1" java.lang.NoClassDefFoundError: javax /activation/DataSource
jvm 1 | at it.gotoandplay.smartfoxserver.lib.MailManager.sendMail(MailManager.jav a:78)
jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
jvm 1 | at java.lang.reflect.Method.invoke(Unknown Source)
jvm 1 | at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:142)
jvm 1 | at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:201 )
jvm 1 | at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:84)
jvm 1 | at org.mozilla.javascript.gen.c1._c40(DExt.as:724)
jvm 1 | at org.mozilla.javascript.gen.c1.call(DExt.as)
jvm 1 | at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:84)
jvm 1 | at org.mozilla.javascript.gen.c1._c65(DExt.as:1407)
jvm 1 | at org.mozilla.javascript.gen.c1._c55(DExt.as:1161)
jvm 1 | at org.mozilla.javascript.gen.c1._c41(DExt.as:736)
jvm 1 | at org.mozilla.javascript.gen.c1.call(DExt.as)
jvm 1 | at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:33 7)
jvm 1 | at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2755 )
jvm 1 | at org.mozilla.javascript.gen.c1.call(DExt.as)
jvm 1 | at it.gotoandplay.smartfoxserver.extensions.JavascriptExtension.callJavaS criptFunction(JavascriptExtension.java:424)
jvm 1 | at it.gotoandplay.smartfoxserver.extensions.JavascriptExtension.handleReq uest(JavascriptExtension.java:209)
jvm 1 | at it.gotoandplay.smartfoxserver.controllers.ExtensionHandler.processEven t(ExtensionHandler.java:511)
jvm 1 | at it.gotoandplay.smartfoxserver.controllers.ExtensionHandler.run(Extensi onHandler.java:357)
jvm 1 | at java.lang.Thread.run(Unknown Source)

By the way, when SFS is run by 'sfs start', no errors appear in log. I have to
run it in foregroung with 'sfs console' to see any debug info.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

there seem to be a wrong reference in the classpath in the wrapper.conf file.

Open it from the runAsService/conf folder and look for the following line:

Code: Select all

wrapper.java.classpath.10=__INSTALL_PATH__/Server/lib/javamail/activation.jar
change the

Code: Select all

Server/lib/javamail/activation.jar
to

Code: Select all

Server/lib/activation.jar
save and stop/start the server.

Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
Billyboy
Posts: 8
Joined: 19 Aug 2006, 08:30

Post by Billyboy »

Lapo wrote:there seem to be a wrong reference in the classpath in the wrapper.conf file.

Open it from the runAsService/conf folder and look for the following line:

Code: Select all

wrapper.java.classpath.10=__INSTALL_PATH__/Server/lib/javamail/activation.jar
change the

Code: Select all

Server/lib/javamail/activation.jar
to

Code: Select all

Server/lib/activation.jar
save and stop/start the server.

Hope it helps
All ok! thank you very much :)

So how about log files?
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

from what you have written it seems you're running the server under linux. Is this correct? If so you can find the logs in the runAsService/wrapper.log file
Lapo
--
gotoAndPlay()
...addicted to flash games
Billyboy
Posts: 8
Joined: 19 Aug 2006, 08:30

Post by Billyboy »

Lapo wrote:from what you have written it seems you're running the server under linux. Is this correct? If so you can find the logs in the runAsService/wrapper.log file
I find in this file just one line for week sfs working!!! May be problem in config?

<FileLoggingLevel>CONFIG</FileLoggingLevel>
<ConsoleLoggingLevel>INFO</ConsoleLoggingLevel>
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Try this:

1. change your settings to:

Code: Select all

 <FileLoggingLevel>FINE</FileLoggingLevel>
<ConsoleLoggingLevel>FINE</ConsoleLoggingLevel>
2. stop the server
3. delete the wrapper.log file
4. start the server

check your wrapper.log file after the server started, you should see a long list of messages, including server version, system info, zone setup etc...
Lapo
--
gotoAndPlay()
...addicted to flash games
Billyboy
Posts: 8
Joined: 19 Aug 2006, 08:30

Post by Billyboy »

Lapo wrote:Try this:

1. change your settings to:

Code: Select all

 <FileLoggingLevel>FINE</FileLoggingLevel>
<ConsoleLoggingLevel>FINE</ConsoleLoggingLevel>
2. stop the server
3. delete the wrapper.log file
4. start the server

check your wrapper.log file after the server started, you should see a long list of messages, including server version, system info, zone setup etc...

there are two wrapper.log files

./Server/logs/wrapper.log
./Server/runAsService/wrapper.log

the one in log/ is never written to
will it break anything if we symlink it to the other one?
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

As I mentioned above the file is -> runAsService/wrapper.log
will it break anything if we symlink it to the other one?
I don't think so, but I am not 100% sure :)
Lapo
--
gotoAndPlay()
...addicted to flash games
Billyboy
Posts: 8
Joined: 19 Aug 2006, 08:30

Post by Billyboy »

One more question about sfs and linux: does sfs have possibility of launching after reboot of computer? We can create launch script, but maybe there is some algorithm? Should sfs start by root priveleges or not?
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Yes,
check chapter 1.3 of our documentation --> http://www.smartfoxserver.com/docs/
under the Linux installation
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply