Mail servers implement web-mail system with twig on debian

Author: kanaka ([email protected])
Time: 2002.11

This article was originally published by the author kanaka on linuxsir.com.

1 Some nonsense

  Whichever unit you establish what a machine that can run mail servers are supposed to do. I would like to upload a webmail server in debian. This is my first time installing and configuring webmail platform on GNU, before that, I do not have any webmail server install any other GNU / Linux on it. So certainly there is nothing wrong, please enlighten brothers. In addition, there are many places I did not understand, at the end of this article I wrote a list of "outstanding issues", experts have to teach me ah! Ha ha.

  I went to google looking for a bit and found a software called twig seemed very popular. Also find a tutorial called "twig use WebMail system set up," but unfortunately, we are a far cry from the installation and configuration process debian - which again reflects the Youyuezhichu of debian, debian on, it seems to install any the software does not make you a headache, extraordinary apt is so smart, we really have to be grateful, thank you for debian and friends who quietly pay. However, this paper draws or "use twig set up WebMail system," the source is linuxcenter, the author is MichaelCheng, we thank him.
  twig the word is very interesting, which itself has a tender shoots of meaning, but here it is The Web Information Gateway acronym. twig is developed based on php3, you might say: "I want to use php4!" Oh, You're just like me - I do not want to use php3. But do not worry, it certainly can run php4 interpreter inside. twig is a browser-based groupware client. Its main purpose is to provide an IMAP client, but now it also offers news groups, address book, scheduling, meetings, bookmarks and other functions (agenda, news-reader, bookmarks , contact list and other features).
  Tips for beginners is: the beginning of this article by the pound sign, orders are as root in the console inside debian input; by the mysql> at the beginning, are entered in the mysql command console.

2 What do we need

  Required packages: twig.
  Other related packages (depends): php4 (or php3), php4-imap (or php3-imap), php4-mysql ( or php4-pgsql, php3-mysql, php3-pgsql), debconf.
  Other required package (suggested): a web server (We use Apache), a database server (We use MySQL), a impa server (we use uw-imapd), a mail agent (we use sendmail).

  If using other distributions, download and install these packages can be really troublesome thing. However, with debian, very easy! Ha ha.

3 download and install the required support software

  Well, download and install the required support software (twig behind us and then download):

  # apt-get install apache php4 php4-gd php4-imap php4-mysql mysql-server mysql-client debconf uw-imapd sendmail

  Wherein, php4-gd is not required. This is a dynamic image library for drawing. Here I have installed, because I need nothing, huh, huh. note,

  It asked if you start when the computer is started MySQL? Of course it! Or else manually start each time, sick of it.
  Then she will be based on these packages you choose, automatically configure some parameters (debian really great).
  Then, I ask you: Do you want me to run apacheconfig script it? The default is No. Enter Y, Enter, configure it for us a bit. Configuration finished, it will ask you: to save the configuration file? The default is Yes, Enter on the line. Then you ask: Restart Apache do? The default is Yes, Enter.
  Because I chose to support the gd library, it will ask whether the extension = gd.so write php.ini file (debian really smart ah), the default is Yes, Enter.
  Then she will ask you, if the extension = imap.so write php.ini file? The default is Yes, Enter on the line.
  Then she asked you whether the extension = mysql.so write php.ini file? The default is Yes, Enter on the line. You say debian smart not smart.

  Next, he asked if you want to configure sendmail, enter Y, press Enter. Then be set according to your situation - but I use all of the default settings. After configuration, she asked if you want to start sendmail, yes.

4 configure these software support

4.1 Apache Configuration

Let Apache 4.1.1 can display Simplified Chinese

  # Nano /etc/apache/httpd.conf (I really like this called the nano editor, better than the likes vi)

  Then nano inside, find AddDefaultCharset on this line, to put on the gb2312. Find a way is very simple, press ctrl + w, enter AddDefault and press Enter to find. Keep the nano run, the first not to quit.

4.1.2 allow Apache to support php4

  Locate the line where libphp4.so (press ctrl + w, enter libphp4.so and press Enter), then put the first character of the line "#" removed. Keep the nano run, the first not to quit.

4.1.3 allow Apache to support php3

  Locate the line httpd-php3 where (according to ctrl + w, enter httpd-php3 and press Enter), this first character of the line "#" removed, then this line of httpd-php3 inside the 3 removed (this step is very important, because we do not php3 installed, but with php4 php3 script to explain).
  Well, this httpd.conf change over. Ctrl + o and press Enter, save. Then press ctrl + x, quit.

Restart Apache 4.1.4

  # apachectl restart

4.1.5 Test Apache

  Php3 write a script in the browser test:

  # nano /var/www/test.php3

  Then enter the following: <? phpinfo () ;? >, And then press ENTER ctrl + o, save. Then press ctrl + x to exit. Access to a browser inside look at this test.php3, see the basic information of php can appear. It should be no problem. There are problems elsewhere invite you to look them information.

4.2 Configuration php4

  If you do not modify the php.ini, then our php script will not display Chinese. The problem I found out yesterday, before he bothered me for a long time, I changed httpd.conf, change the left and right to change, how will not work. Yesterday only to find a line in php.ini which defines the default character set, which is defined in the httpd.conf Apache's default character set to cover!
  Edit /etc/php4/apache/php.ini, find default_charset = "iso-8859-1", before it was comment symbol ";" removed, and change it to: default_charset = "gb2312":

  # nano /etc/php4/apache/php.ini

  Then press ctrl + w, enter default_charset and press Enter to find. After the change, and press Enter ctrl + o, save. Then press ctrl + x to exit.

