feat: domains, transports, logs, quarantine, spam filter, i18n + UX fixes
Features added: - Admin > Domains: add domains to Mailcow servers, auto-generate DKIM, display full DNS record set (MX, SPF, DMARC, DKIM, autoconfig CNAMEs) with one-click copy per record - Admin > Transports: manage sender-dependent relay hosts (add/delete) - Admin > Logs: view Postfix, Dovecot, Rspamd, Ratelimit, API and other server logs in a dark scrollable panel - My Account: per-domain Quarantine panel — view score, sender, subject, date; permanently delete quarantined messages - My Account: per-mailbox Spam Filter slider (1–15 threshold) saved via API - My Account: Aliases & Forwarders (alias creation doubles as forwarder to any external address) UX fixes: - Quota 0 now displays ∞ (unlimited) in both admin and account views - Admin mailbox action buttons replaced with Dashicon icon buttons (lock, chart-bar, trash) with title tooltips i18n: - load_plugin_textdomain registered on init hook - All user-facing PHP strings wrapped in __() / esc_html__() - Translated strings array passed to account JS via wp_localize_script - woocow-es_ES.po/.mo — Spanish translation - woocow-ro_RO.po/.mo — Romanian translation (with correct plural forms) - English remains the fallback Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -18,7 +18,7 @@ class WooCow_API {
|
||||
|
||||
// ── Core HTTP ────────────────────────────────────────────────────────────
|
||||
|
||||
private function request( string $method, string $endpoint, array $body = [] ): array {
|
||||
public function request( string $method, string $endpoint, array $body = [] ): array {
|
||||
$args = [
|
||||
'method' => strtoupper( $method ),
|
||||
'timeout' => $this->timeout,
|
||||
@@ -145,6 +145,44 @@ class WooCow_API {
|
||||
return $this->request( 'POST', '/api/v1/delete/domain-admin', [ 'items' => [ $username ] ] );
|
||||
}
|
||||
|
||||
// ── DKIM ─────────────────────────────────────────────────────────────────
|
||||
|
||||
public function get_dkim( string $domain ): array {
|
||||
return $this->request( 'GET', '/api/v1/get/dkim/' . rawurlencode( $domain ) );
|
||||
}
|
||||
|
||||
public function generate_dkim( string $domain, string $selector = 'dkim', int $key_size = 2048 ): array {
|
||||
return $this->request( 'POST', '/api/v1/add/dkim', [
|
||||
'domains' => $domain,
|
||||
'dkim_selector' => $selector,
|
||||
'key_size' => $key_size,
|
||||
] );
|
||||
}
|
||||
|
||||
// ── Relayhosts ───────────────────────────────────────────────────────────
|
||||
|
||||
public function get_relayhosts(): array {
|
||||
return $this->request( 'GET', '/api/v1/get/relayhost/all' );
|
||||
}
|
||||
|
||||
public function create_relayhost( array $data ): array {
|
||||
return $this->request( 'POST', '/api/v1/add/relayhost', $data );
|
||||
}
|
||||
|
||||
public function delete_relayhost( int $id ): array {
|
||||
return $this->request( 'POST', '/api/v1/delete/relayhost', [ 'items' => [ $id ] ] );
|
||||
}
|
||||
|
||||
// ── Quarantine ───────────────────────────────────────────────────────────
|
||||
|
||||
public function get_quarantine(): array {
|
||||
return $this->request( 'GET', '/api/v1/get/quarantine/all' );
|
||||
}
|
||||
|
||||
public function delete_quarantine( int $id ): array {
|
||||
return $this->request( 'POST', '/api/v1/delete/quarantine', [ 'items' => [ $id ] ] );
|
||||
}
|
||||
|
||||
// ── Helpers ──────────────────────────────────────────────────────────────
|
||||
|
||||
public function get_webmail_url(): string {
|
||||
|
||||
Reference in New Issue
Block a user