Apache James is a popular open-source mail server. It supports both SMTP, POP3, and IMAP protocols. This article will tell you how to install Apache James both on Windows and Linux, how to create a user account on it, and how to use the free email client tool Thunderbird to connect to it to send and receive emails.
1. Install And Run Apache James On Windows.
1.1 Install Apache James On Windows.
- Download the latest Apache James version from the official website. I use Apache James 3.2.0. The zip file name is james-server-app-3.2.0-app.zip.
- Unzip the download file to a local folder.
- Open a dos window and cd into bin folder under above folder for example C:\WorkSpace\Tool\james-server-app-3.2.0-app\james-server-app-3.2.0\bin.
- Before running the Apache James mail server, make sure you have JDK 8 installed.
- Execute run.bat in the dos window then Apache James server started.
1.2 Change SMTP And POP3 Port Number.
- When Apache James started, it starts both SMTP and POP3 mail servers, SMTP is used to send emails out while POP3 is used to receive income emails.
- The default SMTP server port number is 25, and the default POP3 server port number is 110.
- But you can change the default SMTP and POP3 port number by edit the file conf/smtpserver.xml and conf/pop3server.xml. The conf folder is located in the Apache James root folder. For example C:\WorkSpace\Tool\james-server-app-3.2.0-app\james-server-app-3.2.0\conf.
- Open the smtpserver.xml file in a file editor and edit the below code to change the default SMTP port number.
<smtpservers> <smtpserver enabled="true"> <jmxName>smtpserver</jmxName> <bind>0.0.0.0:25</bind>
- Open the pop3server.xml file and edit the below code to change the default pop3 port number.
<pop3servers> <pop3server enabled="true"> <jmxName>pop3server</jmxName> <bind>0.0.0.0:110</bind>
- Now restart the Apache James server again, it will use the new SMTP and POP3 port number.
2. Install And Run Apache James On Ubuntu Linux.
2.1 Install Apache James On Ubuntu Linux.
- Download Apache James 3.2.0 zip file ( james-server-app-3.2.0-app.zip ) to a local directory.
- Unzip the zip file to a local folder. You can use the command like
$ unzip ./james-server-app-3.2.0-app.zipor use the GUI tool.
- Also, make sure you have JDK 8 installed in your Ubuntu.
- Make sure the libc6 package has been installed in Ubuntu also. You can see the install requirements at https://james.apache.org/server/quick-start.html.
- Now cd into the bin folder under James root folder ( /home/jerry/tool/james-server-app-3.2.0/bin ), run
$ sudo ./run.shto start Apache James mail server.
2.2 Change SMTP And POP3 Port Number.
- Please refer to section 1.2 on how to change SMTP, POP3 server port numbers in Windows.
3. Add Email Domain And User In Apache James.
Now we have installed and started the Apache James mail server on both Windows and Linux, we need to add an email domain and email user account in it to make a test.
- Open the dos window in Windows or open a terminal in Ubuntu Linux.
- Then go to the Apache James bin folder and run the command james-cli in the bin folder to add an email domain.
C:\WorkSpace\Tool\james-server-app-3.2.0-app\james-server-app-3.2.0\bin>james-cli.bat adddomain test.com
/bin$sudo ./james-cli.sh adddomain test.com
- Run james-cli again to add email user. Run the below command twice to add two email users [email protected] and [email protected]
bin>james-cli.bat adduser [email protected] admin
/bin$sudo ./james-cli.sh adduser [email protected] admin
4. Use Thunderbird To Connect Apache James Mail Server On Localhost.
Now download and install Thunderbird which is an email client tool to test our Apache James server installation. We just demo how to use it in Windows.
- Download and install Thunderbird client.
- Edit hosts file in Windows ( Please refer to the article How To Edit Hosts File In Windows 10 ) to add below IP domain mappings. Then Thunderbird will know that both domain smtp.test.com and pop3.test.com will be resolved to IP address 127.0.0.1.
127.0.0.1 test.com 127.0.0.1 smtp.test.com 127.0.0.1 pop3.test.com
- Start Thunderbird for the first time, then click Email in Accounts —> Set up an account section.
- Input Your name: admin, Email address: [email protected], Password: admin, in the popup dialog.
- Click the Continue button, then click the Manual Config button to open the below dialog. By default, Thunderbird will search for the email domain in it’s online database automatically, but their database only contains worldwide popular and real email domains and our domain does not exist in their database, so we should config the SMTP and POP3 server data manually.
- For the Incoming settings select POP3 and the server hostname should be test.com ( the email domain we added before ) and the default port number is 110, select None for SSL and Normal password for Authentication drop-down list.
- For the Outgoing row, the server hostname is also test.com, the default port number is 25, select None for SSL and Normal password for Authentication.
- Input both incoming and outgoing user name with [email protected].
- Click the Re-test button to check whether the configuration is correct or not.
- Click the Done button in the above picture then it goes to the domain not use encryption security warning dialog, check the I understand the risks. checkbox and click the Done button to finish the settings.
- Add another email user info in Thunderbird like above.
- Now you can select one email user account on the Thunderbird left inbox list panel and click the Write button to create a message in Thunderbird and send the message from [email protected] to [email protected] to verify the Apache James server installation. Select an email user and click the Get Messages button to receive emails sent to him.