转载:http://www.forsuc.com/wiki/doc.php?action=view&title=%20phplist
PHPlist是一个开源电子报管理器,易于与任何网站相集成。PHPlist的下载量每个月超过一万多次。它具有双向确认(opt-in)订阅机制,定时调度,RSS,点击跟踪,支持附件,退件管理等特性。
官方网站
最早是:http://tincan.co.uk/phplist
现在:http://www.phplist.com/
版本:phplist-2.10.5
下载:http://www.forsuc.com/disk/www/?a=d&i=wASvCpT46b
提取码:2658
版本:phplist-2.10.10
下载:http://www.forsuc.com/disk/www/?a=d&i=t5djN9jT02
提取码:2254
安装方法,请参考 http://www.forsuc.com/blog/no-order/phplist_setup_config_chinese.html
修改Phplist发送邮件时的版本图片及powered by 信息,请参考 http://www.forsuc.com/blog/no-order/phplist-poweredby.html
Phplist导入vcard或者csv用户数据 http://www.forsuc.com/blog/no-order/phplist-vcard-csv.html
下面是发现的网上发现的一些问题及解决办法,都是基于2.10.5,我现在已做修改,请参考上面的链接。
首先至http://www.phplist.com/下载最新版的phplist,这边安装的版本是phplist 2.10.9。安装在CENT OS 5.3。
解压缩后,首先编辑lists/config/config.php这个档案。
设定如下
1.连结mysql的相关设定修改
$language_module = "tchinese.inc"; //正体中文语系
$database_host = "localhost"; //资料库位址与主机同一部就设localhost
$database_name = "YYY"; //资料库名称
$database_user = "ZZZ"; //资料库使用者名称
$database_password ="PASSWORD ''; //密码
2.资料库的字型预设值为unicode_general_ci的设定时,记得修改/lists/admin/structure.php
的line 69
"email" => array("varchar(255) not null unique","Email"),
修改为
"email" => array("varchar(233) not null unique","Email"),
原因参照
http://mantis.phplist.com/view.php?id=8583
另外在lists/admin/mysql.inc
找到:
return $db;
在上面加一行:
@mysql_query('SET NAMES utf8');
让phplists写入资料库时为utf编码,在phpmyadmin底下中文就不会显示一堆乱码
3.lists/admin/info 复制 en ,改名为 zh-tw
lists/admin/help复制 en ,改名为 zh-tw
解决大量汇入使用者无法出现选项的问题,如果有需求再针对里面的文字翻成中文,否则还是以英文显示。
4.用浏览器连接至/lists/admin,点选初始化资料库开始安装
5. 移除寄信时附加的 phplist logo
/lists/admin/sendemaillib.php
# Logo mark $text["signature"] = "\n\n--\nPowered by PHPlist, www.phplist.com --\n\n"; //文字注解
/* Logo mark
if (!EMAILTEXTCREDITS) {
$html["signature"] = $PoweredByImage;#'
phplist.com"> [Powered by
';
# oops, accidentally became spyware, never intended that, so take it out again :-)
$html["signature"] = preg_replace('/src=".*power-phplist.png"/','src="powerphplist.png"',$html["signature"]);
} else {
$html["signature"] = $PoweredByText;
}
*/
使用gmail来处理退信机制,以及设定寄送速率首先申请gmail的帐号
设定/lists/config/config.php
$bounce_protocol = 'pop';
$message_envelope = '[email protected]';
$bounce_mailbox_host = 'pop.gmail.com';
$bounce_mailbox_user = '[email protected]';
$bounce_mailbox_password = 'password';
$bounce_mailbox_port = "995/pop3/ssl";
寄送速率设定
每次寄送的信件数,预设为0不限制
define("MAILQUEUE_BATCH_SIZE",0);
每次寄送的间隔,预设为3600秒
define("MAILQUEUE_BATCH_PERIOD",3600);
如果要设定为每秒寄出一封的话size=1,period=1
2. 中文化
中文化client介面:
下载中文语系档
http://twpug.net/modules/newbb/viewtopic.php?topic_id=462&forum=12&post_...
拷贝到 ~/lists/texts/
设定正确的charset:
在页面中找到「charset for html...」和「charset for text...」
~/lists/admin/?page=configure
这样送信的标题和内文就可以正常显示中文(unicode)
3. bug fix
3.1 解决发信、存档时中文标题乱码的问题
如果你使用的是2.10.5,参考:
/lists/admin/send_core.php line 813:
将这一行
value="'.htmlentities($subject).'" size=40>
换成
value="'.htmlentities($subject,ENT_COMPAT,'UTF-8').'" size=40>
如果你使用的是2.10.10,参考:
1034行:
//value="'.htmlentities(iconv('ISO-8859-1','UTF-8',$subject),ENT_QUOTES,'UTF-8').'" size=40>
更改成:
//value="'.htmlentities($subject,ENT_QUOTES,'UTF-8').'" size=40>
3.2 解决在yahoo、hinet看时乱码的问题(但gmail没问题..)
首先,php要支援imap的function,debian的话
apt-get install php4-imap
重新启动apache
/lists/admin/sendemaillib.php line 56:
把
$cached[$messageid]["subject"] = (stripslashes($message["subject"]));
换成
$imap_subject = imap_binary(stripslashes($message["subject"]));
$cached[$messageid]["subject"] = "=?UTF-8?B?".$imap_subject."?=";
用imap的方式编码,让标题与内文成为不同的编码方式
这样或许是比较标准的方法吧?
“Bounces” 处理是 phplist 的一个强大的功能, Bounce是制一些邮件因为某些原因不能递送而返回的信息.这些原因可能是:收件人信箱满了,有限公司地址可能不再生效或暂时关闭,或者邮件地址被拼错等等.Bounce 是不同于自动回复的,For more info, see this Wikipedia article onbounces[http://en.wikipedia.org/wiki/Bounce_message].
消息邮箱
在 config.php 文件里,你可以特别设置一个叫”消息信箱地址”的邮箱地址.这个地址将包含在邮件头信息的”Return-Path”里.
他将可以用来接受 bounces,但是首先你得确认已经建立了这个邮箱地址而且他工作正常.还有不要忘记去掉 “$message_envelope” 前面的确”#”
$message_envelope = "[email protected]";
Bounce threshold
这是一个附加的设定,规定一个邮箱地址连续几次发送失败后,系统自动将该地址屏蔽(unconfirmed)
$bounce_unsubscribe_threshold = 5;
很多用户在使用phplist运行的主机空间并不是他们所拥有主权的,通常会是共享主机:很多网站放在一台电脑上.
这就意味这如果一个网站突然占用大量CPU资源或者是什么不正常的举动,占用资源,其他人都会蒙受损失.
因此,大多数主机提供商会限制一个网站可以发出的邮件的数量.或者是每小时、每天的数量。来确保一个人的操作不会央及同一主机上的其他网站。
示例 Example
# Send a batch of 360 messages per batch period:
# 每批次发出360封信
define("MAILQUEUE_BATCH_SIZE",360);
# batch period is set to 3600 seconds (=1 hour):
# 一批次为 3600 秒(1小时)
define("MAILQUEUE_BATCH_PERIOD",3600);
# Pause between messages (in seconds) to avoid overloading the server:
# 每封信发送间隔1秒,以避免服务器过载。
define('MAILQUEUE_THROTTLE',1);
# Mailqueue autothrottle. This will try to automatically change the delay
# between messages to make sure that the MAILQUEUE_BATCH_SIZE (above) is spread evently over
# MAILQUEUE_BATCH_PERIOD, instead of firing the Batch in the first few minutes of the period
# and then waiting for the next period. This only works with mailqueue_throttle off
# it still needs tweaking, so send your feedback to mantis.tincan.co.uk if you find
# any issues with it
define('MAILQUEUE_AUTOTHROTTLE',0);
# Domain Throttling
# You can activate domain throttling, by setting USE_DOMAIN_THROTTLE to 1
# define the maximum amount of emails you want to allow sending to any domain and the number
# of seconds for that amount. This will make sure you don't send too many emails to one domain
# which may cause blacklisting. Particularly the big ones are tricky about this.
# it may cause a dramatic increase in the amount of time to send a message, depending on how
# many users you have that have the same domain (eg hotmail.com)
# if too many failures for throttling occur, the send process will automatically add an extra
# delay to try to improve that. The example sends 1 message every 2 minutes.
define('USE_DOMAIN_THROTTLE',0);
define('DOMAIN_BATCH_SIZE',1);
define('DOMAIN_BATCH_PERIOD',120);
邮件地址验证等级 Email address validation level
# 0 = No email address validation. So PHPList can be used as a non-email-sending registration system.
# 1 = 10.4 style email validation.
# 2 = RFC821 email validation without escaping and quoting of local part.
# 3 = RFC821 email validation.
# This is an experimental email address validation based on the original RFC. It will validate all kind
# of 'weird' emails like !#$%&'*+-/=.?^_`{|}[email protected] and escaped\ spaces\ are\ allowed@[1.0.0.127]
# not implemented are:
# Length of domainPart is not checked
# Not accepted are CR and LF even if escaped by \
# Not accepted is Folding
# Not accepted is literal domain-part (eg. [1.0.0.127])
# Not accepted is comments (eg. (this is a comment)@example.com)
# Extra:
# topLevelDomain can only be one of the defined ones
define("EMAIL_ADDRESS_VALIDATION_LEVEL",2);
List exclude
# list exclude will add the option to send a message to users who are on a list
# except when they are on another list.
# this is currently marked experimental
define("USE_LIST_EXCLUDE",0);
原本发出去的邮件尾部都会带着一个 PHPLIST 的签名,把这改成自己公司的特征非常重要.
如何修改呢?
用 dreamweaver 在程序代码中搜索 “$html["signature"]“,修改之即可以.
还有找到 define (”TEST”,1);改成 define (”TEST”,0); 否则系统将处与测试状态,不会真正发出 email.
如果您是VPS 用户,您还可以参考这篇文章.VPS Ubuntu 上安装配置 Postfix + Courier ,来配合 PHPLIST