Complete rewrite of mailinaboxctl with comprehensive features: Container Management: - install, check, update, status, logs, shell commands - Better prerequisite checking and Docker integration Email Account Management: - user-add/del/list/passwd for email accounts - alias-add/del/list for email aliases - Uses docker-mailserver setup command Domain & SSL: - domain-add/list for virtual domains - ssl-status/renew for certificate management - Let's Encrypt integration Backup & Restore: - Full backup with automatic container stop - Restore with confirmation prompt Diagnostics: - health: comprehensive health check - dns-check: verify MX, SPF, DMARC records - ports: check listening ports - config: show current configuration - test-email: send test message Updated configuration with: - Separate hostname and domain options - Feature flags for ClamAV, SpamAssassin, Fail2ban, POP3 - SSL type selection (letsencrypt, manual, self-signed) - Complete port mapping options Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
43 lines
728 B
Bash
Executable File
43 lines
728 B
Bash
Executable File
#!/bin/sh /etc/rc.common
|
|
|
|
START=95
|
|
STOP=10
|
|
USE_PROCD=1
|
|
|
|
EXTRA_COMMANDS="status"
|
|
EXTRA_HELP=" status Show mail server status"
|
|
|
|
SERVICE_BIN="/usr/sbin/mailinaboxctl"
|
|
|
|
start_service() {
|
|
local enabled
|
|
config_load mailinabox
|
|
config_get enabled main enabled 0
|
|
|
|
[ "$enabled" != "1" ] && {
|
|
echo "Mail server is disabled. Enable with: uci set mailinabox.main.enabled=1"
|
|
return 0
|
|
}
|
|
|
|
procd_open_instance
|
|
procd_set_param command "$SERVICE_BIN" service-run
|
|
procd_set_param respawn 3600 5 5
|
|
procd_set_param stdout 1
|
|
procd_set_param stderr 1
|
|
procd_close_instance
|
|
}
|
|
|
|
stop_service() {
|
|
"$SERVICE_BIN" service-stop >/dev/null 2>&1
|
|
}
|
|
|
|
restart_service() {
|
|
stop_service
|
|
sleep 2
|
|
start_service
|
|
}
|
|
|
|
status() {
|
|
"$SERVICE_BIN" status
|
|
}
|