Monday, March 23, 2015

Setting up Apache JAMES mail server

Apache JAMES is a free mail server that you  can you can use to test email capabilities that uses SMTP, POP etc. It is quite easy to set up and use for testing purposes.

You could go through following steps to install and configure JAMES mail server.

1. Download Apache JAMES from http://james.apache.org/download.cgi.
2. Unzip the downloaded directory and go to bin folder and execute the run.sh (When using Linux/mac)
3. Remember to execute the script from the root as below, else you might run into permission denied exceptions.
sudo -E ./run.sh
Note:  -E (preserve environment) option will preserve JAVA_HOME variable. (Else you might end up with JAVA_HOME  not set error)

4. Once the script is executed, you will be provided with following .

5. Next go to JAMES installation dir/ apps/ James/SAR-INF/config.xml
 Uncomment below line.
<dnsserver> 
<servers>
<server>127.0.0.1<server>
<servers>
<dnsserver>

(Note: If you need to set up a different domain, you need to set domain name at <servername></servername> , and add the relevant DNS servers at above)

6. Open another tab in command prompt and type below command.
telnet localhost 4555
Note: You need to run the script run.sh before this step and do not close it.

7. Now you will be provided with following interface.

Log in with root/root credentials, and you can use adduser command(adduser username password) to add a new user under localhost.

8. Now you can create an email address as emma@localhost(to receive mails on port 25) and test you email functionalities. Once you send an email, following path will contain the mail object JAMES dir/apps/james/var/mail/inbox/emma . To view the email been sent, setup an email client such as mozilla thunderbird. You could refer to http://kb.site5.com/email/email-software/mozilla-thunderbird/thunderbird-how-to-save-or-remove-emails-from-the-server/

No comments:

Post a Comment