Comments
Richard Davies wrote: The UK has a good crop of technology pioneers in cloud computing - for example ElasticHosts, FlexiScale, Flexiant, OnApp - and also some strong government initiatives such as G-Cloud. We will have to see whether this kind of technical leadership converts into swift mass-market adoption or not.
Cloud Expo on Google News


2008 West
DIAMOND SPONSOR:
Data Direct
SOA, WOA and Cloud Computing: The New Frontier for Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
GOLD SPONSORS:
Appsense
User Environment Management – The Third Layer of the Desktop
Cordys
Cloud Computing for Business Agility
EMC
CMIS: A Multi-Vendor Proposal for a Service-Based Content Management Interoperability Standard
Freedom OSS
Practical SOA” Max Yankelevich
Intel
Architecting an Enterprise Service Router (ESR) – A Cost-Effective Way to Scale SOA Across the Enterprise
Sensedia
Return on Assests: Bringing Visibility to your SOA Strategy
Symantec
Managing Hybrid Endpoint Environments
VMWare
Game-Changing Technology for Enterprise Clouds and Applications
Click For 2008 West
Event Webcasts

2008 West
PLATINUM SPONSORS:
Appcelerator
Get ‘Rich’ Quick: Rapid Prototyping for RIA with ZERO Server Code
Keynote Systems
Designing for and Managing Performance in the New Frontier of Rich Internet Applications
GOLD SPONSORS:
ICEsoft
How Can AJAX Improve Homeland Security?
Isomorphic
Beyond Widgets: What a RIA Platform Should Offer
Oracle
REAs: Rich Enterprise Applications
Click For 2008 Event Webcasts
SYS-CON.TV
Top Links You Must Click On


Apache James
A customizable e-mail server solution

In today's society, it's second nature to contact family, friends, and colleagues via e-mail. E-mail has become so integral to our daily ritual that we cannot stay away from it as we make use of personal digital assistants (PDAs) and other pervasive devices to have it readily available. How do these billions of digital messages get to users across the globe?

A client/server setup is required to participate in the exchange of e-mails. It was just a few years ago that expensive server software packages were used for the typical e-mail solution. Cheaper solutions have been plagued by a lack of robustness and scalability. To the avail of shrinking corporate budgets comes the Java Apache Mail Enterprise Server (known as Apache James).

Apache James is a free, open source, robust offering from the Apache Software Foundation that aims to provide enterprises with a Java-based mail server solution. James provides a Java API for developers to process e-mail services. In this article, we'll explore James and what it can offer your enterprise operation.

Understanding E-Mail
In the world of e-mail, the senders and recipients of messages act as clients to e-mail servers. Senders create an e-mail using a Mail User Agent (MUA) and transmit the message to an e-mail server using the Simple Mail Transfer Protocol (SMTP). The e-mail server uses the same protocol to contact the recipient's e-mail server. Recipients then use the Post Office Protocol (POP3) or alternatively the Internet Message Access Protocol (IMAP) to retrieve the message from their e-mail server. Note: IMAP support is currently experimental in James 2.1.3.

SMTP
As mentioned, e-mail servers use SMTP to transmit messages across the world. The default TCP port for this protocol is 25. Accordingly, network administrators need to configure firewalls for access to the SMTP port.

POP3
POP3 is used to retrieve messages from the e-mail server. The default TCP port for this protocol is 110. Clients must provide security information used for authentication with the e-mail server. Upon successful authentication, clients can access their messages from their respective mailboxes.

Getting Hold of James
The software is available for download from the Apache James homepage at http://james.apache.org/. James was in version 2.1.3 at the time of this writing; this version requires Java 2 (Java Runtime Environment version 1.3 or 1.4 as of 2.0a3).

Firing Up James
Before you begin, ensure that the system environment variable, JAVA_HOME, points to the JRE 1.3+ home directory. To fire up James, simply navigate to the bin directory created upon extracting the contents of the downloaded archive file. In this directory, locate and execute the "run.bat" script. Upon running the script, a confirmation will be displayed that James is listening on ports 25 (SMTP) and 110 (POP3) (see Figure 1).

 

The configuration files are unpacked the first time James runs. At this point stop the server, make the necessary configuration changes, and restart the server for the modifications to take effect. A needed modification is in the config.xml file located in the <james-installdir>\apps\james\ SAR-INF directory.

<servernames autodetect="true" autodetectIP="true">
<!-- CONFIRM? -->
<servername>localhost</servername>
</servernames>

Add the Domain Name Service (DNS) namespace you want served by James. For example, to have James provide e-mail services for somedomain.com, the configuration would look like the following:

<servernames autodetect="true" autodetectIP="true">
<!-- CONFIRM? -->
<servername>localhost</servername>
<servername>somedomain.com</servername>
</servernames>

Note: The assumption is that the necessary upstream configurations are in place for the DNS and Mail Exchanger (MX) records.

Administering James
Remote administration to the James server is available through Telnet. The "Remote Manager Service" listens on port 4555 by default. Access this service using the following command:

telnet localhost 4555

Replace "localhost" in the above code with the appropriate host name or IP address. The default login/password for the Remote Manager Service is root/root. To alter this information, edit the config.xml file located in the <james-installdir>\apps\ james\SAR-INF directory. Look for the following section:

<administrator_accounts>
<!-- CHECKME! -->
<!-- Change the default login/password. -->
<account login="root" password="root"/>
</administrator_accounts>

The Remote Manager Service provides the user with an easily accessible help facility through the command HELP.

Now, begin administration of the e-mail server by adding user mailboxes. This is accomplished by issuing the following command:

adduser [username] [password]

For this exercise, we added two users, kulvir and kwang, with the same password of security.

adduser kulvir security
adduser kwang security

As shown in Figure 2, James will not echo the process of you creating the user.

 

Sending and Receiving Some Mail
At this point, e-mail clients such as Lotus Notes and Microsoft Outlook should be able send and receive messages from the e-mail accounts just created. Consult your product documentation regarding proper account configuration for your client of choice.

The Mailet API
Similar to Java servlets running on an application server, the Apache Software Foundation allows James to act as a container that can run mailets that extend the capabilities of the mail server. Mailets are Java applications, developed using the mailet API, that perform various mail-processing tasks including auto-response engines, spam filters, and e-mail indexing. The mailet API, along with sample mailets, is bundled with the James distribution.

For our exercise, we will enable "AddFooter", a prepackaged mailet. First, modify the "config.xml" file by adding the code in Listing 1. Let's discuss two important attributes of the mailet tag. The class attribute refers to the mailet's Java class. The match attribute refers to the matcher, a Java class that implements the Matcher API. Matchers return a collection of recipients that satisfy the defined conditions. There are a number of matchers prebundled with the James distribution. The "All" matcher returns all recipients for all messages processed by a mailet.

James registers mailets during initial startup. Restart the server to enable the newly defined mailet. Send an e-mail to one of your registered accounts. The recipient should see the specified footer text added to the end of a message sent to him or her (see Figure 3).

 

Extensibility
The power of James lies in its ability to extend its capabilities through custom mailets and matchers. Using the APIs provided by the Apache Software Foundation, you can create your own setups to process mail, satisfying virtually any business requirement required of a mail server. The James Web site has a good amount of documentation about how to go about creating your own mailets and matchers.

Mailing Lists
James also supports mailing lists that allow individuals to subscribe/unsubscribe to topics. It's simple to configure and use. For more information regarding the James mailing list feature, view the James FAQ documentation.

Contributing to James
Like other Apache open source projects, James relies on the programming community to contribute code enhancements to yield a more powerful and stable application. It's this collaborative effort that has led to what we see in James today. You can learn more about contributing to James at http://james.apache.org/contribute.html.

Conclusion
As this article illustrated, James is simple to configure and run. Coupled with the power to design customer matchers and mailets, it represents a highly user-friendly, extensible e-mail server solution, customizable to fit your enterprise needs.

About Kulvir Singh Bhogal
Kulvir Singh Bhogal works as an IBM Software Services for WebSphere consultant, devising and implementing WebSphere-centric solutions at customer sites across the nation. He has over fifty patents pending in a myriad of technology areas. He can be reached at kbhogal@us.ibm.com

About Kwang Kang


In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1

HI Sir,
I am suneel and i am using james server james-MailetSDK-2.2.1-RC1.zip product
and i am unable to fetch out the attachment from the james server by using java mail API. It is showing the error NoSuchProviderException . please send me the solution for this.
Thank you very much

Hi Sir,


Your Feedback
suneel wrote: HI Sir, I am suneel and i am using james server james-MailetSDK-2.2.1-RC1.zip product and i am unable to fetch out the attachment from the james server by using java mail API. It is showing the error NoSuchProviderException . please send me the solution for this. Thank you very much
suneel wrote: Hi Sir,
Enterprise Open Source Magazine Latest Stories . . .
Apache Deltacloud, the Red Hat-contributed ReSTful API that abstracts differences between clouds so services on any cloud can be managed – provided of course there’s a driver – has graduated from the Apache Foundation’s incubator and is now a full-fledged Top-Level Project (TLP). The...
With Cloud Expo 2012 New York (10th Cloud Expo) just four months away, what better time to start introducing you in greater detail to the distinguished individuals in our incredible Speaker Faculty for the technical and strategy sessions at the conference... We have technical and st...
AMD said late Tuesday that its chief sales officer Emilio Ghilardi had left the company and that CEO and president Rory Read is going to do his job while a replacement is sought. AMD didn’t say why Ghilardi left but it’s assumed Read wants his own people. Read is relatively new to th...
During the lifespan of M3 (Monitis Monitor Manager) there has always been something lacking – timers. M3 execution procedure was outlined in this previous article. The execution mentioned in the latter was a one-time-execution, whereas server monitoring requires periodic invocati...
Red Hat is putting its bought-in Gluster scale-out NAS storage technology, acquired in October, on the Amazon cloud. It’s styled Red Hat Virtual Storage Appliance for Amazon Web Services and other clouds are supposed to follow in short order.
A new episode of the screencast series is now available at the OpenNebula YouTube Channel. This screencast demonstrates the new easily-customizable self-service portal for cloud consumers. Its aim is to offer a simplified access to shared infrastructure for non-IT end users. The scree...
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021


SYS-CON Featured Whitepapers
ADS BY GOOGLE