diff --git a/docs/configure b/docs/configure index 121d0b9..4fc2856 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, diff --git a/vexim/adminuser.php b/vexim/adminuser.php index bc123d9..2bfb7b5 100644 --- a/vexim/adminuser.php +++ b/vexim/adminuser.php @@ -90,14 +90,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();