1

Topic: Use of stmp from a remote client

==== Required information ====
- iRedMail version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  MySQL
- Linux/BSD distribution name and version: Ubuntu 12.0.4 LTS
- Related log if you're reporting an issue:
====

sending emails via STARTTLS works on iredmail server.  In other words, webmail client is able to send emails if it is installed on iredmail server.
If webmail client is on another machine, i.e my laptop, I get the following error (from mail logs):

Mar 23 18:31:34 828-1262 postfix/smtpd[1948]: SSL_accept error from unknown[41.82.154.69]: 0
Mar 23 18:31:34 828-1262 postfix/smtpd[1948]: warning: TLS library problem: 1948:error:14094416:SSL routines:SSL3_READ_BYTES:sslv3 alert certificate unknown:s3_pkt.c:1256:SSL alert number 46:
MarMar 23 18:31:34 828-1262 postfix/smtpd[1948]: SSL_accept error from unknown[41.82.154.69]: 0
Mar 23 18:31:34 828-1262 postfix/smtpd[1948]: warning: TLS library problem: 1948:error:14094416:SSL routines:SSL3_READ_BYTES:sslv3 alert certificate unknown:s3_pkt.c:1256:SSL alert number 46:

It seems that there is a problem with SSL certificates from remote users (identified as "unknown" in this case).

Please help.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Use of stmp from a remote client

Do you configure your webmail client on another machine to use IMAPS (IMAP over STARTTLS) instead of IMAP protocol?

3

Re: Use of stmp from a remote client

This is a custom app (using Javamail) which sends emails using STARTTLS.  The script always worked fine.  The issue came up after I moved iRedMail from one server to another.

In other words, when I deploy my application on the iRedMail server, every thing works fine.  When I run my application in my test environment (my laptop), I am enable to connect remotely to postfix during my smtp session.

4

Re: Use of stmp from a remote client

*) What do you mean "moved iRedMail from one server to another"? How did you move it?
*) Show us your SMTP settings in your application in your laptop.

5

Re: Use of stmp from a remote client

I installed iRedMail on another server and moved the mailbox.  And via support ticket, the mail settings were "duplicated" from the old box to thenew one.

Here is the test script.  Note that there is no point debugging the test script because it functions properly.  What does not function properly (probably) is the configuration of postfix.

*******
smtp=request.getParameter("smtp");
    from=request.getParameter("from");
    to=request.getParameter("to");
    user=request.getParameter("user");
    passwd=request.getParameter("passwd");
    port=request.getParameter("port");
try {
        props = System.getProperties();
        props.put("mail.smtp.starttls.enable", "true");
        props.put("mail.smtp.host", smtp);
        props.put("mail.smtp.user", user);
        props.put("mail.smtp.password", passwd);
        props.put("mail.smtp.port", port);
        props.put("mail.smtp.auth", "true");
        props.put("mail.debug", "true");

        sessionmail = javax.mail.Session.getInstance(props, null);
       
        message = new MimeMessage(sessionmail);
        Address fromAddress = new InternetAddress(from);
        Address toAddress = new InternetAddress(to);
        message.setFrom(fromAddress);
        message.setRecipient(Message.RecipientType.TO, toAddress);
        message.setSubject("Testing JavaMail");
        message.setText("Welcome to JavaMail");
       
        transport = sessionmail.getTransport("smtp");
        transport.connect(smtp, user, passwd);
        //message.saveChanges();
        //Transport.send(message);
        transport.sendMessage(message, message.getAllRecipients());
        //transport.close();
       

    }catch(Exception ex){

        out.println("<html><head></head><body>");
        out.println("ERROR: " + ex);
        out.println("</body></html>");
    }
*********

ZhangHuangbin wrote:

*) What do you mean "moved iRedMail from one server to another"? How did you move it?
*) Show us your SMTP settings in your application in your laptop.

6

Re: Use of stmp from a remote client

Zhang,

It really looks like it is related to SSL because I also get the following error on the java compiler:

ERROR: javax.mail.MessagingException: Can't send command to SMTP host; nested exception is: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

7

Re: Use of stmp from a remote client

Did you use a valid SSL certificate? if it's a self-signed ssl certificate, how did you generate it?