1 10 11 package org.mule.providers.email; 12 13 import org.mule.umo.lifecycle.InitialisationException; 14 15 18 public class Pop3sConnector extends Pop3Connector 19 { 20 public static final String DEFAULT_SOCKET_FACTORY = "javax.net.ssl.SSLSocketFactory"; 21 22 private String socketFactory = DEFAULT_SOCKET_FACTORY; 23 private String socketFactoryFallback = "false"; 24 private String trustStore = null; 25 private String trustStorePassword = null; 26 27 public static final int DEFAULT_POP3S_PORT = 995; 28 29 public String getProtocol() 30 { 31 return "pop3s"; 32 } 33 34 public int getDefaultPort() 35 { 36 return DEFAULT_POP3S_PORT; 37 } 38 39 public void doInitialise() throws InitialisationException 40 { 41 super.doInitialise(); 42 System.setProperty("mail." + getProtocol() + ".ssl", "true"); 43 System.setProperty("mail." + getProtocol() + ".socketFactory.class", getSocketFactory()); 44 System.setProperty("mail." + getProtocol() + ".socketFactory.fallback", getSocketFactoryFallback()); 45 46 if (getTrustStore() != null) 47 { 48 System.setProperty("javax.net.ssl.trustStore", getTrustStore()); 49 if (getTrustStorePassword() != null) 50 { 51 System.setProperty("javax.net.ssl.trustStorePassword", getTrustStorePassword()); 52 } 53 } 54 } 55 56 public String getSocketFactory() 57 { 58 return socketFactory; 59 } 60 61 public void setSocketFactory(String sslSocketFactory) 62 { 63 this.socketFactory = sslSocketFactory; 64 } 65 66 public String getSocketFactoryFallback() 67 { 68 return socketFactoryFallback; 69 } 70 71 public void setSocketFactoryFallback(String socketFactoryFallback) 72 { 73 this.socketFactoryFallback = socketFactoryFallback; 74 } 75 76 public String getTrustStore() 77 { 78 return trustStore; 79 } 80 81 public void setTrustStore(String trustStore) 82 { 83 this.trustStore = trustStore; 84 } 85 86 public String getTrustStorePassword() 87 { 88 return trustStorePassword; 89 } 90 91 public void setTrustStorePassword(String trustStorePassword) 92 { 93 this.trustStorePassword = trustStorePassword; 94 } 95 } 96 | Popular Tags |