Version 15

    How to Change SMTP or POP Port Configuration for JBoss Mail Server 1.0M3

     

    versions: 1.0M3, 1.0M4, 1.0M5pre1

     

    Find the config file

     

    Open a shell and cd to $JBOSS_HOME/server/$CONFIG where JBOSS_HOME is the directory you told the installer to install JBMS into.   Config is the name of the configuration you told the installer to use or the argument you pass to "run.sh -c" or "default" if you pass nothing to run.sh/bat.  From there go into the deploy/mail.ear/mail.sar/META-INF directory.  You should see a file called "jboss-service.xml".  Open it in your favorite editor.

     

    SMTP

     

    Find this section:

     

      <!-- defines an SMTP server.  -->
      <mbean code="org.jboss.mail.Server"
        name="jboss.mail:type=MailServices,name=SMTP">
        <depends>jboss.mail:type=MailServices,name=SMTPProtocol</depends>
         <!-- should link to the protocol factory in depends.  Presently classpath protocol factories
              aren't supported unless they can find their own properties -->
    <!--     <attribute name="ProtocolFactoryName">jmx:jboss.mail:type=MailServices,name=ProtocolFactory</attribute>-->
          <!-- protocol should reference SMTP -->
         <attribute name="Protocol">jboss.mail:type=MailServices,name=SMTPProtocol</attribute>
         <!-- port to listen on -->
         <attribute name="Port">25</attribute>
         ....
    

     

    Change the port attribute to whatever you like (ports below 1000 require root access on most UNIX systems).  The SMTP/SSL service looks exactly the same except the name is "jboss.mail:type=[MailServices|DOC-10548],name=SMTPSSL" by default.

     

    POP

     

    Find this section:

     

      <!-- defines a POP server. -->
      <mbean code="org.jboss.mail.Server"
        name="jboss.mail:type=MailServices,name=POP3">
        <depends>jboss.mail:type=MailServices,name=POP3Protocol</depends>
         <!-- should link to the protocol factory in depends.  Presently classpath protocol factories
              aren't supported unless they can find their own properties -->
    <!--     <attribute name="ProtocolFactoryName">jmx:jboss.mail:type=MailServices,name=ProtocolFactory</attribute>-->
         <!-- options are presently POP or SMTP, we want POP -->
         <attribute name="Protocol">jboss.mail:type=MailServices,name=POP3Protocol</attribute>
         <!-- port to listen on -->
         <attribute name="Port">110</attribute>
    

     

    Change the port attribute to whatever you like (ports below 1000 require root access on most UNIX systems).  The POP/SSL service looks exactly the same except the name is "jboss.mail:type=[MailServices|DOC-10548],name=POP3SSL">" by default.

     

    Warning

     

    Many services such as SMTP operate best when on their IANA "well known port" defaults and most mail clients tend to default to these ports as well.  You may not be able to recieve incomming mail if you do not take this into consideration.  See: HowToRunJBossMailServerWithoutSuperuserAccess for details on port forwarding strategies.