Summary: the purpose of this article is by applying the Linux system integration network services and applications, rapid implementation of Web-based e-mail system.
The author just ordinary Linux enthusiasts, try to have learned a little Linux knowledge in an integrated application that wishes to be inspiring for us. Free Webmail is generally provided by the ISP a service, its greatest advantages is the convenient, users only need to pass the browser will be able to complete the mailbox to send messages, applications, and receive e-mail and other features; also, due to the emergence of Webmail, greatly improving the ISP access number of the site, improve site visibility, therefore it is a good thing to have it both ways. However, the bulk of the Webmail server as its system complexity and reliability requirements, prices are more expensive, not very suitable for Intranet environments. Linux as a good network operating system, it releases integrated a lot of network application software, such as the Web server (apache), FTP server (wu-ftp), mail server (sendmail + imap4), SQL database (postgresql), and so on, you can quickly build an intranet environment, and also have exquisite e-mail program (metamail) and powerful Web server-side development tools (PHP3). When you configured sendmail and activate your imapd, Linux users can use Outlook, and other client software to send and receive e-mail, so that they are centralized application, you can implement a simple Webmail server functionality. 1. the main features of Webmail and we use: apply for: 1, mailbox using PHP3 in exec execute as root and the edquota command useradd build system users and set user disk quota, and the user are saved to the postgresql user table, an application to the email address will? A HREF = "mailto: username @ domain form. If you only want to provide users with the functionality of the Web application for mailbox so that they can use Outlook, mail client for message processing, the purpose has been met. "> Form username @ domain. If you only want to provide users with the functionality of the Web application for mailbox so that they can use Outlook, mail client for message processing, the purpose has been met. 2. edit a message: use the HTML form to construct an edit field, and take advantage of the Netscape3 support IE4 and "file" type, with e-mail attachment upload feature. 3. send mail using PHP3 in exec Execute metasend provide forwarding to send mail-encoding and. 4. receiving mail: using PHP3 in powerful imap support function set for message data receiving and decoding as well as the management of your Inbox and the message attachment is split into a temporary file in the directory for anonymous access, ftpd, and descriptive information using attachments generated hyperlinks to facilitate client download. 5. account management: using PHP3 in exec Execute command passwd and deluser user's password change and delete functions for the mailbox. 2. the following are instructions for the above functionality of specific methods and considerations. 1. support for the imap and postgresql for PHP3 module compilation we use RedHat5.1 does not include PHP3 support, and General PHP3 execute package has no imap support compiled in advance, to fully use this excellent Web server-side development tools, it is best to download the source, on wwwphp.net actually it is very delicate, not to total as a 2M 150,000 site use approved (PHP3 help documentation of statistical data) and in the Linux world, the award-winning software and its source code should be all publishers have selected. Thanks, PHP3 IMAP support needs c-client library and related header files, so you should unpack the imap4 source program packages compiled. Note When you use imap4 compilation makelnx generated Makefile file might not be discovered in the crypt, you only need to connect library options plus lcrypt. General description of the source files to compile error, mostly because the Makefile file in the Directory include or lib and does not match the local directory. 2. upload support attachment (attachment) is an important part of the message, the client of the file to be uploaded to the server-side processing, require the client's browser and the server has support. In PHP3 's help documentation on upload processing instructions and examples, and IE4 and Netscape has very good support for this feature, but unfortunately we don't have any books on HTML see similar introduction. 3. Introduction to Linux environment metasend general use of e-mail is mail, but it does not support the MIME encoding, and cannot be set to send addresses the needs of the unfit for Webmail. Metasend is a support MIME standard email program, and you can set the sending end users address and encoding, very suitable for shell commands, it is included in the metamail package, only 15K. Directly use it as a back-end of Mailer, realize the MIME encoding can effectively reduce the complexity of the program. Since PHP3 can quickly process form data, and use of exec-The external program with the system, therefore, the effective use of Linux application software provided by a large number of combined with flexible input and output redirection as a CGI program is a simple method, and this is also a large number of characters in a Linux system interface or command line handler's strengths. 4. email attachment downloads due to browser limitations to local file system write feature to download files in the most natural way is via the browser directly using FTP for anonymous access. Since Linux system integrates wu-ftpd, so the message's attachment to the way in which temporary files are placed in ftpd's anonymous access subdirectory, and only allow write nobody, and server-side in the display message information when you use headers in annex describes information generated hyperlinks to simple and natural solution to this problem. 5, PHP3 in IMAP and introduction to postgresql support PHP3 is actually a Web server and a large number of C library functions as an intermediary layer, and handle the form submission data capacity for expansion, in addition, it also has a similar style and C, so it can be simple and efficient realization of complex features. PHP3 contains 38 on imap provides support functions, these functions are based on the IMAP4 protocol standard customer development library support, its functionality and efficiency is completely reliable and guaranteed to use these functions you can quickly connect imapd, verify the address and receive mail, e-mail, decoding the message split, manage mailboxes, etc. We put postgresql database is primarily used to authenticate users and to track user-generated temporary file, the function is relatively simple, but thanks to the SQL-based database in handling concurrent access on it without worrying about conflicts. PHP3 support many database systems, of course need to have their Linux-based C development library and header files, postgresql as integrated in the distribution of SQL database with object-oriented and the psql client very friendly nature becomes preferred. PHP3 provides 32 postgresql support function, and there is plenty of documentation and examples to implement Web database is not difficult, the main attention in each table to nobody for authorization. PHP3 with almost no database access using ODBC, instead of directly using the database provided by the developer library, but it uses a similar format, the same function call. PHP3 document some parts of the return value type is wrong, just a little test before use, the following can be avoided. 6. sendmail configuration of sendmail is widely used by the mail transport system, its history and powerful, but configuration is more complex. However, you can use linuxconf start its basic functionality. Note that many mail servers, DNS MX records play critical role in your DNS for each domain is given a clear MX records. Sendmail with linuxconf configuration choose not immediately transmitted messages and short queue processing time to reduce the client as input the wrong e-mail address appears, moreover, directly edit the/etc/rc.d/init.d/sendmail set a short timeout time conducive to improving the efficiency of the Intranet environment. In fact, understanding of the functionality provided by sendmail is to establish a powerful messaging system. 7, security considerations, because our Webmail system is Linux system users, to ensure the security, does not confer the right to log on directly, that is, specify a shell that does not exist. As in create user, modifying passwords, delete account use the root account, so you need to hide the password file, it is best to cancel the telnet service or to set up a trusted host. For the system to the original account, not as a webmail user account to avoid an error result Webmail key information is missing. Because the message system is intended for multiple users, so you must provide a disk quota control, and shorten the time limit in the upload file note set its file transfer maximum length. At the same time, in order to prevent the user to quit, but you cannot delete the generated temporary file, you can set for root cron tasks on the expiration of a temporary file for processing. Disable nobody and FTP account (default) 8, performance optimization and if you find that your Webmail is overloaded, you can put the integrated database (postgresql), domain name server (named) and Web server, they can be accessed over the network. Similarly, you can put user across multiple mail servers meet the needs of users, after all, Linux is a lower and very cheap system. In addition, you can open the source code, reference metasend directly using PHP3 implementation messages sent directly to avoid calling a SHELL program, should be able to improve performance. Similarly, you can use Mysql replace postgresql. The above simple describes our Webmail implementation methods and considerations, this is just our Linux system understand very superficial situations of simple solutions, and not from the point of view of system performance, with careful and do not represent the Linux as a real strength of the network system, we just simple and convenience on thinking, because we feel quickly achieve its basic features that help us better learning and using Linux. However, we are deeply aware of Linux system and its integration of a large number of software's charm and strength, similarly deeply appreciate it to our own thinking and solving problems caused by change, it gives us more choices. Indeed, it's already far exceeded our expectations.
No comments:
Post a Comment