You are here: Reference Manual > FME Server Services > Notification Service > Publishers > Email (SMTP) Publisher Settings

Email (SMTP) Publisher Settings

Most settings are stored in <FMEServerDir>/Utilities/smtprelay/james/apps/james/SAR-INF/config.xml. For a complete reference on configurations, see http://james.apache.org/.

The following is the configuration section most relevant to the Email (SMTP) publisher. For a description of the parameter tags, see the Example Email (SMTP) Publication

<mailet match="All" class="FMENotificationMailet">

 

<!-- Relayer server path -->

<relayServerPath>D:/Apps/FMEServer/Server</relayServerPath>

 

<!-- Email publisher name -->

<emailPublisherName>email</emailPublisherName>

 

<!-- Directory where email attachments should be stored. If "system" specified, system temp directory is used. -->

 

<emailAttachmentDir>system</emailAttachmentDir>

<!-- This section defines the keywords used by the notification

messages sent from this mailet -->

<emailSender>email_relay_from</emailSender>

<emailRecipients>email_relay_to</emailRecipients>

<emailSubject>email_relay_subject</emailSubject>

<emailContent>email_relay_content</emailContent>

<emailSentDate>email_relay_sent</emailSentDate>

<emailReceivedDate>email_relay_received</emailReceivedDate>

<emailAttachment>email_relay_attachment</emailAttachment>

</mailet>

Attachment Directory

Specifies the location where the attachment files of incoming emails are stored. By default, system is specified, meaning that the system temp directory is used. This value can be changed by modifying the <emailAttachmentDir> XML tag.

For example:

<emailAttachmentDir>D:/temp/myattachments</emailAttachmentDir>

Deploying with a public DNS

The public DNS name for email addresses (host name after @) is for display only and is used by the Protocol Service to show expected email addresses. It does not affect the functionality of the James Server.

If you are deploying a production server to send and receive emails over the Internet, you must change the server name from localhost to a public DNS name by changing the <servername> XML tag value.

For example, if the public DNS is mycompany.com then change:

<servername>localhost</servername>

to

<servername>mycompany.com</servername>

This example allows FME Server to receive emails to <username>@mycompany.com

Configuring secure SMTP and POP3 servers with SSL/TLS

Secure SMTP and POP3 operate through ports 465 and 995, and are disabled by default. To allow FME Server to receive email messages via SMTP through port 465, follow these steps:

  1. Obtain an SSL certificate from a certification authority, and deploy it to the following directory:
  2. <FMEServerDir>/Utilities/smtprelay/james/apps/james/conf

    OR

    1. Create an uncertified keystore file:
    2. keytool -genkey -alias james -keyalg RSA

    3. The local uncertified .keystore file is placed in C:\Users\<logged in user>\. Move it to the James conf folder:
    4. <FMEServerDir>/Utilities/smtprelay/james/apps/james/conf

  3. Update the config.xml file (<FMEServerDir>\Utilities\smtprelay\james\apps\james\SAR-INF\config.xml):
    1. Create a backup of the file.
    2. In the original file, locate <smtpserver enable="true"> and remove.
    3. Locate <smtpserver-tls enabled="false"> and set it to "true".

      Locate <pop3server-tls enabled="false"> and set it to "true".

    4. Locate the <server-sockets> section (near bottom) and enable the factory name "ssl" by removing the comments tag before and after this section.
    5. <factory name="ssl" class="org.apache.avalon.cornerstone.blocks.sockets.TLSServerSocketFactory">

      <ssl-factory>

      <keystore>

      <file>conf/keystore</file> <!-- replace this with the relative path of your certificate keystore -->

      <password>secret</password> <!-- replace this with your keystore password -->

      <key-password>keysecret</key-password> <!-- replace this with your priviate key password -->

      <type>JKS</type>

      <protocol>TLS</protocol>

      <algorithm>SunX509</algorithm>

      <authenticate-client>false</authenticate-client>

      </keystore>

      </ssl-factory>

      </factory>

    6. In this same section, update the passwords <password> and <key-password>, and ensure the <file> location is correct.
  4. Check the assembly.xml file (<FMEServerDir>\Utilities\smtprelay\james\apps\james\SAR-INF\assembly.xml):
  5. Ensure the following section exists. If it doesn’t, simply duplicate the equivalent section for smtpserver and change the name to smtpserver-tls.

    <!-- SMTP Server TLS -->

    <block name="smtpserver-tls"

    class="org.apache.james.smtpserver.SMTPServer" >

    <provide name="James" role="org.apache.mailet.MailetContext"/>

    <provide name="localusersrepository"

    role="org.apache.james.services.UsersRepository"/>

    <provide name="dnsserver"

    role="org.apache.james.services.DNSServer"/>

    <provide name="sockets"

    role="org.apache.avalon.cornerstone.services.sockets.SocketManager"/>

    <provide name="connections"

    role="org.apache.james.services.JamesConnectionManager"/>

    <provide name="James"

    role="org.apache.james.services.MailServer"/>

    <provide name="thread-manager"

    role="org.apache.avalon.cornerstone.services.threads.ThreadManager" />

    </block>

  6. Check the environment.xml file (<FMEServerDir>\Utilities\smtprelay\james\apps\james\SAR-INF\environment.xml):
  7. To control the level of logging, ensure this entry exists.

    <category name="smtpserver-tls" log-level="DEBUG">

    <log-target id-ref="smtpserver-target"/>

    </category>

  8. Restart the FME Server SMTP Relay Service in Windows Services. There is no need to restart FME Server.

POP3 and SMTP ports

  • Non-secure: POP3: 110, SMTP: 25
  • Secure with SSL: POP3: 995, SMTP: 465

The ports listed above are standard for POP3 and SMTP, and cannot be changed if your server wants to communicate with other email servers such as Gmail. We recommend turning off the non-secure SMTP and POP3 ports once you have servers working over SSL. For detailed instructions, see http://wiki.apache.org/james/UsingSSL.