Mailservice and TLS

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Mailservice and TLS

Postby ThomasLund » 03 Jul 2012, 12:33

Hi,

My turn to ask a n00b question :-D

I'm trying to get SFS2X to send emails from the extension - first time I've had to do this.

So I do what every good developer should do and read the docs. OK - found the code and doing a quick test

Code: Select all

      IMailerService mailer = SmartFoxServer.getInstance().getMailService();

      SFSEmail welcomeMail = new SFSEmail(fromEmail, toEmail, "Welcome to Frontline Tactics", "Welcome to our little cool game. \n\nTODO!!! WRITE REAL MESSAGE");
      try {
         mailer.sendMail(welcomeMail);
      }
      catch (MessagingException e) {
         e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
      }


I configured the SFS server to point to 127.0.0.1 on my old Linux box running postfix. But trying to send gives me this in the mail logfile:

Code: Select all

Jul  3 14:23:01 webserver postfix/smtpd[3969]: setting up TLS connection from localhost[127.0.0.1]
Jul  3 14:23:01 webserver postfix/smtpd[3969]: SSL_accept error from localhost[127.0.0.1]: 0
Jul  3 14:23:01 webserver postfix/smtpd[3969]: warning: TLS library problem: 3969:error:14094416:SSL routines:SSL3_READ_BYTES:sslv3 alert certificate unknown:s3_pkt.c:1057:SSL alert number 46:
Jul  3 14:23:01 webserver postfix/smtpd[3969]: lost connection after STARTTLS from localhost[127.0.0.1]
Jul  3 14:23:01 webserver postfix/smtpd[3969]: disconnect from localhost[127.0.0.1]


So it connects, but attempts to use TLS connection. And thats where I get lost. Anyone with a clue?

The server generally works from perl scripts and other java programs to send out emails. So little lost. There seems to be nowhere that I can configure SFS to not use TLS

/Thomas
Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter: http://twitter.com/thomas_h_lund
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Mailservice and TLS

Postby Lapo » 03 Jul 2012, 13:21

Hey there. I am not a Mail protocol expert but... it might have to do with the SSLv3, although can't be sure 100%
We tested with a couple of SMTPs over SSL, including Gmail, and we didn't have problems but there's probably many different variants of the SSL/TSL standard.

Searching a bit I've found this:
http://bairdblog.wordpress.com/2008/04/ ... er-sshtls/
which indicates that there's probably several ways to configure java mail to talk to an SMTP over a secure socket.

In any case from the docs the supported SMTP ports are: 25, 587 and 465 (SSL). If possible I would stick with those.
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 105 guests