How to configure JES mail-server

For the purpose of using notifications system and feature of importing messages from email as tasks, TrackStudio requires POP3/SMTP server. And for this purpose, you can use any server you know (or even mail service like Gmail or Yandex Mail). For configuring and testing you can also use pre-configured Java E-mail Server (JES) shipped with in TrackStudio Standalone.

So as to use JES for sending notifications:

  1. Open the file jes/etc/mail.conf in a text editor. Comment the parameter defaultsmtpservers and specify the address of SMTP-server of your organization.
  2. Run Java E-mail Server (jes/jes). (For running it in GNU/Linux OS use the command sudo sh jes
  3. Run the application Server Manager (SMAN).
  4. Go to the tab “E-mail”, and then to “E-mail Notification”.
  5. Check the option “Enable e-mail notification”. Do not change other parameters.
  6. Specify the SMTP port. Generally this port is 25 (in that case the field can be left blank), but if such port is busy, you can indicate another one in the file jes/etc/mail.conf.
  7. Press the button “Start” and wait till TrackStudio gets started.
  8. Login the system through your browser with your user account.
  9. Specify your e-mail address in the user settings (So as to go to your account settings, press on your name at the welcome message on the top of page in TrackStudio and then press the button “Edit”).
  10. Go to the project, for which you want to create the notification.
  11. In the menu, select the item “Event Notification” (if there is no such menu-item present, it means you have not enabled the feature to send notifications in Server Manager.
  12. Create the event notification, as described in the documentation article “How to notify users about changes through E-mail

How it works:

  1. Someone from the users changes or adds the task, executes the operation on the task or leaves a comment.
  2. If the specified task fulfills the conditions of filter, preset for notification, TrackStudio creates the E-mail message and sends it through the mentioned SMTP-server (in this case JES) to the subscribers, for whom this notification has been created.
  3. JES redirects this message to the server, specified in the parameter defaultsmtpservers in the file mail.conf.
  4. Mail server sends these messages to the mail boxes of the users.
  5. Then the users receive this message through their mail clients.

So as to use JES for receiving email messages:

  1. Configure JES for sending the notifications, as described above and make sure that the notifications are delivered to the intended addressees.
  2. Run Java E-mail Server (jes/jes). (For running GNU/Linux OS, use the command sudo sh jes

    Run Java E-mail Server (jes/jes). (For running in the ОS GNU/Linux use the command sudo sh jes)

  3. Run the program Server Manager (SMAN).
  4. Go to the tab “E-mail”, and then to “E-mail submission”.
  5. Check the option “Enable e-mail submission”
  6. Specify the import interval in minutes. While testing, it is better to specify minimum interval at 1 minute, so that you didn’t need to wait long for processing of messages in queue.
  7. Specify the address of mail server (for the purposes of testing, you can leave 127.0.0.1)
  8. Specify the port for POP3-server. Generally this port is 110 (in that case, the field can be left empty), but if such port is busy, you can indicate another in the file jes/etc/mail.conf.
  9. Press the button “Start” and wait till TrackStudio gets started.

How it works:

  1. User sends the mail to the address trackstudio@127.0.0.1.
  2. JES determines that the address of receiver is located in the local domain and forwards it to the respective internal mail box, which is used by the TrackStudio.
  3. When TrackStudio determines the presence of message in the mail box, it processes it and depending upon the results of processing, creates the task or comment to the task.

For testing, you can create mail boxes for existing users of TrackStudio on JES server. For this purpose:

  1. Stop JES server
  2. Open the file jes/etc/user.conf
  3. Create the records in it in the form of type user.username@localhost=<password>
  4. Run JES server.
  5. In mail client indicate the login username@localhost and the specified password..

Details about configuring the import of tasks from email have been described in the article “ How to import emails from users to tasks”.

Debugging of email notifications system

Logs of the working of Java Email Server are saved in the file jes/log/jes.log. You can configure the display of these logs in the file jes/etc/log.conf (this is generally the configuration logger file log4j). For debugging, it is better to use the layer debug.

Similarly, you can see the logs of processing of TrackStudio mail also. For this purpose, set the parameter mail.debug=true in the file trackstudio.mail.properties. After this, debugging details will be displayed in the file trackstudio.log.

After mails are received by the JES server, messages are distributed into folders, corresponding to the boxes of user accounts. So, for example, messages for analyst@localhost will remain stored in the folder jes/etc/users/analyst@localhost in the form of text files, until they are not deleted by the user himself from the mail client.