fixing dkim get entry function
This commit is contained in:
parent
e3d2b84418
commit
291812cead
|
@ -1154,7 +1154,7 @@ ORDER BY
|
||||||
add_line_to_file("/etc/opendkim/SigningTable",$domain." alternc._domainkey.".$domain);
|
add_line_to_file("/etc/opendkim/SigningTable",$domain." alternc._domainkey.".$domain);
|
||||||
// Add subdomaine entry
|
// Add subdomaine entry
|
||||||
$dkim_key=$this->dkim_get_entry($domain);
|
$dkim_key=$this->dkim_get_entry($domain);
|
||||||
$db->query("INSERT INTO sub_domaines SET domaine=?, compte=?, sub='', type='dkim', valeur=?;",array($domain,$uid,$dkim_key));
|
$db->query("INSERT INTO sub_domaines SET domaine=?, compte=?, sub='alternc._domainkey', type='dkim', valeur=?;",array($domain,$uid,$dkim_key));
|
||||||
// no need to do DNS_ACTION="UPDATE" => we are in the middle of a HOOK, so dns WILL BE reloaded for this domain
|
// no need to do DNS_ACTION="UPDATE" => we are in the middle of a HOOK, so dns WILL BE reloaded for this domain
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1194,13 +1194,13 @@ ORDER BY
|
||||||
$inkey=false; $result="";
|
$inkey=false; $result="";
|
||||||
$lines=explode("\n",$key);
|
$lines=explode("\n",$key);
|
||||||
foreach($lines as $line) {
|
foreach($lines as $line) {
|
||||||
if (preg_match('#alternc._domainkey IN TXT \( "(.*)"#',$key,$mat)) {
|
if (preg_match('#alternc._domainkey\s+IN\s+TXT\s+\( "(.*)"#',$line,$mat)) {
|
||||||
$result.=$mat[1]; $inkey=true; continue;
|
$result.=$mat[1]; $inkey=true; continue;
|
||||||
}
|
}
|
||||||
if ($inkey && preg_match('# "(.*)" \)#',$key,$mat)) {
|
if ($inkey && preg_match('#^\s*"(.*)"\s*\)#',$line,$mat)) {
|
||||||
$result.=$mat[1]; $inkey=false; break;
|
$result.=$mat[1]; $inkey=false; break;
|
||||||
}
|
}
|
||||||
if ($inkey && preg_match('# "(.*)" #',$key,$mat)) {
|
if ($inkey && preg_match('#^\s*"(.*)"\s*$#',$line,$mat)) {
|
||||||
$result.=$mat[1]; $inkey=true; continue;
|
$result.=$mat[1]; $inkey=true; continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue