James Build mail server

Source: Internet
Author: User
Tags nntp email account mail account

Source: http://chenfengcn.iteye.com/blog/356874

1 about James and JavaMail
Apache James (Java Apache Mail Enterprise Server) is one of the Apache organization's sub-projects, completely using pure Java technology development, the implementation of SMTP, POP3 and NNTP and other mail-related protocols. James is a mail application platform that can expand its capabilities through Mailet, such as Mail2sms, Mail2fax, and more. James provides a more complete configuration, especially for the message content store and the user Information Store section, which you can choose to save in a file, database, or other media. James has an increasingly wide range of applications in the project because of its stable performance, highly configurable, open source projects, and no copyright issues with all source code.
The Javamail API is an optional package (standard extension) for reading, writing, and sending electronic messages that can be used to establish standards-based e-mail clients that support a variety of Internet mail protocols, including SMTP, POP, IMAP, MIME, NNTP, S/MIME, and other protocols.
In this document, we use James 2.3.1+javamail 1.4.1 as the introductory blueprint.

2 James Server Quick Start
We can download from Apache James ' official site to the James Server and source code we need.
James Server (Zip version):
Http://apache.mirror.phpchina.com/james/server/binaries/james-binary-2.3.1.zip
James Source:
Http://apache.mirror.phpchina.com/james/server/source/james-2.3.1-src.zip
Other versions of the server and source code can be downloaded to the official download page:
http://james.apache.org/download.cgi

2.1 Start James
The first step:
Unzip the james-binary-2.3.1.zip into a plain English directory
Step Two:
Run the Run.bat in the bin directory (make sure your Java environment variable is configured successfully before running, or you will be prompted to run the failure)
The following display indicates that the James server has started successfully:


After the server starts successfully, the corresponding James release package is automatically generated in the apps directory according to the James.sar file, and the configuration file, config files we discuss later, is present in this release package.

2.2 Managing users with Telnet
Enter MS-dos with cmd, input telnet localhost 4555 (note: localhost is the mail server name, 4555 is the management port and can be \apps\james\sar-inf\ Config in the metabase file, where we use its default configuration)
Then enter the user name and password (in config file, the default is user name: root password: root)
The following information appears to indicate the success of the login:


After the successful landing, we can start the user information to increase, delete, check, change and other operations.
Common user Information Operations commands are described in the following table:
  • Currently implemented commands: Common implementation commands
  • Help display the This helps displays assistance information
  • Listusers display existing accounts show existing accounts
  • Countusers display the number of existing accounts show existing accounts
  • AddUser [username] [Password] Add a new user
  • Verify [Username] Verify if specified user exist verify the presence of specified users
  • Deluser [Username] Delete existing user Delete existing users
  • SetPassword [username] [password] Sets a user ' s password set the password
  • Setalias [user] [alias] locally forwards all email the ' user ' to ' Alias ' setting the mailbox Alias
  • Showalias [Username] shows a user ' s current email alias display alias
  • Unsetalias [user] unsets an alias for ' users ' remove alias
  • setforwarding [username] [EmailAddress] forwards a user's email to another email address forwarding user's email to another email address
  • showforwarding [Username] shows a user's current email forwarding show users ' forwarding
  • unsetforwarding [Username] Removes a forward delete forward
  • User [Repositoryname] change to another user repository changing another users library
  • Shutdown kills the current JVM (convenient if James is run as a daemon) shuts down service
  • Quit close Connection close connection

We can enter the command: AddUser chenfengcn 881213来 Add a mail user, the user name is: CHENFENGCN, the password is: 881213, the email address is: [Email protected] ( The domain name after the user name is the same as the domain name of the server configuration, which is configured in the CONFIG. e file and we will discuss how to configure the mail server domain name later in this section. In this way, we have completed a Simple mail server build operation. Let's use Foxmail to test if our email account is actually available.

2.3 Test your mailbox account with Foxmail
Open Foxmail, click "Mailbox"-> "New mailbox Account"
Email address: [Email protected]
Password is: 881213
POP3 server: localhost
SMTP server: localhost
The rest of the options are used by default, and after the new completion, Foxmail will send a test email to our new email address, click "Collect" to receive the email from our email account. When you receive a test message sent by Foxmail, it means that our mail account is working properly.

James Build mail server

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.