Configure MySQL 4.3

  The main is to modify the root password. By default, root password is not required when accessing MySQL. This is very dangerous! For security purposes, we need to change the password out. You can take a look at the current MySQL is not really no password:

  # mysqladmin version

  This command will display some MySQL version information. If this information is displayed, and then the password is empty. Well, use the following command to modify the password:

  # mysqladmin password xxxxxxx

  Of course, where xxxxxxx is your new password a. Now you run mysqladmin version, it will report an error that connect to the server fails, access is denied. After that, you need to use the following command format to access the MySQL:

  # mysqladmin -u root -p version

  In this way, it will ask you for a password.

5 Installation and Configuration twig

  Above do so much, are paving the way, Oh, now is get down to business, huh, huh.
5.1 Installation twig

  # apt-get install twig

  It will pop up a window, as if to say, you need to do some configuration, but the deb package already configured with the MySQL database for you, and it required twig MySQL database has been established. But I have found that is not true - and there is no database created. You can view the system database through the following measures:

  # mysql -u root -p
  mysql> show databases;

  I found only two own MySQL database is a mysql, is a test. To do this, I need to do it yourself.

5.2 Configuration twig

5.2.1 look twig documents

  Cd # / usr / report this content share / DOC / Twig
  # gzip -d INSTALL.gz
  # More the INSTALL (first look at this explanation, there may be used)
  # gzip -d Setup-the Apache-PHP-IMAP-TWIG-mysql.txt. GZ
  # More Setup-the Apache-PHP-IMAP-TWIG-mysql.txt (look at this, is certainly helpful)

5.2.2 modify /etc/twig/config.inc.php3

  I changed the following major items:

  $ config [ "fromdomain"] = "xiyuan.net"; ( modified to you this twig domain name)
  $ config [ "Language"] = "ChineseGB"; (the default language into simplified Chinese, chinesebig5 Traditional Chinese)
  $ config [ "session_handler"] = "php4session"; (php4 cookie may be changed over the session)
  $ config [ "login_handler"] = "php4session";
  $ config [ "imap_port"] = "143 / notls"; (plus on / notls, in order to avoid php does not support tls, unable to connect imap)

5.2.3 modify /etc/twig/dbconfig.inc.php3

  $ dbconfig [ "sqlusername"] = "root"; ( modified mysql user accounts)
  $ the DBConfig [ "sqlpassword"] = "Your Password"; (modify user's password mysql)

5.2.4 establish a database for the twig

  MySQL MySQL -u root -p #
  MySQL> the Create Database twig; (twig established name for the database)
  MySQL> Grant All privileges ON * * to root @ localhost IDENTIFIED by 'xxxx';. (Add new user privileges to MySQL, xxxx is the user's password)
  MySQL> quit

  Cd # / usr / report this content share / Twig / Setup
  # gzip -d twig.table.mysql.gz
  # -u root -p Twig MySQL
  MySQL> Source /usr/share/twig/setup/twig.table.mysql; (execute SQL script, create a table)
  MySQL> quit

  Also in this directory:

  Gzip -d advangced.acl.population.gz #
  # Nano advangced.acl.population (SQL script that contains a control list)

  Then modify the second row, INSERT INTO twig_acl_groups VALUES ( '456744 ', 'TWIGAdministrators', ' change your administrator name'); I use kanaka, this is my general account in my debian above, I can use this account specifically to manage the webmail system. Then save and exit.
  Then this advangced.acl.population also imported into the database inside:

  # Mysql -u root -p twig <advanced.acl.population (execute SQL scripts, data insertion control list table)

6 Test twig

  You should now be able to login. Prior to login, first test. Open in the browser:
    HTTP: //localhost/twig/test.php3
  and there are two tests for IMAP and MySQL a test. The second test in which IMAP, you enter a debian above normal user try. I started always encounter the following error report:
  Could not Open Stream {localhost: 143} INBOX /var/www/html/twig/lib/mail/php-imap.inc.php3 76 in
  fact, the problem lies in not on php-imap.inc.php3, the problem lies in /etc/twig/config.inc.php3, we have made adjustments in the above 5.2.2 inside, this problem should not occur.

7 Login twig

  Open in the browser:
    HTTP: //localhost/twig/index.php3
  then use a normal user login debian try. Oh, great, Simplified Chinese pictures.

8 System Management

  5.2.4 In the inside, we have become established kanaka administrator. To use the "System Management" function in the twig inside, you must also set the following:

  # mkdir /usr/share/twig/features/admin/users
  # cd /usr/share/twig/features/admin/users
  # touch kanaka.admin

  But I found in this directory, you give any ordinary user to set up a username.admin, then he will have permission to use the "System Management" function. It seems we set in the administrator 5.2.4 which may have a higher authority, but I did not understand. Also, experts advise.

9 remaining issues

  Brothers, you are likely to see straight curl one in my article, huh, laughed laughed, after all, is the first time fiddle IMAP, Sendmail, twig these gadgets.
  A lot of my problems.

9.1 I try to send an e-mail with a twig to other accounts on this machine, but they did not receive. No error message.

9.2 I try to send an e-mail with a twig to [email protected] on the Internet, I have not received. Also there is no error message.

  My network environment: inside my firewall in the company. NAT can be used by our company on the Internet, as long as my IP address registered on their servers, I can ping to the Internet, or can only ping the inside. ip address I use debian is registered, you can on the Internet.

  Sendmail is not my problem ah! Please enlighten me, let me grow! I do not understand for sendmail, sendmail part so I did not write. We can improve this article helped write down, making him a complete tutorial!

Reproduced in: https: //www.cnblogs.com/licheng/archive/2008/01/23/1050073.html

Guess you like

Origin blog.csdn.net/weixin_34192816/article/details/92630892