Description of problem: When configuring a pop3 server in standalone.xml as, the following exception is thrown when reading the mailbox: Caused by: javax.mail.NoSuchProviderException: Invalid protocol: null at javax.mail.Session.getProvider(Session.java:440) [mail-1.4.5-redhat-1.jar:1.4.5-redhat-1] at javax.mail.Session.getStore(Session.java:539) [mail-1.4.5-redhat-1.jar:1.4.5-redhat-1] Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. add a pop3 server in the mail section <mail-session jndi-name="java:/MyMail" from="xxx@xxx"> <smtp-server outbound-socket-binding-ref="smtp-outbound"> <login name="xxx" password="xxx"/> </smtp-server> <pop3-server outbound-socket-binding-ref="pop3-outbound"> <login name="xxx" password="xxx"/> </pop3-server> </mail-session> 2. try to read the mailbox Actual results: Throws an javax.mail.NoSuchProviderException Expected results: Additional info: The bug is probably in class org.jboss.as.mail.extension.MailSessionService, where no protocol for pop3 is set. Code snippet to make it work: private Properties getProperties() throws StartException { Properties props = new Properties(); if (config.getSmtpServer() != null) { props.setProperty("mail.transport.protocol", "smtp"); setServerProps(props, config.getSmtpServer(), "smtp"); } if (config.getImapServer() != null) { props.setProperty("mail.store.protocol", "imap"); setServerProps(props, config.getImapServer(), "imap"); } if (config.getPop3Server() != null) { props.setProperty("mail.store.protocol", "pop3"); // THIS LINE WAS MISSED setServerProps(props, config.getPop3Server(), "pop3"); } if (config.getCustomServers() != null) { configureCustomServers(props, config.getCustomServers()); } if (config.getFrom() != null) { props.setProperty("mail.from", config.getFrom()); } props.setProperty("mail.debug", String.valueOf(config.isDebug())); MailLogger.ROOT_LOGGER.tracef("props: %s", props); return props; }
verified on EAP 6.4.0.DR11