Pages

Friday, December 30, 2011

Email Listener customization for SSL enabled email servers like gmail

Maximo out of box does not work with email server with SSL enable like gmail. We had the same situation at one of client where the client uses gmail as their official mail server.

To enable email listener for SSL a java customization is needed in  psdi.common.emailstner.EmailListnerTask.
Following code snippet needs to be added to readMessagesFromMailServer method


 if ("pop.gmail.com".equals(prop.getProperty("mail.pop3.host"))) {
        System.out.println("Inside custom prop set");
        prop.put("mail.store.protocol", "pop3");

        prop.put("mail.pop3.auth", "true");
        prop.put("mail.pop3.starttls.enable", "true");
        prop.put("mail.pop3.port.ssl.enable", "true");
        prop.put("mail.pop3.ssl.trust", "*");
        prop.put("mail.pop3.starttls.required", "true");
        prop.put("mail.pop3.auth.plain.disable", "true");

        prop.put("mail.pop3.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
        prop.put("mail.pop3.socketFactory.fallback", "false");
        prop.put("mail.pop3.socketFactory.port", "995");
      }

Along with this custimization SSL certificate needs to be downloaded to App Servers trust store from Email server host and port.


Rebuild and redeploy the ear and do the necessary configuration in email listener application with required account credentials and server details. Make to give security to which object the email listener update the details.

Note : This customization will not be supportable and upgradable as this is a change to oob maximo class.

10 comments:

  1. surbabu can you please let me know the steps to import the SSL certificate

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. In My TSRM statment prop.getProperty("mail.pop3.host") return null. I change it to: inboundCommCfgMbo.getString("MAILSERVER")

    ReplyDelete
    Replies
    1. bart , did you resolved this issue.is the below statement working
      inboundCommCfgMbo.getString("MAILSERVER")
      did u enabled SSL in by using above code..

      Delete
  5. Looks like there's some new support for this now.

    https://www.ibm.com/developerworks/mydeveloperworks/blogs/a9ba1efe-b731-4317-9724-a181d6155e3a/entry/email_listener_communications_via_gmail_part_i_importing_the_ssl_certificate8?lang=en

    ReplyDelete
    Replies
    1. This is feature in available without customization from Maximo 7.5

      Delete
  6. Suri... Do you have above code working with IMAP servers

    ReplyDelete