สำหรับโปรแกรม dovecot ถ้ายังไม่ติดตั้งโปรแกรมสามารถติดตั้งได้ด้วยคำสั่งในเทอร์มินัลดังนี้ sut@main:~$ sudo apt-get install dovecot สำหรับโปรแกรม roundcube ถ้ายังไม่ติดตั้งโปรแกรมสามารถติดตั้งได้ด้วยคำสั่งในเทอร์มินัลดังนี้ sut@main:~$ sudo apt-get install roundcube roundcube-mysql |
สมมุติเมล์เซิร์ฟเวอร์ของเราชื่อ
mail.myschool.net การคอนฟิก dovecot ไฟล์คอนฟิกคือ /etc/dovecot/dovecot.conf แต่ไม่จำเป็นต้องเปลี่ยนแปลงค่าใดๆ ค่าโดยปริยายใช้ได้ดี |
สมมุติเมล์เซิร์ฟเวอร์ของเราชื่อ
mail.myschool.net การคอนฟิก roundcube 1. ลบดาต้าเบส roundcube ถ้ามีอยู่ก่อนแล้ว ด้วยคำสั่ง sut@server:~$ mysqladmin drop roundcube -p -u root Enter password: ตรงนี้ให้ป้อน meroot ซึ่งเป็นค่าโดยปริยายที่ตั้งไว้แต่แรก Dropping the database is potentially a very bad thing to do. Any data stored in the database will be destroyed. Do you really want to drop the 'roundcube' database [y/N] y Database "roundcube" dropped 2. เริ่มการคอนฟิกด้วยคำสั่ง sut@server:~$ sudo dpkg-reconfigure roundcube-core แล้วให้ป้อนค่าต่างๆ ตามลำดับดังนี้ IMAP server(s) used with RoundCube: mail.myschool.net Default language: th_TH Reinstall database for roundcube? Yes Database type to be used by roundcube: mysql Connection method for MySQL database of roundcube: unix socket Name of the database's administrative user: root Password of the database's administrative user: meroot MySQL username for roundcube: roundcube MySQL database name for roundcube: roundcube Web server(s) to configure automatically: apache2 Should the webserver(s) be restarted now? yes 3. แก้ไขไฟล์คอนฟิกสำหรับการเข้าถึงโปรแกรม roundcube ผ่านทางเว็บ โดยให้แก้ไขไฟล์ /etc/apache2/conf.d/roundcube ให้เอา comment ของสองบรรทัดด้านล่างนี้ออก Alias /roundcube/program/js/tiny_mce/ /usr/share/tinymce/www/ Alias /roundcube /var/lib/roundcube 4. ให้ restart apache ใหม่ sudo service apache2 reload 5. เปลี่ยนค่าคอนฟิก roundcube ในไฟล์ /var/lib/roundcube/config/main.inc.php ในส่วนที่เกี่ยวข้องให้มีข้อมูลดังนี้ $rcmail_config['default_host'] = array("mail.myschool.net"); $rcmail_config['create_default_folders'] = TRUE; $rcmail_config['default_charset'] = 'UTF-8'; 6. ถ้าต้องการเปลี่ยนขนากการแสดงตัวอักษร ซึ่งมักจะเล็กเกินไปสำหรับภาษาไทย ให้เข้าไปแก้ที่ /var/lib/roundcube/skins/default/common.css และ /var/lib/roundcube/skins/default/mail.css 7. ถ้าต้องการความปลอดภัยที่สูงขึ้น คือทุกคนที่ต่อเข้ามาใช้ webmail จำเป็นต้องต่อเข้ามาทาง secured web ให้แก้ไข /var/lib/roundcube/index.php ด้วยการเพิ่มส่วนหัวด้วยคำสั่งดังนี้ $sp_port=$_SERVER["SERVER_PORT"]; $sp_address1=trim($_SERVER["SERVER_NAME"]); // localhost $sp_address2=trim($_SERVER["REQUEST_URI"]); // /info.php $sp_link='https://'.$sp_address1.$sp_address2; if($sp_port==80){ echo "<meta http-equiv=\"refresh\" content=\"0;URL= $sp_link\">\n"; } |