Merge remote-tracking branch 'florian030/master'
Conflicts:
install/sql/incremental/upd_0073.sql
install/sql/ispconfig3.sql
| | |
| | | $this->dataRecord["server_id"] = $soa["server_id"]; |
| | | |
| | | // add dkim-settings to the public-key in the txt-record |
| | | if (!empty($this->dataRecord['data'])) $this->dataRecord['data']='v=DKIM1; t=s; p='.$this->dataRecord['data']; |
| | | $this->dataRecord['name']='default._domainkey.'.$this->dataRecord['name']; |
| | | |
| | | if (!empty($this->dataRecord['data'])) { |
| | | $this->dataRecord['data']='v=DKIM1; t=s; p='.$this->dataRecord['data']; |
| | | $this->dataRecord['name']=$this->dataRecord['selector'].'._domainkey.'.$this->dataRecord['name']; |
| | | } |
| | | // Update the serial number and timestamp of the RR record |
| | | $soa = $app->db->queryOneRecord("SELECT serial FROM dns_rr WHERE id = ?", $this->id); |
| | | $this->dataRecord["serial"] = $app->validate_dns->increase_serial($soa["serial"]); |
| | |
| | | $check=$app->db->queryOneRecord("SELECT * FROM dns_rr WHERE zone = ? AND type = ? AND data = ? AND name = ?", $this->dataRecord['zone'], $this->dataRecord['type'], $this->dataRecord['data'], $this->dataRecord['name']); |
| | | if ($check!='') $app->tform->errorMessage .= $app->tform->wordbook["record_exists_txt"]; |
| | | if (empty($this->dataRecord['data'])) $app->tform->errorMessage .= $app->tform->wordbook["dkim_disabled_txt"]; |
| | | |
| | | parent::onSubmit(); |
| | | } |
| | | |
| | |
| | | return $vars; |
| | | } |
| | | |
| | | /** |
| | | * This function formats the public-key |
| | | * @param array $pubkey |
| | | * @return string public-key |
| | | */ |
| | | function pub_key($pubkey) { |
| | | $public_key=''; |
| | | foreach($pubkey as $values) $public_key=$public_key.$values; |
| | | return $public_key; |
| | | } |
| | | |
| | | $_POST=getRealPost(); |
| | | |
| | | if (ctype_digit($_POST['zone'])) { |
| | | // Get the parent soa record of the domain |
| | | $soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ? AND ".$app->tform->getAuthSQL('r'), $_POST['zone']); |
| | | $soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ? and ?'", $app->db->quote($_POST['zone']), $app->tform->getAuthSQL('r')); |
| | | |
| | | $public_key=$app->db->queryOneRecord("SELECT dkim_public FROM mail_domain WHERE domain = ? AND dkim = 'Y' AND ".$app->tform->getAuthSQL('r'), substr_replace($soa['origin'],'',-1)); |
| | | |
| | | $public_key=pub_key($public_key); |
| | | |
| | | $public_key=str_replace(array('-----BEGIN PUBLIC KEY-----','-----END PUBLIC KEY-----',"\r","\n"),'',$public_key); |
| | | $sql=$app->db->queryOneRecord("SELECT dkim_public, dkim_selector FROM mail_domain WHERE domain = ? AND dkim = 'Y' AND ?", substr_replace($soa['origin'],'',-1), $app->tform->getAuthSQL('r')); |
| | | $public_key=str_replace(array('-----BEGIN PUBLIC KEY-----','-----END PUBLIC KEY-----',"\r","\n"),'',$sql['dkim_public']); |
| | | |
| | | echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"; |
| | | echo "<formatname>\n"; |
| | | echo "<data>".$public_key."</data>\n"; |
| | | echo "<name>".$soa['origin']."</name>\n"; |
| | | echo "<selector>".$sql['dkim_selector']."</selector>\n"; |
| | | echo "</formatname>\n"; |
| | | } |
| | | ?> |
| | |
| | | if($_POST['ns2'] != '') $tpl_content = str_replace('{NS2}', $_POST['ns2'], $tpl_content); |
| | | if($_POST['email'] != '') $tpl_content = str_replace('{EMAIL}', $_POST['email'], $tpl_content); |
| | | if(isset($_POST['dkim']) && preg_match('/^[\w\.\-\/]{2,255}\.[a-zA-Z0-9\-]{2,30}[\.]{0,1}$/', $_POST['domain'])) { |
| | | $public_key=$app->db->queryOneRecord("SELECT dkim_public FROM mail_domain WHERE domain = ? AND dkim = 'y' AND ".$app->tform->getAuthSQL('r'), $_POST['domain']); |
| | | $sql = $app->db->queryOneRecord("SELECT dkim_public, dkim_selecotr FROM mail_domain WHERE domain = ? AND dkim = 'y' AND ".$app->tform->getAuthSQL('r'), $_POST['domain']); |
| | | $public_key = $sql['dkim_public']; |
| | | if ($public_key!='') { |
| | | $dns_record=str_replace(array("\r\n", "\n", "\r", "-----BEGIN PUBLIC KEY-----", "-----END PUBLIC KEY-----"), '', $public_key['dkim_public']); |
| | | $tpl_content .= "\n".'TXT|default._domainkey.'.$_POST['domain'].'.|v=DKIM1; t=s; p='.$dns_record; |
| | | if (empty($sql['dkim_selector'])) $sql['dkim_selector'] = 'default'; |
| | | $dns_record=str_replace(array("\r\n", "\n", "\r", "-----BEGIN PUBLIC KEY-----", "-----END PUBLIC KEY-----"), '', $public_key); |
| | | $tpl_content .= "\n".'TXT|'.$sql['dkim_selector'].'._domainkey.'.$_POST['domain'].'.|v=DKIM1; t=s; p='.$dns_record; |
| | | } |
| | | } |
| | | |
| | |
| | | $wb['limit_dns_record_txt'] = 'The max. number of DNS records for your account is reached.'; |
| | | $wb['no_zone_perm'] = 'You do not have the permission to add a record to this DNS zone.'; |
| | | $wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.'; |
| | | $wb['selector_txt'] = 'DKIM-Selector'; |
| | | ?> |
| | |
| | | $wb['limit_dns_record_txt'] = 'The max. number of DNS records for your account is reached.'; |
| | | $wb['no_zone_perm'] = 'You do not have the permission to add a record to this DNS zone.'; |
| | | $wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.'; |
| | | $wb['selector_txt'] = 'DKIM-Selector'; |
| | | ?> |
| | |
| | | $wb['limit_dns_record_txt'] = 'The max. number of DNS records for your account is reached.'; |
| | | $wb['no_zone_perm'] = 'You do not have the permission to add a record to this DNS zone.'; |
| | | $wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.'; |
| | | $wb['selector_txt'] = 'DKIM-Selector'; |
| | | ?> |
| | |
| | | $wb['limit_dns_record_txt'] = 'The max. number of DNS records for your account is reached.'; |
| | | $wb['no_zone_perm'] = 'You do not have the permission to add a record to this DNS zone.'; |
| | | $wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.'; |
| | | $wb['selector_txt'] = 'DKIM-Selector'; |
| | | ?> |
| | |
| | | $wb["limit_dns_record_txt"] = 'Die max. Anzahl von DNS Eintraegen fuer den Account ist erreicht.'; |
| | | $wb["no_zone_perm"] = 'Fehlende Berechtigung zum Hinzufuegen eines Eintrags zur DNS-Zone.'; |
| | | $wb['ttl_range_error'] = 'Min. TTL time ist 60 Sekunden.'; |
| | | $wb['selector_txt'] = 'DKIM-Selector'; |
| | | ?> |
| | |
| | | $wb["limit_dns_record_txt"] = 'The max. number of DNS records for your account is reached.'; |
| | | $wb["no_zone_perm"] = 'You do not have the permission to add a record to this DNS zone.'; |
| | | $wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.'; |
| | | $wb['selector_txt'] = 'DKIM-Selector'; |
| | | ?> |
| | |
| | | $wb['limit_dns_record_txt'] = 'The max. number of DNS records for your account is reached.'; |
| | | $wb['no_zone_perm'] = 'You do not have the permission to add a record to this DNS zone.'; |
| | | $wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.'; |
| | | $wb['selector_txt'] = 'DKIM-Selector'; |
| | | ?> |
| | |
| | | $wb['limit_dns_record_txt'] = 'The max. number of DNS records for your account is reached.'; |
| | | $wb['no_zone_perm'] = 'You do not have the permission to add a record to this DNS zone.'; |
| | | $wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.'; |
| | | $wb['selector_txt'] = 'DKIM-Selector'; |
| | | ?> |
| | |
| | | $wb["limit_dns_record_txt"] = 'Le nombre max. d\'enregistrement DNS pour votre compte à été atteint.'; |
| | | $wb["no_zone_perm"] = 'Vous n\'avez pas la permission d\'ajouter un enregistrement à cette Zone DNS.'; |
| | | $wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.'; |
| | | $wb['selector_txt'] = 'DKIM-Selector'; |
| | | ?> |
| | |
| | | $wb['limit_dns_record_txt'] = 'The max. number of DNS records for your account is reached.'; |
| | | $wb['no_zone_perm'] = 'You do not have the permission to add a record to this DNS zone.'; |
| | | $wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.'; |
| | | $wb['selector_txt'] = 'DKIM-Selector'; |
| | | ?> |
| | |
| | | $wb['limit_dns_record_txt'] = 'The max. number of DNS records for your account is reached.'; |
| | | $wb['no_zone_perm'] = 'You do not have the permission to add a record to this DNS zone.'; |
| | | $wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.'; |
| | | $wb['selector_txt'] = 'DKIM-Selector'; |
| | | ?> |
| | |
| | | $wb['limit_dns_record_txt'] = 'The max. number of DNS records for your account is reached.'; |
| | | $wb['no_zone_perm'] = 'You do not have the permission to add a record to this DNS zone.'; |
| | | $wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.'; |
| | | $wb['selector_txt'] = 'DKIM-Selector'; |
| | | ?> |
| | |
| | | $wb['limit_dns_record_txt'] = 'The max. number of DNS records for your account is reached.'; |
| | | $wb['no_zone_perm'] = 'You do not have the permission to add a record to this DNS zone.'; |
| | | $wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.'; |
| | | $wb['selector_txt'] = 'DKIM-Selector'; |
| | | ?> |
| | |
| | | $wb['limit_dns_record_txt'] = 'The max. number of DNS records for your account is reached.'; |
| | | $wb['no_zone_perm'] = 'You do not have the permission to add a record to this DNS zone.'; |
| | | $wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.'; |
| | | $wb['selector_txt'] = 'DKIM-Selector'; |
| | | ?> |
| | |
| | | $wb['limit_dns_record_txt'] = 'The max. number of DNS records for your account is reached.'; |
| | | $wb['no_zone_perm'] = 'You do not have the permission to add a record to this DNS zone.'; |
| | | $wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.'; |
| | | $wb['selector_txt'] = 'DKIM-Selector'; |
| | | ?> |
| | |
| | | $wb['limit_dns_record_txt'] = 'The max. number of DNS records for your account is reached.'; |
| | | $wb['no_zone_perm'] = 'You do not have the permission to add a record to this DNS zone.'; |
| | | $wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.'; |
| | | $wb['selector_txt'] = 'DKIM-Selector'; |
| | | ?> |
| | |
| | | $wb['limit_dns_record_txt'] = 'The max. number of DNS records for your account is reached.'; |
| | | $wb['no_zone_perm'] = 'You do not have the permission to add a record to this DNS zone.'; |
| | | $wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.'; |
| | | $wb['selector_txt'] = 'DKIM-Selector'; |
| | | ?> |
| | |
| | | $wb['limit_dns_record_txt'] = 'The max. number of DNS records for your account is reached.'; |
| | | $wb['no_zone_perm'] = 'You do not have the permission to add a record to this DNS zone.'; |
| | | $wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.'; |
| | | $wb['selector_txt'] = 'DKIM-Selector'; |
| | | ?> |
| | |
| | | $wb['limit_dns_record_txt'] = 'The max. number of DNS records for your account is reached.'; |
| | | $wb['no_zone_perm'] = 'You do not have the permission to add a record to this DNS zone.'; |
| | | $wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.'; |
| | | $wb['selector_txt'] = 'DKIM-Selector'; |
| | | ?> |
| | |
| | | <fieldset class="inlineLabels"> |
| | | <div class="ctrlHolder"> |
| | | <label for="data">{tmpl_var name='public_key_txt'}</label> |
| | | <textarea name="data" id="data" readonly>{tmpl_var name='public_key'}</textarea> |
| | | <textarea name="data" id="data" >{tmpl_var name='public_key'}</textarea> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="selector">{tmpl_var name='selector_txt'}</label> |
| | | <input name="selector" id="selector" value="{tmpl_var name='selector'}" size="20" maxlength="63" type="text" class="textInput" /> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="ttl">{tmpl_var name='ttl_txt'}</label> |
| | | <input name="ttl" id="ttl" value="{tmpl_var name='ttl'}" size="10" maxlength="10" type="text" class="textInput" /> |
| | |
| | | else { |
| | | document.getElementsByName('data')[0].value = request.responseXML.getElementsByTagName('data')[0].firstChild.nodeValue; |
| | | document.getElementsByName('name')[0].value = request.responseXML.getElementsByTagName('name')[0].firstChild.nodeValue; |
| | | document.getElementsByName('selector')[0].value = request.responseXML.getElementsByTagName('selector')[0].firstChild.nodeValue; |
| | | } |
| | | break; |
| | | default: |
| | |
| | | 'cols' => '30', |
| | | 'rows' => '10' |
| | | ), |
| | | 'dkim_selector' => array ( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'TEXT', |
| | | 'default' => 'default', |
| | | 'value' => 'default', |
| | | 'width' => '20', |
| | | 'maxlength' => '63', |
| | | 'validators' => array ( 0 => array ( 'type' => 'REGEX', |
| | | 'regex' => '/^[a-z0-9]{0,63}$/', |
| | | 'errmsg'=> 'dkim_selector_error'), |
| | | ), |
| | | ), |
| | | 'active' => array ( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'CHECKBOX', |
| | |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | ?> |
| | |
| | | $wb["dkim_public_txt"] = 'DKIM Public-key\nfor information only'; |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['policy_txt'] = 'Спамфилтър'; |
| | | $wb['no_policy'] = '- не е разрешен -'; |
| | |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | ?> |
| | |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | $wb['policy_txt'] = 'Spamový filtr'; |
| | | $wb['no_policy'] = '- nepovoleno -'; |
| | | ?> |
| | |
| | | $wb['limit_maildomain_txt'] = 'Die maximale Anzahl an E-Mail Domains für Ihr Konto wurde erreicht.'; |
| | | $wb['policy_txt'] = 'Spamfilter'; |
| | | $wb['no_policy'] = '- nicht aktiviert -'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Ungültiger DKIM-Selector. Verwenden Sie nur alphanumerische Zeichen (a-z oder 0-9)'; |
| | | ?> |
| | |
| | | $wb["policy_txt"] = 'Spamfilter'; |
| | | $wb["no_policy"] = '- not enabled -'; |
| | | $wb['error_not_allowed_server_id'] = 'Chosen server is not allowed for this account.'; |
| | | ?> |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | ?> |
| | |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | ?> |
| | |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | ?> |
| | |
| | | $wb['policy_txt'] = 'Filtre antispam'; |
| | | $wb['no_policy'] = '- inactif -'; |
| | | $wb['error_not_allowed_server_id'] = 'Le serveur choisi n\'est pas autorisé pour ce compte.'; |
| | | ?> |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | ?> |
| | |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | ?> |
| | |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | ?> |
| | |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | ?> |
| | |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | ?> |
| | |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | ?> |
| | |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | ?> |
| | |
| | | $wb['limit_maildomain_txt'] = 'O número máximo de contas de correio eletrônico para este domínio foi atingido.'; |
| | | $wb['policy_txt'] = 'Filtro Anti-Spam'; |
| | | $wb['no_policy'] = '- desactivado -'; |
| | | $wb["dkim_txt"] = 'enable DKIM'; |
| | | $wb["dkim_private_txt"] = 'DKIM Private-key'; |
| | | $wb["dkim_public_txt"] = 'DKIM Public-key\nfor information only'; |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | ?> |
| | |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | ?> |
| | |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | ?> |
| | |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | |
| | | $wb['policy_txt'] = 'Spamfilter'; |
| | | $wb['no_policy'] = '- Nie je aktivovaný -'; |
| | | ?> |
| | |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | ?> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="dkim_selector">{tmpl_var name='dkim_selector_txt'}</label> |
| | | <input name="dkim_selector" id="dkim_selector" value="{tmpl_var name='dkim_selector'}" size="20" maxlength="63" type="text" class="textInput" /> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="dkim_private">{tmpl_var name='dkim_private_txt'}</label> |
| | | <textarea name="dkim_private" id="dkim_private" rows='10' cols='30'>{tmpl_var name='dkim_private'}</textarea> |
| | | <a href="javascript:setRequest('create','{tmpl_var name='domain'}')">{tmpl_var name='dkim_generate_txt'}</a> |
| | |
| | | * This function adds the entry to the amavisd-config |
| | | * @param string $key_domain mail-domain |
| | | */ |
| | | function add_to_amavis($key_domain) { |
| | | function add_to_amavis($key_domain, $selector, $old_selector) { |
| | | global $app, $mail_config; |
| | | |
| | | if (empty($selector)) $selector = 'default'; |
| | | $restart = false; |
| | | $selector = 'default'; |
| | | $amavis_configfile = $this->get_amavis_config(); |
| | | |
| | | $search_regex = "/(\n|\r)?dkim_key\(\'".$key_domain."\',\ \'(".$selector."|".$old_selector."){1}?\'.*/"; |
| | | |
| | | //* If we are using seperate config-files with amavis remove existing keys from 50-user to avoid duplicate keys |
| | | if (substr_compare($amavis_configfile, '60-dkim', -7) === 0) { |
| | | $temp_configfile = str_replace('60-dkim', '50-user', $amavis_configfile); |
| | | $temp_config = file_get_contents($temp_configfile); |
| | | if (preg_match("/(\n|\r)?dkim_key.*".$key_domain.".*/", $temp_config)) { |
| | | $temp_config = preg_replace("/(\n|\r)?dkim_key.*".$key_domain.".*(\n|\r)?/", '', $temp_config)."\n"; |
| | | if (preg_match($search_regex, $temp_config)) { |
| | | $temp_config = preg_replace($search_regex, '', $temp_config)."\n"; |
| | | file_put_contents($temp_configfile, $temp_config); |
| | | } |
| | | unset($temp_configfile); |
| | |
| | | |
| | | $key_value="dkim_key('".$key_domain."', '".$selector."', '".$mail_config['dkim_path']."/".$key_domain.".private');\n"; |
| | | $amavis_config = file_get_contents($amavis_configfile); |
| | | $amavis_config = preg_replace("/(\n|\r)?dkim_key.*".$key_domain.".*/", '', $amavis_config).$key_value; |
| | | $amavis_config = preg_replace($search_regex, '', $amavis_config).$key_value; |
| | | |
| | | if (file_put_contents($amavis_configfile, $amavis_config)) { |
| | | $app->log('Adding DKIM Private-key to amavis-config.', LOGLEVEL_DEBUG); |
| | |
| | | $amavis_configfile = $this->get_amavis_config(); |
| | | $amavis_config = file_get_contents($amavis_configfile); |
| | | |
| | | if (preg_match("/(\n|\r)?dkim_key.*".$key_domain.".*/", $amavis_config)) { |
| | | $amavis_config = preg_replace("/(\n|\r)?dkim_key.*".$key_domain.".*(\n|\r)?/", '', $amavis_config); |
| | | $search_regex = "/(\n|\r)?dkim_key.*".$key_domain.".*(\n|\r)?/"; |
| | | |
| | | if (preg_match($search_regex, $amavis_config)) { |
| | | $amavis_config = preg_replace($search_regex, '', $amavis_config); |
| | | file_put_contents($amavis_configfile, $amavis_config); |
| | | $app->log('Deleted the DKIM settings from amavis-config for '.$key_domain.'.', LOGLEVEL_DEBUG); |
| | | $restart = true; |
| | |
| | | if (substr_compare($amavis_configfile, '60-dkim', -7) === 0) { |
| | | $temp_configfile = str_replace('60-dkim', '50-user', $amavis_configfile); |
| | | $temp_config = file_get_contents($temp_configfile); |
| | | if (preg_match("/(\n|\r)?dkim_key.*".$key_domain.".*/", $temp_config)) { |
| | | $temp_config = preg_replace("/dkim_key.*".$key_domain.".*/", '', $temp_config); |
| | | if (preg_match($search_regex, $temp_config)) { |
| | | $temp_config = preg_replace($search_regex, '', $temp_config); |
| | | file_put_contents($temp_configfile, $temp_config); |
| | | $restart = true; |
| | | } |
| | |
| | | if ( substr($mail_config['dkim_path'], strlen($mail_config['dkim_path'])-1) == '/' ) |
| | | $mail_config['dkim_path'] = substr($mail_config['dkim_path'], 0, strlen($mail_config['dkim_path'])-1); |
| | | if ($this->write_dkim_key($mail_config['dkim_path']."/".$data['new']['domain'], $data['new']['dkim_private'], $data['new']['domain'])) { |
| | | if ($this->add_to_amavis($data['new']['domain'])) { |
| | | if ($this->add_to_amavis($data['new']['domain'], $data['new']['dkim_selector'], $data['old']['dkim_selector'] )) { |
| | | $this->restart_amavis(); |
| | | } else { |
| | | $this->remove_dkim_key($mail_config['dkim_path']."/".$data['new']['domain'], $data['new']['domain']); |
| | |
| | | } else { |
| | | $app->log('Error saving the DKIM Private-key for '.$data['new']['domain'].' - DKIM is not enabled for the domain.', LOGLEVEL_ERROR); |
| | | } |
| | | } |
| | | else { |
| | | $app->log('DKIM for '.$data['new']['domain'].' not written to disk - domain is inactive', LOGLEVEL_DEBUG); |
| | | } |
| | | } |
| | | |
| | |
| | | if ($data['new']['dkim_private'] != $data['old']['dkim_private'] && $data['new']['dkim'] == 'y') { |
| | | $this->add_dkim($data); |
| | | } |
| | | /* new selector */ |
| | | if ($data['new']['dkim_selector'] != $data['old']['dkim_selector'] && $data['new']['dkim'] == 'y') { |
| | | $this->add_dkim($data); |
| | | } |
| | | /* new domain-name */ |
| | | if ($data['new']['domain'] != $data['old']['domain']) { |
| | | $this->remove_dkim($data['old']); |