本文整理汇总了PHP中maincf_multi::mailling_list_mysql方法的典型用法代码示例。如果您正苦于以下问题:PHP maincf_multi::mailling_list_mysql方法的具体用法?PHP maincf_multi::mailling_list_mysql怎么用?PHP maincf_multi::mailling_list_mysql使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类maincf_multi
的用法示例。
在下文中一共展示了maincf_multi::mailling_list_mysql方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: build_virtual_alias_maps
function build_virtual_alias_maps()
{
$main = new maincf_multi("master", "master");
$ldap = new clladp();
if ($GLOBALS["DEBUG"]) {
echo __FUNCTION__ . " -> virtual_alias_maps=" . count($GLOBALS["virtual_alias_maps"]) . " entries\n";
}
if (is_array($GLOBALS["virtual_alias_maps_emailing"])) {
echo "Starting......: " . date("H:i:s") . " Postfix [" . __LINE__ . "] " . count($GLOBALS["virtual_alias_maps_emailing"]) . " distribution listes\n";
while (list($num, $ligne) = each($GLOBALS["virtual_alias_maps_emailing"])) {
$num = trim($num);
$num = str_replace("\r", "", $num);
$num = str_replace("\n", "", $num);
if ($GLOBALS["VERBOSE"]) {
echo "FINAL -> {$num}/\"{$ligne}\"\n";
}
if ($ligne == null) {
continue;
}
$final[] = $ligne;
}
}
//-----------------------------------------------------------------------------------
if (is_array($GLOBALS["virtual_alias_maps"])) {
echo "Starting......: " . date("H:i:s") . " Cleaning virtual aliase(s)\n";
while (list($num, $ligne) = each($GLOBALS["virtual_alias_maps"])) {
$ligne = trim($ligne);
$ligne = str_replace("\r", "", $ligne);
$ligne = str_replace("\n", "", $ligne);
if ($ligne == null) {
continue;
}
if (preg_match("#x500:#", $ligne)) {
continue;
}
if (preg_match("#x400:#", $ligne)) {
continue;
}
$final[] = $ligne;
}
}
//-----------------------------------------------------------------------------------
$dn = "cn=artica_smtp_sync,cn=artica,{$ldap->suffix}";
$filter = "(&(objectClass=InternalRecipients)(cn=*))";
if ($ldap->ExistsDN($dn)) {
$attrs = array("cn");
$hash = $ldap->Ldap_search($dn, $filter, $attrs);
if ($hash["count"] > 0) {
for ($i = 0; $i < $hash["count"]; $i++) {
$email = $hash[$i]["cn"][0];
$email = trim($email);
$email = str_replace("\r", "", $email);
$email = str_replace("\n", "", $email);
if (trim($email) == null) {
continue;
}
$final[] = "{$email}\t{$email}";
}
}
}
//-----------------------------------------------------------------------------------
if (isset($GLOBALS["LDAPDBS"]["virtual_alias_maps"])) {
if (!is_array($GLOBALS["LDAPDBS"]["virtual_alias_maps"])) {
$virtual_alias_maps_cf = $GLOBALS["LDAPDBS"]["virtual_alias_maps"];
}
}
$sock = new sockets();
$MailingListUseLdap = $sock->GET_INFO("MailingListUseLdap");
if (!is_numeric($MailingListUseLdap)) {
$MailingListUseLdap = 0;
}
if ($MailingListUseLdap == 1) {
$virtual_alias_maps_cf[] = "ldap:/etc/postfix/mailinglist.ldap.cf";
mailling_ldap();
}
$sql = "SELECT * FROM postfix_aliases_domains";
$q = new mysql();
$pre = '${1}';
$li = array();
$results = $q->QUERY_SQL($sql, "artica_backup");
while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
$ligne["alias"] = trim($ligne["alias"]);
$ligne["alias"] = strtolower($ligne["alias"]);
$aliases = str_replace(".", "\\.", $ligne["alias"]);
$domain = $ligne["domain"];
$li[] = "/^(.*)@{$aliases}\$/\t{$pre}@{$domain}";
$final[] = "{$ligne["alias"]}\tDOMAIN";
}
$main = new maincf_multi("master", "master");
$virtual_mailing_addr = $main->mailling_list_mysql("master");
if (is_array($virtual_mailing_addr)) {
while (list($num, $ligne) = each($virtual_mailing_addr)) {
$final[] = $ligne;
}
}
echo "Starting......: " . date("H:i:s") . " Postfix " . count($final) . " virtual aliase(s)\n";
echo "Starting......: " . date("H:i:s") . " Postfix " . count($li) . " virtual domain(s) aliases\n";
$virtual_alias_maps_cf[] = "hash:/etc/postfix/virtual";
$virtual_alias_maps_cf[] = "pcre:/etc/postfix/virtual.domains";
if ($GLOBALS["DEBUG"]) {
//.........这里部分代码省略.........