|
1 年之前 | |
---|---|---|
alembic | 4 年之前 | |
pizzavolus | 1 年之前 | |
.gitignore | 1 年之前 | |
LICENSE | 4 年之前 | |
README.md | 4 年之前 | |
development.ini | 1 年之前 | |
poetry.lock | 1 年之前 | |
production.ini | 1 年之前 | |
pyproject.toml | 1 年之前 | |
setup.py | 4 年之前 |
PizzaVolus is a web interface to manage virtual mail domains, boxes and aliases for postfix and dovecot.
It can be used to let people register an email address on open domains, and owners of addresses to set or not a redirect and change their own password.
A public instance is hosted by CCrypto : https://mail.ccrypto.org/
Copy a .ini file and edit it. Only PostgreSQL databases are supported for now.
sqlalchemy.url = postgresql+psycopg2://pizza:C1tad3l@127.0.0.1/pizza
Then create the database structure with pv-initdb local.ini
and start a dev server with pserve local.ini
The default admin user is Admin:root, users can be added/modified with pv-user.
For Debian using postfix’s default “Internet Site” configuration
Optional: Create a limited access PostgreSQL role and copy an .ini file to use it:
CREATE ROLE pizza_ro WITH PASSWORD '...';
GRANT SELECT ON addresses, domains TO pizza_ro;
pv-config will make files with SQL details and queries for each server:
pv-config local.ini postfix_domains > /etc/postfix/pg_domains.cf
pv-config local.ini postfix_aliases > /etc/postfix/pg_aliases.cf
pv-config local.ini postfix_mailboxes > /etc/postfix/pg_mailboxes.cf
pv-config local.ini dovecot > /etc/dovecot/dovecot-sql.conf.ext
You also need an user for virtual mail accounts:
groupadd vmail --gid 500
useradd vmail --uid 500 --gid 500 --create-home
Make postfix use that, add in main.cf:
virtual_mailbox_domains = pgsql:/etc/postfix/pg_domains.cf
virtual_alias_maps = pgsql:/etc/postfix/pg_aliases.cf
virtual_mailbox_maps = pgsql:/etc/postfix/pg_mailboxes.cf
virtual_transport = dovecot
virtual_mailbox_base = /home/vmail/
virtual_gid_maps = static:500
virtual_uid_maps = static:500
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
Make sure your virtual domains are not listed in mydestination
.
And in master.cf:
dovecot unix - n n - - pipe
flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop}
For dovecot, enable SQL auth in /etc/dovecot/conf.d/auth-sql.conf.ext:
passdb {
driver = sql
args = /etc/dovecot/dovecot-sql.conf.ext
}
userdb {
driver = static
args = uid=vmail gid=vmail home=/home/vmail/%u
}
/etc/dovecot/conf.d/10-auth.conf, uncomment:
!include auth-sql.conf.ext
/etc/dovecot/conf.d/10-master.conf, find and uncomment this block for SASL auth:
# Postfix smtp-auth
unix_listener /var/spool/postfix/private/auth {
mode = 0666
}
A previous database can be imported as CSV with pv-importcsv: