How To Connect Localhost Apache James With Thunderbird

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.

  1. 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.
  2. Unzip the download file to a local folder.
  3. 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.
  4. Before run Apache James mail server, make sure you have jdk 8 installed.
  5. Execute run.bat in the dos window then Apache James server started.

1.2 Change SMTP And POP3 Port Number.

  1. 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.
  2. The default SMTP server port number is 25, and default POP3 server port number is 110.
  3. 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.
  4. 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>
  5. 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>
  6. 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.

  1. Download Apache James 3.2.0 zip file ( james-server-app-3.2.0-app.zip ) to local directory.
  2. Unzip the zip file to a local folder. You can use command like $ unzip ./james-server-app-3.2.0-app.zip or use GUI tool.
  3. Also make sure you have JDK 8 installed in your Ubuntu.
  4. 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.
  5. Now cd into the bin folder under James root folder ( /home/jerry/tool/james-server-app-3.2.0/bin ), run $ sudo ./run.sh to start Apache James mail server.
READ :   Java.util.ConcurrentModificationException Examples And Resolution

2.2 Change SMTP And POP3 Port Number.

  1. 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.

  1. Open dos window in Windows or open a terminal in Ubuntu Linux.
  2. Then goto Apache James bin folder and run james-cli command in bin folder to add an email domain.
    Windows:

    C:\WorkSpace\Tool\james-server-app-3.2.0-app\james-server-app-3.2.0\bin>james-cli.bat adddomain test.com

    Linux:

    /bin$sudo ./james-cli.sh adddomain test.com
  3. Run james-cli again to add email user. Run below command twice to add two email user [email protected] and [email protected]
    Windows:

    bin>james-cli.bat adduser [email protected] admin

    Linux:

    /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.

  1. Download and install Thunderbird client.
  2. 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

    add smtp and pop3 mail server domain ip mappings in hosts file

  3. Start Thunderbird for the first time, then click Email in Accounts —> Set up an account section.
  4. Input Your name : admin, Email address : [email protected], Password : admin, in the popup dialog.
  5. 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.
  6. 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.
  7. 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.
  8. Input both incoming and outgoing user name with [email protected].
  9. Click Re-test button to check whether the configuration is correct or not.
    configure smtp and pop3 mail server manually in thunderbird
  10. 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. thunderbird add email account domain not use encryption warning dialog
  11. Add another email user info in Thunderbird like above.
  12. 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.
    use thunderbird to send receieve email between two apache james email user
(Visited 214 times, 1 visits today)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.