exclude .onion domains from dkim feature
This commit is contained in:
2 files changed
+12
-10
No files matched your search
+10
-8
@@ -872,6 +872,7 @@ function send_edit_domain(): void
|
|||||||
value="1"<?php echo $admin[ 'active' ] ? ' checked' : ''; ?>><?php echo htmlspecialchars(_('Active')); ?></label>
|
value="1"<?php echo $admin[ 'active' ] ? ' checked' : ''; ?>><?php echo htmlspecialchars(_('Active')); ?></label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<?php if(!str_ends_with( $admin[ 'domain' ], '.onion' )) { ?>
|
||||||
<?php if ( $_SESSION[ 'email_admin_superadmin' ] ) { ?>
|
<?php if ( $_SESSION[ 'email_admin_superadmin' ] ) { ?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col"><?php echo htmlspecialchars(_('DKIM selector')); ?></div>
|
<div class="col"><?php echo htmlspecialchars(_('DKIM selector')); ?></div>
|
||||||
@@ -890,19 +891,20 @@ function send_edit_domain(): void
|
|||||||
<textarea rows="4" readonly><?php echo htmlspecialchars( $public_key === null ? '' : 'v=DKIM1; k=rsa; p=' . $public_key ); ?></textarea>
|
<textarea rows="4" readonly><?php echo htmlspecialchars( $public_key === null ? '' : 'v=DKIM1; k=rsa; p=' . $public_key ); ?></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php }
|
||||||
<div class="row">
|
if ( $_SESSION[ 'email_admin_superadmin' ] ) { ?>
|
||||||
<div class="col">
|
|
||||||
<button name="action" value="save_edit_domain" type="submit"><?php echo htmlspecialchars(_('Save changes')); ?></button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php if ( $_SESSION[ 'email_admin_superadmin' ] ) { ?>
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<button type="submit" name="action" value="confirm_regenerate_dkim_key"><?php echo htmlspecialchars(_('Regenerate DKIM key')); ?></button>
|
<button type="submit" name="action" value="confirm_regenerate_dkim_key"><?php echo htmlspecialchars(_('Regenerate DKIM key')); ?></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php }
|
||||||
|
} ?>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
<button name="action" value="save_edit_domain" type="submit"><?php echo htmlspecialchars(_('Save changes')); ?></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<button type="submit" name="action" value="delete_domain"><?php echo htmlspecialchars(_('Delete domain')); ?></button>
|
<button type="submit" name="action" value="delete_domain"><?php echo htmlspecialchars(_('Delete domain')); ?></button>
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ if ( ! in_array( $_SERVER[ 'REQUEST_METHOD' ], [ 'GET', 'HEAD' ], true ) || ! ha
|
|||||||
$stmt = get_db_instance()->query( "SELECT domain, dkim_key, dkim_selector FROM domain WHERE active = 1 ORDER BY domain;" );
|
$stmt = get_db_instance()->query( "SELECT domain, dkim_key, dkim_selector FROM domain WHERE active = 1 ORDER BY domain;" );
|
||||||
$map_entries = [];
|
$map_entries = [];
|
||||||
while ( $domain = $stmt->fetch( PDO::FETCH_ASSOC ) ) {
|
while ( $domain = $stmt->fetch( PDO::FETCH_ASSOC ) ) {
|
||||||
if(empty($domain['dkim_key'])) {
|
if(empty($domain['dkim_key']) || str_ends_with($domain['domain'], '.onion')) {
|
||||||
continue; // Skip domains without DKIM keys
|
continue; // Skip domains without DKIM keys or onion domains
|
||||||
}
|
}
|
||||||
$ascii_domain = idn_to_ascii( $domain[ 'domain' ], IDNA_NONTRANSITIONAL_TO_ASCII );
|
$ascii_domain = idn_to_ascii( $domain[ 'domain' ], IDNA_NONTRANSITIONAL_TO_ASCII );
|
||||||
$key = get_rsa_dkim_private_key_base64_der( $domain[ 'dkim_key' ] );
|
$key = get_rsa_dkim_private_key_base64_der( $domain[ 'dkim_key' ] );
|
||||||
|
|||||||
Reference in new issue
Block a user