System specifications
First, system functions and objectives:
With the continuous spread of the Internet, the number of users in China has grown in an exponential level. As the most common email system, the most commonly used email system is more and more love, in order to meet the needs of growing information exchange, all walks of life want to have their own mail systems. Guangdong Communication Network Information Co., Ltd. has developed a free email system for China's national conditions to solve this increasingly prominent issue. The Free Email System is an email system designed for free email service providers and corporate groups.
The design goal of the CHINATION email system is based on a highly integrated, powerful, technologically advanced email system. High integration means that this system will integrate the hard disk software. The system is based on Linux, hard disk and software integration, makes the system have absolute installation advantages. Powerful means means the utility of the system, the functionality of the function, the security and reliability of the system. Advanced technology means combining the latest version of LDAP, IMAP, Postfix, MySQL, Apache, and PHP.
The main functions to be implemented in this system are:
1. User application registration function. The user can obtain a mailbox named by the application, with a capacity size of 10m.
2. Users forget the password processing function. The user forgets the password to reset the password by registering the password prompt problem.
3. User collects the mail function. It includes three ways of SMTP receiving mail, POP3 taking emails and WWW read mail.
4. User email function. It includes SMTP email, WWW sends mail, dark email, copy mail, and time to send mail.
5. User letter processing function. The system initially sets 4 folders to classify and process letters: inbox, outbox, draft box and trash. Users can also create new folders themselves. Letters can move between each mailbox.
6. User lookup function. Users can use the lookup feature to find the letters you need by looking for letters topics or letters.
7. User mailbox configuration settings. It includes personal data changes, password changes, parameter settings, POP3 server settings, filter settings, automatic transfer, timing, signature settings.
8. Administrators manage users and mailbox mail features. Includes input (addiction modification), query, statistics, and reports. System performance parameter settings.
9. Broadcast function. It is used to send information to certain users regularly, since there is a certain number of ordinary users, so the database tube must be used.
Second, feasibility analysis
1. Technical feasibility
This software intends to decide to eventually run on a distributed system. In terms of hardware, due to Guangdong Communication Network Information Co., Ltd. is an agent of many foreign companies in parallel processing products, and itself has advanced equipment such as Alpha machines, so there is enough capacity to develop advanced email systems. In terms of software, we intend to adopt the following software:
1) The operating system uses Linux. As an excellent network operating system, Linux integrates a large number of web applications, such as web server (Apache), FTP Server (WU-FTP), Mail Server (Sendmail IMAP4), SQL Database (PostgreSQL) Wait, you can quickly build an intranet environment, and also have a fine mail transceiver (Metamail) and a powerful web server-side development tool (PHP4). When you configure Sendmail and activate iMapd, your Linux users can use client software such as Outlook to make mail to send and receive, as long as they focus on them, you can implement a simple WebMail server function. However, with the continuous development of free software, it is necessary to archite a good email system, which is facing whether the software choice is appropriate, whether the performance is better than others. The software we use is listed below.
2) The inner casing software in this system uses IMAP. There are several ways to construct an inner casing of an email system: a policy of sharing file system, based on a private protocol, X.400P7 protocol, and Internet messaging protocol. The Internet-based protocol mainly include: POP (Post Office Protocol), DMSP (Distributed Mail System Protocol), and IMAP (Internet Message Access Protocol). Pop is the most original and most known. DMSP is limited to a simple application - pcmail, which is mainly supported by offline status operation. IMAP not only inherits the advantages of POP and DMSP, but also exceeds their shortcomings, providing access to remote mailboxes in three states: online, not connected, and offline. In the offline state, the message can be sent to a shared server, but the mail customer is not immediately deleted them on the server immediately, but is in a customer-server interaction mode, customers can ask the server The relevant header, body or some status flags (such as "Delete", "Answer", etc.). IMAP can operate remote mailboxes in a local manner. The advantages of IMAP are mainly: it can operate on a continuous message status flag; it can access messages and access them at any time; it can access and manage multiple mailboxes; it supports concurrency access and modification of the shared mail; suitable access non-email Data, such as network magazines and materials; it can use offline paradigms with shortest connection time and minimum space; it uses to manage user-configured accompanying protocols; it allows online performance optimization, especially at low speed connections.
3) Use OpenLDAP as directory server software. LDAP (LightWeight Directory Acess Protocol) is an implementation of directory services on TCP / IP (RFC 1777 V2 and RFC 2251 V3). It is a transplantation of the X500 directory protocol, but simplifies the implementation method, so it is called a lightweight directory service. In the LDAP, the directory is composed of the tree structure organization, the directory is composed of entry (entry), the entry is equivalent to the record of the table in the relational database; the entry is the attribute (attribute) collection of DNTINGUISHED NAME, DN is equivalent to the relationship Primary Key in the database table; the property consists of type (type) and multiple values (VALUES), which is equivalent to the domain (field) in the relational database consists of domain name and data type, just to facilitate retrieval, The Type in the LDAP can have multiple values instead of all domains implemented in the relational database to reduce the redundancy requirements of data. The organizations in the LDAP are generally organized in accordance with geographic and organizational relationships. LDAP stores the data in the file and uses an index-based file database to improve efficiency, not a relational database. The LDAP protocol set also specifies the DN naming method, access control method, search format, replication method, URL format, development interface, etc. Linux supported LDAP servers typically have free software packages developed by Michigan and OpenLDAP organizations based on the OpenLDAP free software issuing package provided by Michigan University's development kit, where OpenLDAP issued package installation is simpler.
4) The web server is used by Apache PHP4 MySQL. The benefits of free software open the original code will not say more.
5) Piece system software with postfix. Since email is a very traditional tool, there are very many software that can be used to achieve this, including from an old UUCP mail to a very large business group system, such as Lotus Domino Server, but the most widely used It is still a free software - ExeMail, which supports the main body of the current Internet mail system. Regardless of the extensive extension from the use, Sendmail is a very good software. If you use it to build an email system of the website, it is basically uncomfortable because almost all UNIX default configurations built into this software, just set up the operating system, it can run immediately. However, the requirements of Internet users are more demanding, and they are pointed out in Sendmail. The first important disadvantage is that its security is because when the author Eric Allman starts writing this software, the Internet users are still very small, so security does not have to pay attention to everyone. In addition, due to its early Internet users, the number of emails is quite small, the system structure of Sendmail is not suitable for large loads, and for high-load mail systems, SENDMAIL needs to be complex adjustments. Another problem is that its setting is quite complicated, and the problem does not exist for the use of default settings. When the administrator intends to make some special settings in order to use the complex email processing capabilities provided by Sendmail, they have to face complex macros and regular expressions. Postfix also uses a modular way, but unlike qmail, Postfix uses a master process to monitor. Postfix takes the safety issue in many ways, which does not even distribute emails to root to avoid reading and writing files or launching an external program as root. Some powerful features provided by Postfix are mainly in a variety of database table query methods, such as the query of DB, DBM, Passwd files, regular expressions, mysql databases, and LDAP methods for supporting system-level alias, virtual hosts, etc.. Although these features can also be supported in QMail, it is not uniform, concise like Postfix. In addition, after changing the POSTFIX settings, you don't need to restart the entire system, you only need to use Postfix Reload to fully refresh the configuration, which also avoids the possibility of losing mail. 6) The operation mechanism of Zend Optimizer is to speed up the running speed of the program by optimizing them in the process of checking the code generated by the Zend Dynamic Compiler. The work of Zend Optimizer in the Zend Engine in PHP4 is the middle of the Zend dynamic compilation process and the running process. The Zend Dynamic Compiler generates code in PHP4 is equivalent to 2-10 times the PHP3 generating code speed. If a system is used in a system, it will be 40% -60% fast in the execution of Zend Optimizer.
The combination of the above software is absolutely guaranteed to the safety, stability, reliability and scalability of the entire system.
2. Canvasibility
With Linux, there is more and more free software types, and performance is getting better and better. The development of this system is proposed to adopt free software, which not only guarantees the technical feasibility of the system, but also guarantees the economic feasibility of the system. Free software greatly reduces development costs and reduces product costs.
On the other hand, after productivity of this system, it will cause frequent revenue of hardware software integration.
3. Social feasibility
The social feasibility of this system is mainly reflected in the following aspects:
l The use of free software has enabled entanglement of legal issues such as copyright, patent rights in software.
l This system software hardware integration solves the problem of current free software installation configuration and meets the needs of users.
l Because the decrease in development costs makes product prices to occupy an absolute advantage in the market. Demand Specification 1, Task Overview
Demand analysis work is an important step in the software survival and a decisive step. We tried to fully understand the software features and performance requirements of the entire system, and lay a solid foundation for software design. The object is mainly: obtaining the physical model of the current system, understand how the current system is running; abstract the logical model of the current system, filtering the physical model, get the part of the software system; establish the logic of the E-mail system Model, draw data flow graphs and data dictionaries; replenish the logical model of the target system, the user interface of the target system, has not been described so far.
Second, data description
1. Database description
The system is attributable to the end of the database, and the performance requirements of the database are particularly high. The average of each operation is to access the database C1, each accessing the database To retrieve the data record CN strip (n is the number of users, C, C1 is the access coefficient). Therefore, the frequency of database access is C1 * C * n * m (m represents an average of online users per second). There are more properties in the database, and some tables of data will be used to retrieve user mailboxes, so they require database access capabilities. The database's database is Linux's mysql.mysql is a small Qi Qi Dumer Software software, which is ideal for application systems. In addition to supporting standard ANSI SQL statements, it also supports a variety of platforms, and the software supports multi-threaded operations on the UNIX system to achieve considerable performance. For users who don't use UNIX, it can run in a system service in the Windows NT system, or run in a normal process on the Windows 95/98 system. The combination of PHP-MySQL can be run across platforms, which means that Developed on Windows and then run on the UNIX platform.
2. Data flow map
The operating process of this system is primarily interacting between users and systems. The user is divided into new users and registered users, because the new user's registration and the registered user's processes are relatively independent, so the data flow diagram of the entire system is divided into two parts. The first level flow chart of the system is as follows:
new user
registered
Registered users
Registered information
User Info
Registered users
Forgot password processing
Registered users
log in
Browse the home page
Reading an email
send email
Look up
Configure
Mail processing
Listed by users
Change the back mailbox
Original mailbox
login information
Original registration information
login information
New registration information
Original mailbox
Original mailbox
Look for content
Original mailbox
Change the back mailbox
Change the back mailbox
Change the back mailbox
Find results
System Management
After changing the system
Original system
3. Data flow entries:
1) Data List: User Information
Alias:
Compose: User Name Name Password Password Tips Question Page Machine Fax Machine Mobile Number Gender Birth Date Marriage Supreme Education Occupation Your Company Name Company Size Work Status Company Home I want to join group
Source: User Enter
Go to: Registered subsystem
2) Data Live Name: Registered Information
Alias: Original registration information
Compose: User Name Name Password Password Tips Question Page Machine Fax Machine Mobile Number Gender Birth Date Marriage Supreme Education Occupation Your Company Name Company Size Work Status Company Home I want to join group
Source: Registered subsystem
Go to: User Registry for Database
3) Data Live Name: Login Information Composition: User Name Login Password
Source: User Enter
Go to: System to retrieve user information
4) Data Live Name: Original Mailbox
Alias: Change the mailbox, user mailbox
Compose: Username Inbox Outbox Darbage Box Draft Box Custom Folder Mailbox Configuration
Source: IMAP core
Go to: Each sub-processing module
4. Processing description:
1) Processing Name: Register
Enter data: user information
Output data: Registered information
Processing logic: According to user information entered by the user, make a corresponding record in the database and new mailboxes to the user.
2) Processing Name: Forgot Password
Enter data: original registration information
Output data: new registration information
Processing logic: User Enter the answer to the registered username and password prompt problem, the system is verified to let the user change the password, the system stores the new password.
3) Processing name: email processing
Enter data: original user mailbox
Output data: Changed mailbox
Processing logic: Mail processing subsystem increases, delete folder operations, letters, delete operations, delete folder operations, letters, delete operations in accordance with the user's request
4) Processing Name: Reading Mail
Enter data: original user mailbox
Output data: Changed mailbox
Processing logic: Users read emails in the original mail, and can reply, delete, store address, and rejection.
5) Processing Name: Login
Enter data: User Enter login information
Output data: Enter the home page
Processing logic: Compare the login information and database input by the user, if it is a registered user, call the mailbox home page, otherwise give the corresponding prompt according to the error.
6) Processing Name: Browse Mailbox Home
Enter data: login module
Output data: various submodules in the mailbox
Processing Logic: Repeates the user's mailbox according to the login information, and statistics and displays in a certain format.
7) Processing name: email
Enter data: original user mailbox
Output data: Change the mailbox
Processing logic: Operation, email, save letters, secret delivery, copy, etc. according to user requirements
8) Processing Name: Find
Enter data: lookup content
Output data: Find results
Processing Logic: Find all the required letters in the topic of the lookup content or letters according to the topic of the lookup.
9) Processing Name: Configuration
Enter data: original user mailbox
Output data: Changed user mailbox
Processing logic: modify the user's mailbox configuration based on the user's request.
Third, functional requirements:
1. Functional division
Mailbox application function
Forgot password processing
Mailbox management function
System management function
Folder management function
Read letters function
Email system
Letter transceiver function
Address this, configuration function
2. Function Description 1. User application registration function. The user can obtain a mailbox named by the application, with a capacity size of 10m. 2. Users forget the password processing function. The user forgets the password to reset the password by registering the password prompt problem. 3. User collects the mail function. It includes three ways of SMTP receiving mail, POP3 taking emails and WWW read mail. 4. User email function. It includes SMTP email, WWW sends mail, dark email, copy mail, and time to send mail. 5. Household letters handle. The system initially sets 4 folders to classify and process letters: inbox, outbox, draft box and trash. Users can also create new folders themselves. Letters can move between each mailbox. 6. User lookup function. Users can use the lookup feature to find the letters you need by looking for letters topics or letters. 7. User mailbox configuration settings. It includes personal data changes, password changes, parameter settings, POP3 server settings, filter settings, automatic transfer, timing, signature settings. 8. Administrators manage users and mailbox mail features. Includes input (addiction modification), query, statistics, and reports. System performance parameter settings. 9. Broadcast function. It is used to send information to certain users regularly, since there is a certain number of ordinary users, so the database tube must be used. Fourth, running demand 1. User Interface Free Email System is a high-oriented application system, which is high for human-machine interface. The webpage format must populate, strive and general mail systems (such as 163, 21cn, etc.) are generally constant, so that users can master the operation of the system immediately. Of course, you can have your own characteristics. The format requirements of the report are consistent with the general report format, and their printing is printed in the browser. The system's user registration and login and sending mail, etc., it is necessary to make full use of the Enter key, which makes it easy to make users, other operations use triggering. 2. Hardware Interface This system can also use distributed processing, so the parallel connection of multiple servers is required. 3. Software interface This system is listed below: Operating System: Redhat Linux 6.2 Mail User Authentication System: OpenLDAP-1.2.9-5, PAM-0.72-6 IMAP, POP3 Mailbox System: Cyrus-IMAPD-1.6 . 22, Cyrus-SASL-1.5.21 Mail Send System: Postfix-19991231-PL06 Database System: Mysql-3.22.32-1 Web Publishing System: Apache-1.3.12, PHP-4.0 V. Property Demand in Useability Aspect, requires simple functions, convenient operation, correct system processing; the entire system has a good recovery performance, fast start speed, to ensure good software availability. In terms of security confidentiality, the system needs to set the firewall. In addition, the scalability of the system is also required, maintainable, and portability. Summary Description I. Task Overview This phase of this phase is to determine design objectives based on demand specifications, as well as their priority, and determine the most suitable design methods based on the objectives, and formulate various specifications. The system is divided into the hierarchy of the module by function. Determine the function of each module, establish a correspondence with the determined software requirements. Determine the call relationship between the modules, determine the interface between the modules, that is, the message passed between the modules. Design the information structure of the interface, evaluate the quality of the module division and the rules of the export module structure. Complete the database design to avoid a lot of redundancy. Second, the overall design 1. The processing process acts as an operational prelude, and the user first has to register or forget the password processing. The system is officially entered into the mailbox from the user input username and password login. The processing flow chart is shown (Figure 2).
There are some messages that are passed in the figure, since the version and simple relationships are not directly marked. 2. Software Structure The module design of this system is under the premise of considering the specific situation, follow the principle of high-internal phenomena, and the entire system is divided into nine modules. One of the primary subsystems has a total of 3, and there are 5 in the quarter system. There are some messages that are passed in the figure, since the version and simple relationships are not directly marked. It will be given in the details of each module behind! Log in to forget the password processing display mailbox message collection folder processing registration send mail address management configuration map one module structure map (lack) Forgot password processing login browse mailbox home reading mail send mail box LDAP login information DB1 login information Original mail box log finding the original mailbox Change After the mailbox Change After the mailbox Change After the mailbox lookup result new user registration new registration information IMAP IMAP Browse Mailbox Home login Exit Figure 2 Processing flowchart 3, run design 1. The combination of running modules is shown above. The module map can be seen that only "Login" and "Show Messages" two modules can cause different modules to reflect different modules: login module Settings two connections "Application Mailbox "And" Forgot Password ", the user will enter the registration module after clicking" Application Password "; click" Forgot Password "to call the Forgot Password Processing Module. After the user enters the password and password, the login module is called the display mailbox information module as the username and password. Display Mailbox Message Module Settings Connection Call Folder Management, Send Mail, Collect Mail, Configuration, Address Management, etc. The transferred parameters are user names and passwords. 2. The operating control method uses a super connection to trigger. 4. Database design This system mainly involves three entities of users, email, and letters. The links between them are mainly the user use the mailbox, and the mailbox has a letter, and the user wants to send and receive letters. They use the E - R diagram as follows: User Letter Mail Time Send Get Saves to Contains Table Mial-User Contains Table Mial-User to include Table Mial-User, that is, user mailbox; set table User-AutoSend describes the contact of the user to the letter, that is, the user timing sends a letter; set the table user-env-var to describe the contact of the user to the mailbox, that is, the user sets the appearance of the mailbox; set the table user-EREG to describe the property of the mailbox itself Set table user-status to describe the user's own properties.
Field name and definition of each table as follows: Mail_User Field Type Null Key Default Extra ---------------------------- - ----- ----- --------- ---------------- ID INT (4) Pri 0 Auto_Increment usr varchar ( 50) MUL pwd varchar (100) YES NULL folder_count int (4) 4 folder varchar (255) rev; address_count int (2) 0 address_name text YES NULL address_nick text YES NULL address_email text YES NULL autoturn text YES NULL filteraddr text YES NULL user_autosend Field Type Null Key Default Extra ---------- ------ ------ ---- --------- ---------------- ID INT (4) Pri 0 Auto_Increment Sendtime Int (6) MUL 0 MSGTO TEXT YES NULL SUBJECT TEXT YES NULL BODY TEXT YES NULL Header Text Yes NULL USER_ENV_VAR FIELD Type Null Key Default Extra ----------- ---------- ---- ----- --- ------ ---------------- ID int (4) pri 0 auto_increment usr varchar (50) MUL MENU_BG VARCHAR (10) # 009900 Menu_fg varchar (10) #Fffffff main_bg varchar (10) #ffffff main_fg1 varchar (10) #ffffff main_fg2 varchar (10) # ff00m AIN_FG3 VARCHAR (10) DARKGREEN Head_BG VARCHAR (10) # c0c0c0 alt_bg varchar (10) # 009900 alt_fg varchar (10) #ffffff button_fg varchar (10) DarkGreen ---------- ------ --------- ------ --- --------------------------- USER_EREG FIELD TYPE NULL Key Default Extra --------------------------- ---- ----- --------- --------------
ID INT (4) Pri 0 Auto_Increment usr varchar (50) Mul Headshow int (1) 0 PageMax Int (2) 20 reply int (1) 0 replyhead varchar (8) Re: filterhz int (1) 0 Maxmail Int (3) 2048 mailtrun int (1) 0 deleteopt int (1) 0 POPTIME INT (1) 90 Popflag Int (1) 0 Popusr varchar (200) Yes Null Poppwd varchar (200) Yes Null AutoSend Int (1) 0 Autoturn Int (1) 0 --------- ------------ ------ --- -------- - ---------------- User_Status Field Type Null Key Default Extra ---------------------- ------- ---------- ---------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------- - -------------- ID int (4) pri 0 auto_increment usr varchar (50) Name varchar (100) Yes null Pager varchar (10) Yes Null Pagerno varchar (20 YES NULL FAX VARCHAR (50) YES NULL MOBIL VARCHAR (50) YES NULL SEX VARCHAR (6) YES NULL BRITHDAY INT (4) YES NULL Education Varchar (20) Yes Null Marry VARCHAR (20) YES NULL JOB VARCHAR (20) Yes Null Potision Varchar (30) YES NULL Company VARCHAR (200) YES NULL CMODEL VARCHAR (20) YES NULL CPAGE VARCHAR (100) YES N ULL ADDON VARCHAR (100) YES NULL Stat Varchar (20) Yes Null Adate Int (4) Mul 0 fpask varchar (100) forget my password! Fpans varchar (100) Yes mymark varchar (200) YES NULL ----- --------- --------------------------------- ----- ------ -------------------- -------------- 5, system error Treatment 1. Error information: The situation may be wrong in this system: 1) The username and password error occurred in the login, there are four situations depending on the combination calculation. 2) The time date input for registration and timing is an error. 3) Send the letters address error. 4) The order of the operation series. 2. Error handling method and remedial measures 1) Tip according to the incoming species prompting the application mailbox or forgetting the password to re-enter 2) Tips reload. 3) The system returns a mail notified by the Undelivered Mail. 4) The system prompts the correct sequence of operation. Six, module design instructions