Vboxadm

Aus crazylinux.de
Version vom 10. November 2015, 20:44 Uhr von Jonathan (Diskussion | Beiträge) (dmarc report/cleanup added)
Zur Navigation springen Zur Suche springen

VBoxAdm is a web based management GUI for Mailservers running e.g. Postfix and Dovecot. http://www.vboxadm.net



DMARC-Report/cleanup

vboxadm can read dmarc-report-mails automatically. Reports are under "Admin-Tools" -> DMARC Reports
for dmarc you need an dns entry (with rua), see here
cleanup will delete mailboxes from disk if they are deleted from database

#/etc/cron.d/vboxadm-cgi
#
# Regular cron jobs for the vboxadm-cgi package
#
0 4     * * *   root    [ -x /usr/lib/vboxadm/bin/cleanup ] && /usr/lib/vboxadm/bin/cleanup
0 4 * * *  vboxadm [ -x /usr/lib/vboxadm/bin/dmarc ] && /usr/lib/vboxadm/bin/dmarc


#/etc/vboxadm/vboxadm.conf
[dmarc]
#username
username = dmarc-report@domain.com
password = XXX

#autoclean deleted mailboxes and/or mails
[cleanup]
purge_mailboxes = 1
#purge_mails
loglevel=99
nsloglevel=99
dry=1

Patches/Info/Changes

Postfix wrong config parameter

in /etc/postfix/main.cf change address_verify_maps to address_verify_map

Ubuntu: package required

install package libcgi-application-plugin-authentication-perl

change maildir to /srv/vmail (not /var/vmail)

#/etc/dovecot/dovecot-sql.conf

user_query = /* dovecot-sql.conf user_query */ \
        SELECT '/srv/vmail/%d/%n' AS home,...

password_query = /* dovecot-sql.conf password_query */ \
        SELECT '/srv/vmail/%d/%n' AS userdb_home,...

add systemuser vmail with uid=150 and gid=150

adduser --uid 150 --gid=150 --system --home /srv/vmail --no-create-home --group --disabled-password vmail (untested!!)

or you will have to change uids/gids in /etc/dovecot/dovecot-sql.conf and /etc/dovecot/conf.d/10-mail.conf

dovecot: Error userdb lookup

Sep 23 21:06:37 server dovecot: lda: Error: userdb lookup: connect(/var/run/dovecot/auth-userdb) failed: Permission denied (euid=112(vmail) egid=119(vmail) missing +r perm: /var/run/dovecot/auth-userdb, UNIX perms appear ok (ACL/MAC wrong?))


Solution:

#/etc/postfix/main.cf
#see http://wiki2.dovecot.org/LDA#multipleuids
virtual_transport = lmtp:unix:private/dovecot-lmtp

Run vboxadm in a sub-dir

# url of script is /member/cgi-bin/vboxadm.pl
# css, images... are in /member/vboxadm

        ScriptAlias /member/cgi-bin/ /var/lib/vboxadm/cgi-bin/
        Alias /member/vboxadm/icons/fffsilk/ /usr/share/icons/famfamfam/silk/
        Alias /member/vboxadm /var/lib/vwebadm/htdocs/

        <Directory "/var/lib/vboxadm/cgi-bin/">
                AllowOverride AuthConfig
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        <Directory "/usr/share/icons/famfamfam/silk/">
                Order allow,deny
                Allow from all
        </Directory>

        <Directory "/var/lib/vwebadm/htdocs">
                Order allow,deny
                Allow from all
        </Directory>

and the config

#/etc/vboxadm/vboxadm.conf
# config for webfrontend

[cgi]
base_url=/member/cgi-bin/vboxadm.pl
media_prefix=/member/vboxadm

vboxadm-sa

exclude 'access denied' from /etc/cron.d/vboxadm-sa

# Remove any spamassasin temp files which are older than one hour
# exclude error message access denied
0 *     * * *   vboxadm         find /tmp -name ".spamassassin.*" ! -name lost+found -mmin +60 -exec rm {} \; 2>/dev/null

vboxadm-sa logging

in /usr/share/perl5/VBoxAdm/SMTP/Proxy/SA.pm

change all level = 'notice' to level='info' - didn't help. Still searching...


Ignore lower/upper characters in email addresses

The current configuration treated upper and lower characters in email addresses which is really bad. You don't want different maildirs for e.g. INFO@domain.de, inFo@domain.de or info@DOMAIN.de ;-)

Solution found on http://wiki2.dovecot.org/Variables. Use a 'L'.

#/etc/dovecot/dovecot-sql.conf

user_query = /* dovecot-sql.conf user_query */ \
        SELECT '/srv/vmail/%Ld/%Ln' AS home,...

password_query = /* dovecot-sql.conf password_query */ \
        SELECT '/srv/vmail/%Ld/%Ln' AS userdb_home,...

Links