Mail server:
The mail server provides the basic structure of the mail system, including mail transmission, mail distribution, mail storage and other functions to ensure that the mail can be sent to any place on the Internet.
mail servers are like post offices in our lives, providing mail services to people. To ensure that messages are transmitted and received correctly, uniform rule support is required, which is the Mail protocol.
e-mail protocol mainly includes: Smtp,pop3,imap and so on.
(1) SMTP: The full name is Simple Mail Transfer protocol is simply the message Transfer Protocol. SMTP is the protocol used to send e-mail messages. For example, we usually use
Outlook,outlook Express to send mail, it is to use it to send the local mail to the registered mailbox on the server (163. Google.hotmail, etc.)
The mail server then sends the message out. SMTP ensures that messages can be transferred efficiently between the client and the mail server
(2) POP3: The full name is Post Office Protocol 3, which is the third version of the Post Office Protocol. POP3 is a standard protocol for receiving mail servers, similar to real life
We went to the post office to fetch the parcel. POP3 allows users to store messages on the local computer from the server, while deleting or saving messages on the mail server based on the user's actions. ‘
(3) IMAP: The full name is Internet Message Access Protocol, which is the Internet messaging protocol. IMAP is an application-layer protocol that is used from a local client
Access to messages on the remote server is an alternative to the POP3 protocol.
These three protocols are transmitted in clear text at the time of transmission and can be encrypted via SSL (secure Sockets layer Secure Sockets Layer) for increased security. So
Each of the three Protocols has SSL encryption Transfer Protocol is smtps,pop3s,imaps.
Build the James Mail server
James is an open source project for Apache, pure Java implementation. Apache James Server as an enterprise-class mail server, for Smtp,pop3,imap and other mail protocols
Provide complete support. We can use it to build our own mail server.
Now we're going to set up the James Mail server quickly.
(1) First we will download the Apache-james-2.3.2.zip decompression
There are two important files Run.bat and run.sh in the bin directory of James, running Run.bat can start the James Mail server, before starting to ensure that the JDK environment
And Java_home have been configured well. When James starts, the SMTP service starts at port 25 by default. POP3 service is started by default on port 110, NNTP (Network News Transferprotocol
Network News Transfer Protocol) service is started by default on port 119.
In the Apps\james\sar-inf directory of James, there is a. config file, which is the James core profile. Note that the initial boot will not have this file, only if the James service starts once
This file will be automatically built later. In the default configuration, the domain name of the mail server is localhost. We can modify the metabase. config file to modify it to a custom name. Open CONFIG. edit File modification
<ServernamesAutoDetect= "true"Autodetectip= "true"><Servernames>localhost</Servernames></Servernames><!--after modification -<ServernamesAutoDetect= "true"Autodetectip= "true"><Servernames>mail.com</Servernames></Servernames>
Create user accounts (use Telnet to add users)
Use Telnet to connect James ' remote Administration Tool. Open a console window, enter telnet localhost 4555 and press the ENTER key
Note: The Win7,telnet service is turned off by default and can be set through the Control Panel----------> Uninstall or change Programs----------> Turn Windows features on or off
Landing
The system default administrator user name is root password also for root input after display welcome indicates successful login
Add user
Syntax: adduser[username] [password]
View Current User
Syntax: Listusers can query which users are currently available.
Simple service, we've built a success.
Use spring to send an email!!!!