在Linux中安装和配置Squirrelmail
SquirrelMail是一种基于标准的WebMail包,允许用户通过Web浏览器而不是任何邮件客户端访问其邮件。
它包括IMAP和SMTP协议的内置纯PHP支持,以及所有页面在纯HTML 4.0中呈现(无需JavaScript),可在浏览器中最大兼容性。
它配备了大量的插件,我们可以根据所需的功能添加到SquirrelMail安装。
在本教程中,我想你有一个带有Apache/PHP Web服务器支持的Linux服务器,Exim Mail Server(SMTP)和IMAP服务器(在我们的情况下UW IMAP)。
Squirrelmail的要求
A web server with PHP is installed. PHP needs to be at least 4.1.0. PHP 4, PHP 5 and PHP 6 are all supported. Access to an IMAP server which supports IMAP 4 rev 1. PHP gettext extension for better performance. The PHP mbstring extension is required for translations that uses multibytes or character sets but ISO-8859-1. Without the PHP mbstring extension the interface will remain usable, but some internationalization features and fixes won't be enabled. The PHP XML extension is required if the DIGEST-MD5 authentication is used. SquirrelMail is shipped with some Perl scripts. One of the most useful is config/conf.pl, which will help you configure your squirrelmail installation. First two are the mandatory requirements for squirrelmail. Following PHP settings are recommended for Squirrelmail. register_globals off - This is a dangerous setting when enabled, and is not generally needed for most recent PHP applications. magic_quotes_{runtime, gpc, sybase} off - Squirrelmail Jan work with any of these turned on, but if you experience stray backslashes in your mail or other strange behaviour, it Jan be advisable to turn them off. file_uploads on - This is needed if your users want to attach files to their emails. safe_mode on or off - Turning safe mode on in squirrelmail's case is not much more secure than having it off. When it is enabled, incompatibilities with some functionality Jan arise.
Squirrelmail的安装
现在,我们可以通过安装Squirrelmail。
1.下载SquirrelMail包
我们可以从http://www.squirrelmail.org/获取最新的Squirrelmail包。
我正在撰写本文时的最新稳定版本是1.4.22.
2.解压缩松鼠邮件包
cd /usr/src tar –jxvf squirrelmail-1.4.22.tar.bz2 mkdir /usr/local/squirrelmail mv /usr/src/squirrelmail-1.4.22 /usr/local/squirrelmail/www
3.更改SquirrelMail目录的所有权
我们需要将目录的组所有权更改为Apache Web服务器的用户/组。
我们可以从Apache配置文件'httpd.conf'找到它(检查"用户"和"组"指令)。
chown –R root.apache /usr/local/squirrelmail
4.创建数据和附件目录
我们需要为SquirrelMail创建数据和附件文件夹。
"数据"目录是SquirrelMail用户首选项文件的默认位置。
cd /usr/local/Squirrelmail mkdir data attachments chgrp apache data attachments chmod 0730 data attachments
5.配置SquirrelMail.
配置Perl脚本可在"配置"目录下。
因此,我们需要CD到"配置"目录并执行,
./conf.pl此配置实用程序提供基于菜单的配置选项:
SquirrelMail Configuration : Read: config_default.php (1.4.0) -------------------------------------------------------- Main Menu - 1. Organization Preferences 2. Server Settings 3. Folder Defaults 4. General Options 5. Themes 6. Address Books 7. Message of the Day (MOTD) 8. Plugins 9. Database 10. Languages D. Set pre-defined settings for specific IMAP servers C Turn color on S Save data Q Quit Command >>
选择"D"选项,然后使用"UW"预设配置SquirrelMail。
以下是配置SquirrelMail时可能需要编辑的一些配置设置。
选项1(组织偏好设置):为组织名称和站点链接提供
选项2(服务器设置):
域名:提及域名
sendmail或者smtp:smtp
服务器软件:UW
选项4(常规设置):
数据目录:/usr/local/squirrelmail/data
附件目录:/usr/local/squirrelmail /附件
在我们认为适合时进行任何其他更改,选择"s"保存,然后选择"s"然后"q"退出。
6.在Apache中配置SquirrelMail
现在,我们需要修改Apache配置文件httpd.conf以通过Web浏览器使用SquirrelMail。
将以下内容添加到httpd.conf:
Alias /squirrelmail /usr/local/squirrelmail/www Options None AllowOverride None DirectoryIndex index.php Order Allow,Deny Allow from All
7.重新启动Apache Web服务器
现在,我们需要重新启动Apache以获取更改以生效。
/usr/local/apache/bin/apachectl restart
现在,我们将能够访问"http://theitroad.com/squirrelmail"。