- Inter7's original page
vpopmail
version: 5.4.33- Combined patch v. 2023.08.27
- Changelog
- More info here
- README.vdelivermail
Vpopmail provides an easy way to manage virtual email domains and non /etc/passwd email accounts on your mail servers.
The purpose of this note is to show how to use Mysql
as the authentication system. Having a users database also offers the advantage of communicating with the database via PHP
, and creating web-based user interfaces to manage accounts.
Changelog
- Sep 5, 2023
- changed configuration option--enable-logging=e
(wasp
). Now failed attempts will be logged with no password shown. - Aug 27, 2023
- new combined patch. More info here
* The logic of the defaultdelivery patch/feature has been revised. If configured with--enable-defauldelivery vpopmail
will save control/defauldelivery in the user's .qmail andvdelivermail
LDA in the domain's .qmail-default file. This will achieve multiple benefits: you haveqmail
forwards andsieve
together andvalias
available. Thevalias
table schema was changed as well.
Patch details
The patch we'll apply is the result of the following bunch of patches:
- sql-aliasdomains patch, which makes
vpopmail
save the aliasdomains toMySQL
. This makes thedovecot
sql auth driver aware of the aliasdomains, provided that you modify the sql query as well (see thedovecot
page for more info). - defaultdelivery patch, will copy you favourite delivery agent, stored in QMAILDIR/control/defauldelivery, in the mailbox's .qmail and the
vpopmail
delivery agent in the domain's .qmail-default.
More info here, have also a look to the doc/README.defaultdelivery file. - dovecot-sql-procedures patch
If you want to use thedovecot
's sql auth driver with one table for each domain (--disable-many-domains
) you have to heavily customize your queries to the sql database. With this patchvpopmail
installs the sql procedures and functions in the database when you create a new domain. The procedures can be called bydovecot
to perform the auth.
The sql stuff supports aliasdomains andmysql
limits and will be loaded from ~/vpopmail/etc/disable-many-domains_procedures.sql. You can customize the sql procedure editing this file.
You have to configure with--enable-mysql-bin=PATH
as we have to install the procedures calling themysql
bin as a shell command (no way to load an sql query from a file in C language, comments welcome). - vusaged configure patch
It seems that at least on Debian 11vusaged
refuses to run the configure successfully, as theMySQL
libraries are not linked (configure: error: No vauth_getpw in libvpopmail
). After some inspection, I noticed that avoiding the break of the configure command, the following make command will findlibmysqlclient
and compile with no problems, and the program works as expected.
NB: anautoreconf -f -i
into thevusaged
directory is needed before configuring, as theconfigure.ac
script was modified. - recipient check patch. It can be used with Erwin Hoffmann's s/qmail to accomplish the recipient check. Not important in my installation, look at doc/README.vrcptcheck for more info.
- vuserinfo-D_newline, a cosmetic patch which prints a new line to separate users' infos when typing "vuserinfo -D domain"
- gcc-10-compat patch, which gets vpopmail to compile with
gcc-10
and later versions - A fix to the following issues (patch by Ali Erturk TURKER):
- vdelivermail.c checks spamassassin permissions, instead of maildrop permissions.
-vopen_smtp_relay()
return values corrected, so thatopen_smtp_relay()
can detect and report database connection errors (vmysql.c, voracle.pc, vpgsql.c)
-vdel_limits()
core-dumps if a database connection is not available beforehand. (vmysql.c, voracle.pc)
Setup
Create the vpopmail
user and group. Be aware that the home directory below is going to be the one where vpopmail
will be installed, so you can change it if you want to have vpopmail
elsewhere. You can also decide to assign different uid/gid
to vpopmail, as qmail
will be able to determine them dinamically.
groupadd -g 89 vchkpw useradd -g vchkpw -u 89 -d /home/vpopmail vpopmail
Download the source (original files here: http://sourceforge.net/projects/vpopmail/files/, but you can download my local copy) and configure.
NB you may have to replace --enable-incdir=/usr/include/mysql
with --enable-incdir=/usr/include/mariadb
in Debian
and related.
cd /usr/local/src wget https://notes.sagredo.eu/files/qmail/tar/vpopmail-5.4.33.tar.gz wget https://notes.sagredo.eu/files/qmail/patches/vpopmail/combined_patch/roberto_vpopmail-5.4.33.patch tar xzf vpopmail-5.4.33.tar.gz cd vpopmail-5.4.33 chown -R root:root . patch -p1 < ../roberto_vpopmail-5.4.33.patch autoreconf -f -i ./configure \ --enable-qmaildir=/var/qmail/ \ --enable-qmail-newu=/var/qmail/bin/qmail-newu \ --enable-qmail-inject=/var/qmail/bin/qmail-inject \ --enable-qmail-newmrh=/var/qmail/bin/qmail-newmrh \ --disable-roaming-users \ --enable-auth-module=mysql \ --enable-incdir=/usr/include/mysql \ --enable-libdir=/usr/lib64 \ --enable-logging=e \ --disable-clear-passwd \ --enable-auth-logging \ --enable-sql-logging \ --disable-passwd \ --enable-qmail-ext \ --enable-learn-passwords \ --enable-mysql-limits \ --enable-valias \ --enable-sql-aliasdomains \ --enable-defaultdelivery
--disable-roaming-users
roaming users will be disabled, since we don't want to use POP before SMTP authorization. We will patch qmail
with smtp-authentication
instead.
--enable-auth-module=mysql
builds MySQL
support and stores virtual users accounts into a mysql database.
--enable-incdir=/usr/include/mysql
Your MySQL
include
dir (use just in case you installed mysql from binaries or source in a non standard location. Mount mysql dir somewhere if it is installed in a different machine).
--enable-libdir=/usr/lib64
Your MySQL
lib
dir. Obviously it might be /usr/lib
on 32b systems
--disable-passwd
Don't include /etc/passwd support. I don't want to manage real users, this is just a web server.
--disable-clear-passwd
Clear password will not be saved to database for security reasons. If you don't want to have problems when users forget their passwords and you want to recover them quickly switch this to --enable-clear-passwd
.
--enable-logging=e
Logs failed attempts on syslog (no failed passwords will be shown).
--enable-sql-logging
Maintain the vlog table in MySQL (shows failed authentication requests).
--enable-auth-logging
Maintain a lastauth table in MySQL (shows when / how a user last accessed their email)
--enable-mysql-limits
MySQL stores domain limits instead of .qmailadmin-limits
files.
--enable-qmail-ext
Enable qmail email address extension support (emails containing dots).
--enable-sql-aliasdomains
(default) saves domain aliases to MySQL in order to validate the authentication for domain aliases when using the dovecot
's sql driver, provided that you modify the password_query
accordingly.
--enable-valias
Store aliases in MySQL
--enable-defaultdelivery
installs the delivery agent stored in /var/qmail/control/defaultdelivery
into the .qmail
file of each newly created user and vdelivermail
agent in the .qmail-default
of the newly created domains. More info here.
Compile and install:
make install-strip
vusaged
vusaged
looks up every vpopmail
user and tracks how much storage space they’re using. It requires libev
.
Installing libev
- Download latest version from http://dist.schmorp.de/libev/
cd /usr/local/src wget http://dist.schmorp.de/libev/libev-4.33.tar.gz tar xzvf libev-4.33.tar.gz cd libev-4.33 chown -R root.root . ./configure make make install ldconfig
Installing and configuring vusaged
VPOPMAILDIR=/home/vpopmail cd /usr/local/src/vpopmail-5.4.33/vusaged LIBS=`head -1 $VPOPMAILDIR/etc/lib_deps` ./configure --with-vpopmail=$VPOPMAILDIR make cp -f vusaged ~vpopmail/bin cp -f etc/vusaged.conf ~vpopmail/etc
Troubleshooting
If you get an error like this after the configure command
configure: error: No vauth_getpw in libvpopmail
try to rebuild the configure script in this way:
autoreconf -f -i
and then proceed to configure and compile. I patched the configure.ac
to avoid the break. This is actually a work around. If you solve the library linking error let me know.
Take a look to the discussion in the comments, as Luca suggested a different solution, which didn't solve for me but that I'm suggesting above in this page.
Configuring
Now create your ~vpopmail/etc/tcp.smtp file. This file should list all the static IPs of your machines that you want to allow to relay out to the internet. For example: to allow relaying for localhost and the localnet 10.0.0.x edit your ~vpopmail/etc/tcp.smtp as follows:
10.0.0.:allow,RELAYCLIENT="" 127.:allow,RELAYCLIENT=""
add any other IP later, whenever you want. To give a client relay access, add an entry to ~vpopmail/etc/tcp.smtp like:
IP address of client:allow,RELAYCLIENT=""
Now build the tcp.smtp.cdb. This command must be run every time you modify tcp.smtp
cd ~vpopmail/etc tcprules tcp.smtp.cdb tcp.smtp.tmp < tcp.smtp
Now setup a quota warning that will be delivered to users when they are at 90% quota
# nano ~vpopmail/domains/.quotawarn.msg From: SomeCompany Postmaster <postmaster@yourdomain.com> Reply-To: postmaster@yourdomain.com To: SomeCompany User:; Subject: Mail quota warning Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit Your mailbox on the server is now more than 90% full. So that you can continue to receive mail, you need to remove some messages from your mailbox. If you require assistance with this, please contact our support department : email : support@yourdomain.com Tel : xx xxxx xx
chmod 600 ~vpopmail/domains/.quotawarn.msg chown vpopmail.vchkpw ~vpopmail/domains/.quotawarn.msg
Now adjust ~vpopmail/etc/vlimits.default. I use to limit the default user quota to 100MB (in bytes):
default_quota 104857600
Configuring mysql
back end
Create the vpopmail
user and database. Grant all privileges to the vpopmail
user. Then quit out of MySQL
and save the authentication information for the vpopmail
account into the vpopmail.mysql
config file:
> mysql [-h mysql-IP] -u root -p CREATE USER 'vpopmail'@'mailserver-IP' IDENTIFIED BY 'vpopmailpwd'; GRANT USAGE ON * . * TO 'vpopmail'@'mailserver-IP' IDENTIFIED BY 'vpopmailpwd' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ; CREATE DATABASE IF NOT EXISTS vpopmail; GRANT ALL PRIVILEGES ON `vpopmail` . * TO 'vpopmail'@'mailserver-IP'; > echo "mysql-IP|0|vpopmail|vpopmailpwd|vpopmail" > ~vpopmail/etc/vpopmail.mysql
where mysql-IP
is the IP of the server which runs mysqld
, and mailserver-IP
is the IP address where qmail
is running. Usually you can specify ‘localhost’ or 0.0.0.0 for both.
Creating virtual domains and virtual users
cd ~vpopmail/bin/
To add/delete a virtual domain
./vadddomain yourdomain.net [./vdeldomain yourdomain.net]
To add/delete a virtual user
./vadduser user@yourdomain.net [./vdeluser user@yourdomain.net]
To view information about user email accounts:
./vuserinfo user@yourdomain.net name: user passwd: xxxxxxxxxxxx clear passwd: xxxxxxxxx comment/gecos: Name Surname uid: 0 gid: 0 flags: 0 gecos: Name Surname limits: No user limits set. dir: /home/vpopmail/domains/yourdomain.net/user quota: 104857600S
These commands can be useful. But it will be much easier to manage domains and accounts when we install the vqadmin
and qmailadmin
web interfaces later.
You may be interested to take a look to this page concerning vpopmail
testing.
Domain aliases when using the dovecot
's sql auth driver
If you don't have domain aliases or this is a fresh installation you can skip this step.
If you already have domain aliases and want to switch to the dovecot
's sql auth driver, don't forget to read carefully the page where the vpopmail/dovecot
setup concerning domain aliases is explained, as you'll have to save your existing alias/domains pairs to MySQL
.
In short, you can quickly save all your domain aliases to MySQL in this way
vsavealiasdomains -A
Type
vsavealiasdomains -h
for more options.
The database record will be saved by vpopmail for the new aliases that you will create from now on.
Comments
Using vpopmail with LDAP instead of mysql.
Jeff Maina September 10, 2023 14:25
Hi Roberto, thank you so much for the quide. I've managed to create a full-fledged email server that I can send and receive emails.
However, I've been wondering if have you ever tried using LDAP instead of MySQL. I am trying to create a lab-test that uses LDAP and the options below but I keep getting the error "Segmentation fault (core dumped)"
Reply | Permalink
Using vpopmail with LDAP instead of mysql.
Roberto Puzzanghera Jeff Maina September 10, 2023 15:49
Hi Jeff, no I've never played with LDAP nor with vpopmail nor with qmail.
In this case strace is your friend :-) I'd also disable all additional modules that depends on LDAP (auth-logging valias sql-logging) and add them once you have it working.
Let us know if your LDAP config finally works!
Reply | Permalink
Clear Failed PW in logs
Bobber September 5, 2023 21:27
I'm using vpopmail on Debian. I would still like to see a users password when using vuserinfo but I would like to stop showing failed passwords in the file: /var/log/mail.log. Is this possible without deleting the clear password column in mysql?
Reply | Permalink
Clear Failed PW in logs
Roberto Puzzanghera Bobber September 5, 2023 22:04
It depends on the logging variable at configuration time
I agree with you that the failed passwords shouldn't be shown for security reasons, as we can find there mistypings that are very close to the real passwords. My goal is to log failed attempts so that I can feed fail2ban with them. Maybe we can simply use
if you find a way to log failed attempts with no pwd shown, please let me know
Reply | Permalink
Clear Failed PW in logs
Bob Roberto Puzzanghera September 7, 2023 16:24
It doesn't seem to work for me. Did you drop the clear password column in mysql? I wonder if that is necessary?
Reply | Permalink
Clear Failed PW in logs
Roberto Puzzanghera Bob September 7, 2023 17:10
No, it's not important. Both these tests
and
give the same result. I have this in my syslog when failing the pwd during smtpd conversation
Reply | Permalink
Clear Failed PW in logs
Roberto Puzzanghera Roberto Puzzanghera September 5, 2023 22:13
Yes, I confirm that using
will log the failure with no pwd
I'll change the configuration option in this guide accordingly
Reply | Permalink
... under "Configuring mysql backend" ... when hit the ... mysql -h 192.168.1.108 -u root -p
Johan April 11, 2023 09:36
... When I hit the ... mysql -h 192.168.1.108 -u root -p ... Then the system asking for "Enter password:" ... HowTo know the password ??
grdt.
Reply | Permalink
... under
Roberto Puzzanghera Johan April 11, 2023 11:00
It is the root password that you set when you installed your mysql server
Reply | Permalink
Maybe some typos with quotawarn
Herbert March 17, 2023 13:55
Hi Roberto,
imho you have some typos with the filename for the quotawarn message.
The manual says that the quotawarn.msg file should be with a leading dot --> .quotawarn.msg
"quotawarn.msg:X-Comment: Rename/Copy this file to ~vpopmail/domains/.quotawarn.msg, and make appropriate changes"
Otherwise it was not working with my installation.
And maybe you could change the quotawarn limit from 90% to 80% in maildirquota.h
with your patch because I think 90% is rather late for a warning.
Regards,
Herbert
Reply | Permalink
Maybe some typos with quotawarn
Roberto Puzzanghera Herbert March 17, 2023 14:06
Thank you. Corrected
Reply | Permalink
Sub default-libmysqlclient-dev for libmariadb-dev-compat in ubuntu 22.04
GoofY February 27, 2023 15:30
while trying to install the following:
default-libmysqlclient-dev in Ubuntu 22.04 complains about versioning.
After substituting default-libmysqlclient-dev for libmariadb-dev-compat compiling vpopmail goes without a problem.
Reply | Permalink
Sub default-libmysqlclient-dev for libmariadb-dev-compat in ubuntu 22.04
Roberto Puzzanghera GoofY February 27, 2023 15:35
Thanks for the advise. So Ubuntu is a bit different from Debian 11, where I tested the above recently
Reply | Permalink
Vpopmail minor fixes
Ali Erturk TURKER February 17, 2023 11:03
Hi Roberto
While reviewing vpopmail internals, I came across some bugs which annoyed me. I created a patch to fix those:
1 - vdelivermail.c checks spamassassin permissions, instead of maildrop permissions.
2- vopen_smtp_relay() return values corrected, so that open_smtp_relay() can detect and report database connection errors (vmysql.c, voracle.pc, vpgsql.c )
3- vdel_limits() core-dumps if a database connection is not available beforehand. (vmysql.c, voracle.pc )
The patch will cleanly apply on "vpopmail-5.4.33.tar.gz + vpopmail-5.4.33_gcc-10-compat.patch", since I don't use any other patches.
The fixes are pretty straighforward. Feel free to incorporate them into your "roberto_vpopmail-5.4.33.patch".
Reply | Permalink
vpopmail.c assumes database server to be mysql with non standard mode.
Yasuo Ohgaki September 10, 2022 11:54
I'm using PostgreSQL for database and I noticed vpopmail's SQL escape is not good at all. PostgreSQL(and Oracle) follows ANSI SQL standard string literal. Even MySQL has ANSI_QUOTES mode.
https://dev.mysql.com/doc/refman/8.0/en/string-literals.html
Therefore, vpopmail can be vulnerable to SQL injection. I've requested CVE for this.
This is a quick and dirty patch to disable injections.
This may result in broken string (e.g. pw_clear_passwd), but it much better than injections.
Reply | Permalink
vpopmail.c assumes database server to be mysql with non standard mode.
Roberto Puzzanghera Yasuo Ohgaki September 13, 2022 16:52
Enabling ANSI_QUOTES in mariadb-10.5 throws qmailadmin into a segfault both when entering quotes in any field and when not... Did you try to talk to vpopmail also with qmailadmin?
Edit: vpopmail is unusable. Some examples
Reply | Permalink
SQLite support added to Vpopmail
Bruno Ethvignot March 31, 2022 16:51
Hi,
Patrice who works in my company has added SQLite support to Vpopmail. I am looking for volunteers to test this version. :-) Patrice merged the patches from Roberto and the patches from the FreeBSD port.
The source code is available on GitHub :
https://github.com/brunonymous/vpopmail
You can see the changes made:
https://github.com/brunonymous/vpopmail/blob/main/ChangeLog
Feel free to comment or report bugs.
Bruno
Reply | Permalink
SQLite support added to Vpopmail
Roberto Puzzanghera Bruno Ethvignot March 31, 2022 17:57
Thanks a lot for sharing :-) The changelog seems to be very very interesting
I'll have a look in the following days and test it
PS you may want to add this modification I did a few days ago to vmysql.c, which solves a compilation break on debian 11 / gcc-10
Reply | Permalink
missing file smtp.tmp
Newb July 9, 2021 08:47
im missing file smtp.tmp in directory ~vpopmail/etc/
i think vpopmail didnt installed corretly but i dont get any error :(
any ideas?
Reply | Permalink
missing file smtp.tmp
Roberto Puzzanghera Newb July 9, 2021 10:02
You can create it manually with a plain text editor
Reply | Permalink
Installing and configuring vusaged
Newb July 6, 2021 14:59
from tutorial
command make didnt work
but in folder i have a makefile
Reply | Permalink
Installing and configuring vusaged
Roberto Puzzanghera Newb July 6, 2021 15:07
I think you are in the wrong directory
Reply | Permalink
Installing and configuring vusaged
Newb Roberto Puzzanghera July 7, 2021 10:58
which directory should it be?
mine is /usr/local/src/vpopmail-5.4.33/vusaged
Reply | Permalink
Installing and configuring vusaged
Roberto Puzzanghera Newb July 7, 2021 12:49
It works here... I'd suggest to to download again and recompile
Reply | Permalink
vpopmail issue
Newb July 6, 2021 12:45
Hi
i had a problem when execute
what do i miss?
i installed
mysql-server 8.0
mysql-client 8.0
libmysqlclient-dev
libmysqlclient21
Reply | Permalink
vpopmail issue
Roberto Puzzanghera Newb March 17, 2022 20:08
The new combined patch of today (Mar 17, 2022) should solve this compilation problem
Reply | Permalink
vpopmail issue
Bobber Newb March 16, 2022 16:59
I am having the same problem on Debian Buster. Using this config:
Reply | Permalink
vpopmail issue
Roberto Puzzanghera Bobber March 16, 2022 21:37
Hi, can you post the error you get?
Reply | Permalink
vpopmail issue
Roberto Puzzanghera Bobber March 16, 2022 17:10
did you solve installing the packeges listed below?
Reply | Permalink
vpopmail issue
Anonymous Newb September 2, 2021 15:13
finally I solved as well. My system is ubuntu server 18.04 I've executed:
Reply | Permalink
vpopmail issue
Roberto Puzzanghera Anonymous September 2, 2021 21:13
thank you. The same for me in a debian server where libmysqlclient was missing. Now I added this to the current page
Reply | Permalink
vpopmail issue
carlos Newb September 2, 2021 14:59
I have the same problem, and I tried to recompile vpopmail and re-patch but the error persists
Reply | Permalink
vpopmail issue
Roberto Puzzanghera Newb July 6, 2021 12:56
Hi, can you post your configure command, please?
Reply | Permalink
vpopmail issue
Newb Roberto Puzzanghera July 6, 2021 13:49
Do u mean command ./configure ?
Reply | Permalink
vpopmail issue
Roberto Puzzanghera Newb July 6, 2021 14:01
I saw your configure results. How did you patch vpopmail? Did you get any errors when patching?
Reply | Permalink
vpopmail issue
Newb Roberto Puzzanghera July 6, 2021 14:36
i used command patch -p1 < ../roberto_vpopmail-5.4.33.patch
and resort:
no errors
Reply | Permalink
vpopmail issue
Roberto Puzzanghera Newb July 6, 2021 14:39
I can't reproduce your configure results that you posted before.
Can you post the configure command that you are using, please?
Reply | Permalink
vpopmail issue
Newb Roberto Puzzanghera July 6, 2021 14:50
Solved
i repatched vpopmail i again execute make install-strip and now it return no errors
thanks you :)
Reply | Permalink
error with make install-strip
keeper24 April 19, 2021 19:11
Hi,
when i execute
i get a messenge:
any ideas?
Reply | Permalink
error with make install-strip
Roberto Puzzanghera keeper24 April 19, 2021 19:21
it seems that you are missing the zlib package...
Reply | Permalink
problem with passwords containing special characters like %
blueintheface February 26, 2021 09:05
I'm doinig a fresh installation, decided to compile with --enable-clear-passwd and am running into the following problem:
Using "%#" or "%+" or the like doesn't seem possible, but "%R" works.
OS: OpenSUSE 15.2
DB: MariaDB 10.4.17
Server-Character-Set: UTF-8 Unicode (utf8mb4)
Database "vpopmail" was created using collation "utf8mb4_general_ci", which is the default for standard MariaDB installation.
I'm ok with changing passwords for existing users (have to import a couple of existing domains) but am afraid there may be other issues with passwords and authentication.
Or is it just the clear password which is the problem and authentication with whatever client will be ok even when passwords like '%RxtraMT#66%' are used?
Reply | Permalink
problem with passwords containing special characters like %
Roberto Puzzanghera blueintheface February 26, 2021 21:02
Hi, I tested that password and it was accepted here...
which vpopmail version and patch?
PS tested both with mariadb-10.5.9 (query from command line) and mariadb-10.0.0.112
Reply | Permalink
problem with passwords containing special characters like %
blueintheface Roberto Puzzanghera February 28, 2021 11:26
Hi and thx for the quick reply.
vpopmail is v5.4.33, as well is the patch.
Did download and patch as directed above:
Language of the OS installaition is German.
status of MariaDB-server:
Also recompile with --disable-clear-passwd doesn't make any difference. The error stays the same, even though the password is not stored in the database in clear text.
Reply | Permalink
problem with passwords containing special characters like %
Roberto Puzzanghera blueintheface March 2, 2021 09:24
Unfortunately I've no idea at the moment, a I can't reproduce the issue...
Reply | Permalink
aliasdomain patch compilation issue
Wouter de Geus February 21, 2021 13:35
Hi Roberto!
Recently I switched to the SQL driver and of course ran into the aliasdomains issue, so today I gave your patch a shot using a new alpine-3.13 build.
However, it runs into a snag:
This is after running autoreconf.
I did also apply the GCC 10 patch, because without it the compilation broke on MYSQL definitions.
Suggestions?
Reply | Permalink
aliasdomain patch compilation issue
Roberto Puzzanghera Wouter de Geus February 21, 2021 15:28
Hi Wouter!
I thought I have corrected this compilation issue in the feb 15 patch... can you confirm that you downloaded this latest version marked as 2021.02.15? Just look at the first line of the patch file
which gcc version?
PS gcc-10 compat patch is already included into the latest sql-aliasdomains patch
Reply | Permalink
You step "Installing and configuring vpopmail"
johan lesky February 12, 2021 12:57
... Do I need to have MySQL or MariaDB, installed before I run Your step "Installing and configuring vpopmail" ?
grdt.
Reply | Permalink
You step
Roberto Puzzanghera johan lesky February 12, 2021 13:26
One of the two. It does not make any difference
Reply | Permalink
Problem compiling vpopmail with postgresql support on alpine 12
Bogdan December 4, 2020 06:28
Hi,
I try compile vpopmail with pgsql support on alpine 12 and I get error:
Can somebody tell what I should do to fix this problem?
Reply | Permalink
Problem compiling vpopmail with postgresql support on alpine 12
Roberto Puzzanghera Bogdan December 4, 2020 17:41
You have compilation breaks because vpopmail is not compatible with the new gcc-10.
Try this patch (you may want to apply only the changes to vpgsql.c): https://notes.sagredo.eu/files/qmail/patches/vpopmail/vpopmail-5.4.33_gcc-10-compat.patch
Let me know if it works
Reply | Permalink
Problem compiling vpopmail with postgresql support on alpine 12
Bogdan Roberto Puzzanghera December 7, 2020 10:39
works well
Reply | Permalink
Using dovecot-lda with vpopmail valias database table
Michael Dick September 29, 2020 20:59
Hi Robert
I have an extensive valias table, and I recently added sieve filtering.
As mentioned above in the thread between you and Eric, dovecot-lda doesn't respect the vpopmail.valias entries in the database, and instead relies on .qmail-alias files. That meant that for mail to be delivered to my aliases, I either needed to create a .qmail-alias file for each one (which would be a mess), or keep using vdelivermail and skip sieve filtering.
As an alternative to Eric's solution of creating .qmail-alias files, you can --enable-valias and add an entry for the destination account to the valias table and keep the delivery agent set to vdelivermail.
This is my .qmail-default file (I prefer to use bounce)
To add the valias to the database table, I use this: (replacing mailboxname and example.com as appropriate)
Hopefully this helps someone else out there.
If I had more time, I'd look at patching dovecot to use the valias table. Maybe one day.
Reply | Permalink
Using dovecot-lda with vpopmail valias database table
Roberto Puzzanghera Michael Dick September 30, 2020 19:02
Hi Michael, thanks for your contribution, it's very much appreciated.
I think I am missing something on how things work in your configuration. You are using vdelivermail in your .qmail-default so you are giving up on sieve filters and vdelivermail can work well with valiases even without your hack... what I am missing?
Reply | Permalink
Using dovecot-lda with vpopmail valias database table
Michael Dick Roberto Puzzanghera October 3, 2020 10:17
Hi Robert
I was trying to show is that you can use the valias table from vpopmail and still make sieve filtering work, without having to set up any .qmail-alias files.
The existing instructions and comments suggest you had to choose one or the other.
Reply | Permalink
Using dovecot-lda with vpopmail valias database table
Roberto Puzzanghera Michael Dick October 3, 2020 10:27
I don't understand how you can have sieve working if you have vdelivermail in your .qmail-default
Reply | Permalink
Using dovecot-lda with vpopmail valias database table
Michael Dick Roberto Puzzanghera October 3, 2020 10:58
Ah, that's the magic: I have an entry in the valias table for my actual mailbox name, that tells it to use dovecot's deliver program.
So:
Now, when an email for alias@example.com arrives, vdelivermail finds the alias michael@example.com and tells vdelivermail to deliver to that address. Vdelivermail then finds my alias for michael@example.com and calls dovecot's deliver to complete the delivery (which also processes the sieve rules).
Hopefully that's a bit clearer?
Michael
Reply | Permalink
Using dovecot-lda with vpopmail valias database table
Roberto Puzzanghera Michael Dick October 3, 2020 12:41
That's clear now, even though this can be a solution suitable just for servers with a small bunch of users and for administrators who know what they are doing, otherwise patching vpopmail and/or dovecot would be needed. Anyway it's good to know. Thank you
Reply | Permalink
vpopmail installation issue
Kenny Lee September 2, 2020 04:28
Hi Mr Roberto,
i am facing an issue while running this command "make install-strip", below is the message:
what shoud I do next? any settings need to be done in vpopmail folder?
Thank you
Regards, Kenny
Reply | Permalink
vpopmail installation issue
Roberto Puzzanghera Kenny Lee December 4, 2020 21:14
Today I released two patches, one for qmail and another for vpopmail, which solve these compilation breaks.
Reply | Permalink
vpopmail installation issue
Roberto Puzzanghera Kenny Lee September 2, 2020 07:58
No idea... any suspicious message from configure & make commands?
Reply | Permalink
vpopmail installation issue
Kenny Lee Roberto Puzzanghera September 2, 2020 09:32
Hi Mr Roberto,
my Linux is openSUSE Tumbleweed
mysql is MariaDB version 10.4.14
while running the configure command no issue, the summary as below:
but when i tried to run "make install-strip", the error message pop up :
do we need to define MYSQL data in vmysql.h?
thank you
Reply | Permalink
vpopmail installation issue
Roberto Puzzanghera Kenny Lee September 2, 2020 13:17
I didn't test it against mariadb-10.4, but I would try to declare with #ifndef those variables in mysql.h
Reply | Permalink
vpopmail installation issue
Kenny Lee Roberto Puzzanghera September 3, 2020 03:38
Hi Mr Roberto,
i deleted the vpopmail setup folder and extracted the zip file again, then this time i just run a "./configure" without any options and then "make install-strip", this time no error came out... then i tried to run again "./configure" with options then "make install-strip" .. no more error popup.
i continued your steps until netqmail setup which mean i done all the Patching steps. Now i hit another error, while i run "make setup check" in netqmail-1.06 folder, i got below error:
any idea?
Thank you
Reply | Permalink
vpopmail installation issue
Roberto Puzzanghera Kenny Lee September 8, 2020 22:06
I suppose you are compiling with gcc 10. Look at this https://gcc.gnu.org/gcc-10/porting_to.html
Reply | Permalink
vpopmail installation issue
Roberto Puzzanghera Kenny Lee September 3, 2020 08:11
It seems the same kind of error of vpopmail compilation.. did you try to download the sources, patching and compiling again?
Reply | Permalink
vpopmail installation issue
Kenny Lee Roberto Puzzanghera September 4, 2020 04:13
Hi Mr Roberto,
yes, i have redownloaded again the netqmail-1.06 file from your source and also the original source, then patch again.. but no luck.. both also same issue... what i have done, i just patch the file which only with smtp-auth, qmail-tls and force-tls. then it's works.
After that, when i tried to start Qmail and i found that the Daemontool was not start. for OpenSuse Tumbleweed, no more /etc/inittab use in the system, so what i have done, i need to ln that svscanboot file to /etc/rc.d/ then add it as auto start then completed Qmail Setup.
Thanks for the help.
Reply | Permalink
vpopmail installation issue
Roberto Puzzanghera Kenny Lee September 4, 2020 08:11
In the event of a systemd linux it is sufficient to start all services by rc.local, which should be created as a service in systemd
Reply | Permalink
vchkpw auth errors
Lawrence August 2, 2019 07:51
May need to fix suid permissions for vpopmail's vchkpw after compiling to avoid auth errors.
eg
Reply | Permalink
vchkpw auth errors
Roberto Puzzanghera Lawrence August 2, 2019 09:08
It wouldn't be better to run qmail-smtpd as vpopmail:vchkpw instead of letting everyone (not only qmail-smtpd) execute vchkpw with the owner's priviledges?
Reply | Permalink
libev missing
mizzio July 17, 2019 16:10
Hello Roberto,
I think I've found a small error in your guide: the latest available libev version is 4.27 and not 4.22: http://dist.schmorp.de/libev/libev-4.27.tar.gz
Ciao !
Reply | Permalink
valias doesn't work
Gabriel Torres June 19, 2019 14:05
Hello,
For some reason, vpopmail valias (i.e., storing valiases inside the MySQL database) doesn't work with chkuser, even if we configure both to do so. With valiases stored inside the database, vchkuser will reject emails sent to aliases (no mailbox). At least with me, chkuser only recognized valiases using the dot-qmail format. So, make sure to compile vpopmail with --disable-valias and --enable-qmail-ext as instructed, and remember that you will need to configure dot-qmail files for your aliases in the /home/vpopmail/domain/DOMAINNAME directory.
Reply | Permalink
Vusage configure error
Kevin Salt August 1, 2018 16:04
I get this message during the configure phase of vusage and can't progress from there:
So I am proceeding without implementing vusage (I also don't really acare about user quotas) so I hioe this will still work
Reply | Permalink
Vusage configure error
Roberto Puzzanghera Kevin Salt September 2, 2021 20:40
I faced this issue myself a couple of days ago on a Debian 11. Unfortunately the Luca's fix below didn't help.
I realized that, for unknown reasons, the configure is not linking the libmysqlclient libraries. But patching the configure not to break at that point results in a successfull compilation when make is runned (it finds libmysqlclient). I have vusaged running apparently with no issues for now.
Have a look to this patch
Reply | Permalink
Vusage configure error
Stumpi Kevin Salt April 26, 2019 10:47
Same here, OS: Ubuntu 18.04
Reply | Permalink
Vusage configure error
Roberto Puzzanghera Kevin Salt August 2, 2018 07:36
look here (first item on google!) http://vchkpw.inter7.narkive.com/ftLwnnZq/vusaged-compile-error
Anyway everything will work even without vusaged
Reply | Permalink
Vusage configure error
GoofY Roberto Puzzanghera April 8, 2019 18:05
Which unfortunately doesn't provide a solution...
If anyone managed to workaround this issue plz share here
Reply | Permalink
Vusage configure error
Luca GoofY August 2, 2019 18:09
Try this:
Reply | Permalink
Vusage configure error
carlos Luca September 2, 2021 15:17
it worked for me
Reply | Permalink
--disable-valias
Eric May 16, 2017 01:21
Hi Roberto,
As far I know and dovecot-lda is concerned it is not the presence of the configuration flag --enable-valias that hinders dovecot LDA from delivering to aliases it is the absence of a .qmail-'alias' alias file
Eric
Reply | Permalink
if the aliases are stored in
roberto puzzanghera Eric May 16, 2017 16:15
if the aliases are stored in the database, why the .qmail-alias is needed?
Reply | Permalink
valias
Eric roberto puzzanghera May 16, 2017 22:42
Hi Roberto,
I was only trying to point out that dovecot-lda is not affected by the --disable-valias/--enable-valias flags. On the other hand vdelivermail is affected and will use dot-qmail files in one case and the virtual alias database in the other case.
Dovecot-lda and --enable-valias can live quite happily together as long as you use dot-qmail files for you aliases.
Eric
Reply | Permalink
I agree. I will clarify this
roberto puzzanghera Eric May 17, 2017 16:23
I agree. I will clarify this in the lines above
Reply | Permalink
libev Version changed
Tiago Oliveira de Jesus November 9, 2016 17:41
Hi Roberto!
The libev 4.11 not exits, this changed to 4.22, at link http://dist.schmorp.de/libev/libev-4.22.tar.gz
Reply | Permalink
Permission issue on tcp.*
Wlad January 9, 2016 06:51
First of all, Roberto - THANK YOU for taking the time to put this resource together! I've formerly used JMS' tutorials etc but that was years ago. Once qmail etc is set up and working, you almost never have to touch it again except for security updates or maintenance so it's easy to forget the inner workings!
I have everything going so far but haven't been able to get passed the testing stages; When I telnet to 587, the logs for qmail-submission gives me this:
Can you please confirm what the perms are supposed to be? Right now they're owned by root at 644. Any pointers on this would be greatly appreciated!!
Reply | Permalink
Hi Wlad,
roberto puzzanghera Wlad January 9, 2016 10:11
Hi Wlad,
yes the priviledges are correct. It's strange because every user should be able to read that file..
Anyway, who is the user who runs qmail-smtpd and qmail-submission? If you migrated from JMS configuration you may have to check/adjust the priviledges of the ~vpopmail/ dir. In particular I suggest to check if the vpopmail:vchkpw userIDs are 89:89 (if I remember well JMS configuration uses non standard IDs for users..).
Reply | Permalink
Ok... I feel stupid.
Wlad roberto puzzanghera January 9, 2016 16:49
Ok... I feel stupid. ~vpopmail main dir was owned by root:root grrrr. Works now. ALL those dang hours - that happens when it's late, going on no sleep :) Again Roberto, thank you for this great guide! Lots of Coffee incoming to you haha
Reply | Permalink
ps -ef|grep qmail
Wlad roberto puzzanghera January 9, 2016 16:41
Wow long/ugly past - but all ownerships seem fine from looking at this and I'm perplexed. As for JMS, that was years ago on a separate server. I founds this guide last night and like the fact that things can be updated with the most current - in regards to paches etc. Versions of other sources:
And yes, id -g/-u vpopmail:vchkpw are both 89; I've turned every kind of permission based type of app off (apparmor for instance), every firewall etc etc with no change. I got no errors during compilation and did everything step by step and in order on this brand new server running ubuntu with multiple IPs. Speaking of IPs that was something I was going to ask about as well on how to specifically bind 587/25 to a specific IP but as long as MX records are set up properly there shouldn't be a need for that.
Roberto, sorry about the long post - just trying to figure this one out as everything seems to be running fine and like you said perms are right...
Reply | Permalink
Charset?
Anonymous July 3, 2014 08:24
Hello,
Some clients change their passwords with non-ascii char like "?š??˛ýáíé", but these characters are broken in MySQL as clear passwords. Any idea what charset set to Mysql db or how to set vpopmail to use UTF-8? Everythink else is in UTF...
Anyway if i do /home/vpopmail/bin/vuserinfo user@domain.cc clear password is ok, but in MySQL
Reply | Permalink
Hi, which tool are you using
roberto puzzanghera Anonymous July 3, 2014 18:42
Hi, which tool are you using to change the pwd? I can use UTF8 characters here when connecting via imap/roundcube pwd plugin, but if I try with qmailadmin I get an error...
PS: and I can retrieve the clear pwd with an SQL query
Reply | Permalink
Solved :)It was
Anonymous roberto puzzanghera July 4, 2014 08:23
Solved :)
It was misconfigured MySQL. I have no idea what charset did connection use when it was not configured but when I set this to my.cnf it start working correctly
Other problem is password from outlook... But I think there is no solution for clients using non UTF8 charset...
Reply | Permalink
Vpopmail configure
winnetou April 26, 2014 00:14
Hello!
While running ./configure on Gentoo systems (probably on other systems also) you have to add following options:
Vpopmail works also with MariaDB 5.5.37
BTW THX for great tutorial ;)
Best Regards
Winnetou
Reply | Permalink
Hello Winnetou This
roberto puzzanghera winnetou April 26, 2014 08:56
Hello Winnetou
This is the default location for mysql and mariadb, and I suppose that normally you don't even need to add those options, as the library will be automatically found. I just added them for those (like me) who compile from source or don't use the package provided by their own distro
Reply | Permalink
Hello! I'm aware that
winnetou roberto puzzanghera April 26, 2014 09:28
Hello!
I'm aware that those paths are default and ./configure should find them, but it didn't, that's why I decided to post a comment ;)
When I run ./configure without those 2 optins it failed. I was installing qmail and vpopmail on freshly installed Gentoo
Reply | Permalink
If I understand well,
roberto puzzanghera winnetou April 26, 2014 09:42
If I understand well, omitting those two options gets vpopmail not to find the libraries?
Anyway as soon as possible I will add a clarification on the purpose
Reply | Permalink
I am installing vpopmail and
Anonymous November 11, 2013 06:13
I am installing vpopmail and vusaged on CentOS release 6.4 (Final)
but i encountered the error on vusaged.
What is the problem? I am googling bu i couldn't found the solution.
please help me!!
Reply | Permalink
can you dostrace
roberto puzzanghera Anonymous November 11, 2013 12:25
can you do
and see what happens?
Reply | Permalink
it works now
Anonymous roberto puzzanghera January 21, 2014 04:22
It works now. I uninstalled the libev source then installed libev using yum rpmforge repository.
Sorry for the late reply. I totally forgot about this. I gave up last time and set up qmailtoaster on Centos 6 which was successful.
Now, I am experimenting qmail again using this setup. :)
Reply | Permalink