From 7a78ed5e9a2043f977488a782a54525fa8b3b238 Mon Sep 17 00:00:00 2001 From: udera Date: Fri, 24 Nov 2017 23:35:48 +0000 Subject: [PATCH 1/2] Do not allow to delete postmaster account --- vexim/adminuser.php | 20 ++++++++++++-------- vexim/adminuserdelete.php | 10 ++++++++-- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/vexim/adminuser.php b/vexim/adminuser.php index 517887ac..13c9baa9 100644 --- a/vexim/adminuser.php +++ b/vexim/adminuser.php @@ -89,14 +89,18 @@ $sth->execute($queryParams); while ($row = $sth->fetch()) { if($row['enabled']==="0") print ''; else print ''; - print ''; - print 'trashcan'; + print ''; + if($row['localpart']!=='postmaster') { + print ''; + print 'trashcan'; + } + print ''; print 'prepare($query); -$sth->execute(array(':user_id'=>$_GET['user_id'], ':domain_id'=>$_SESSION['domain_id'])); +$sth->execute(array(':user_id'=>$_GET['user_id'], ':domain_id'=>$_SESSION['domain_id'], ':localpart'=>$_GET['localpart'])); if (!$sth->rowCount()) { header ("Location: adminuser.php?faildeleted={$_GET['localpart']}"); die(); From 7879e6887fd11d95598874508148f0281ff2e99c Mon Sep 17 00:00:00 2001 From: udera Date: Fri, 24 Nov 2017 23:59:47 +0000 Subject: [PATCH 2/2] Send postmaster mails to admin account(s) if postmaster does not exist --- docs/configure | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/configure b/docs/configure index 065212b2..0f809780 100644 --- a/docs/configure +++ b/docs/configure @@ -833,6 +833,19 @@ virtual_domain_alias: and domainalias.domain_id = domains.domain_id}} retry_use_local_part +# Fallback in case a postmaster account does not exist. Send mail to admin +# accounts of the domain +virtual_postmaster_fallback: + driver = redirect + allow_fail + data = ${lookup mysql{select username from users,domains where admin=1 \ + and domain = '${quote_mysql:$domain}' \ + and users.domain_id = domains.domain_id}} + retry_use_local_part + file_transport = virtual_delivery + reply_transport = address_reply + pipe_transport = address_pipe_catchall + # This router handles aliasing using a linearly searched alias file with the # name /etc/aliases. When this configuration is installed automatically,