Apache James is a popular open source mail server. It support both SMTP, POP3 and IMAP protocol. This article will tell you how to install Apache James both on Windows and Linux, how to create user account on it and how to use 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 latest Apache James version from 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 run 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 start both SMTP and POP3 mail server, SMTP is used to send email out while POP3 is used to receive income email.
- The default SMTP server port number is 25, and default POP3 server port number is 110.
- But you can change the default SMTP and POP3 port number by edit conf/smtpserver.xml and conf/pop3server.xml file. The conf folder is located in Apache James root folder. For example C:\WorkSpace\Tool\james-server-app-3.2.0-app\james-server-app-3.2.0\conf.
- Open smtpserver.xml file in a file editor and edit below code to change the default smtp port number.
<smtpservers> <smtpserver enabled="true"> <jmxName>smtpserver</jmxName> <bind>0.0.0.0:25</bind>
- Open pop3server.xml file and edit below code to change default pop3 port number.
<pop3servers> <pop3server enabled="true"> <jmxName>pop3server</jmxName> <bind>0.0.0.0:110</bind>
- Now restart 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 local directory.
- Unzip the zip file to a local folder. You can use command like
$ unzip ./james-server-app-3.2.0-app.zipor use GUI tool.
- Also make sure you have JDK 8 installed in your Ubuntu.
- Make sure 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 one how to change SMTP, POP3 server port number in Windows.
3. Add Email Domain And User In Apache James.
Now we have installed and started Apache James mail server on both Windows and Linux, we need to add email domain and email user account in it to make test.
- Open dos window in Windows or open a terminal in Ubuntu Linux.
- Then goto Apache James bin folder and run james-cli command in 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 below command twice to add two email user [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, add below ip domain mappings. Then Thunderbird will know that both domain smtp.test.com and pop3.test.com will be resolved to ip 127.0.0.1. Please refer article How To Edit Hosts File In Windows 10.
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 Continue button, then click Manual Config button to open below dialog. By default Thunderbird will search for the email domain in it’s online database automatically, but their database only contains world wide popular and real email domain and our domain do not exist in their database, so we should config the SMTP and POP3 server data manually.
- For 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 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 Re-test button to check whether the configuration is correct or not.
- Click Done button in above picture then it goes to domain not use encryption security warning dialog, check the checkbox and click Done button to finish the settings.
- Add another email user info in Thunderbird like above.
- Now you can select one email user and click 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 Get Messages button to receive emails sent to him.