- Latest version 2026.04.07 (github)
- Changelog
- Readme
For my convenience I moved the qmail sources to my github space. Nonetheless, all information about qmail and related programs will continue to be posted in this web space, and this pages remain the place to eventually seek support. From now on, instead of releasing a combined patch for qmail, I'll release a package which is the result of the ancient netqmail-1.06 plus my modifications. The original patches that I accomodated in my qmail package are listed below.
Changelog
- Apr 7, 2026
- (security) Remote Code Execution via Shell Injection in qmail-remote TLS Error Handler in #42 (tx Diep Pham) - Apr 2, 2026
- qmail-remote auth improvements by pierluigi in #39
- Fixed DKIM ed25519-sha256 signing and verification to conform to RFC8463 by @agerstla in #40
- Updated qmail-qfilter to support filters defined in control/qfilters by @agerstla in #41 - Feb 25, 2026
- Improved DKIM status handling by @agerstla in #35
- Ported over DKIM_BAD_IDENTITY support from Indimail (tx Manvendra Bhangui and Andreas Gerstlauer 1299b55)
- SNI support for qmail-smtpd by @agerstla in #37
- Added qmail-qfilter by @agerstla in #38 - Feb 3, 2026
- Bug fix for verifying multiple DKIM signatures (second one always failed due to a DNS lookup bug). tx Andreas Gerstlaurer #31
- config-all.sh upgrade #33
* config-all.sh: moreipme is now populated with IPs in separate lines
* config-all.sh: rsa dh keys can be created even if the certificate creation is skipped
* config-all requires to accept overwriting with y/N/a=all options - Jan 8, 2026
- Bug fixed in helodnscheck: it allowed only domains with one dot #30 - Jan 5, 2026
- helodnscheck.cpp: PCRE dependency avoided, to make happy Debian 13 d987ec4
- config-all now grabs the correct network interface c60d3fa
- config-all will now prompt for 1024/2048 key length for DKIM c842cea
- Fixed typo in qmailctl 3f1ea75
- Makefile: Fixed incorrect rule syntax for 'make cert' 80222cc - Sep 8, 2025
- Fixes in SPP handling and support for [pass] plugins after RCPT accept. Support for RBLRESULT environment variable and RBL ignore ('=') option. (tx Andreas Gerstlauer)
- Added -std=gnu17 to conf-cc, fixed some other issues and now it compiles on gcc-15.2 in #28
- scripts/qmail-pop3d and qmail/pop3sd: ports changed to 110 and 995
- Received: email header now hides the sender's hostname when the sender is RELAYCLIENT or is authenticated. 785e84b - Apr 25, 2025
- added a configuration script config-all, which configure and installs the control files (as per the original config-fast script), aliases, SRS (uses control/me as the srs_domain), log dirs in /var/log/qmail, tcprules (basic, just to make initial tests), supervise scripts,qmailctlscript, DKIM control/filterargs and control/domainkeys dir, SURBL,smtpplugins,helodnscheckspp plugin,svtools,qmHandle,queue-repair, SSL key file (optional).
Consider this feature as "testing" - Feb 11, 2025
- Several adjustments to get freeBSD and netBSD compatibility. More info in the commit history. Hints/comments are welcome.
- freeBSD users have to leave the very 1st line of the file "conf-lib" blank, as libresolv.so is not needed on freeBSD.
- Dropped files install-big.c, idedit.c and BIN.* files.
- Dropped files byte_diff.c, str_cpy.c, str_diff.c, str_diffn.c and str_len.c, which break compilation on clang and can be replaced by the functions shipped by the compiler (tx notqmail).
- Old documentation moved to the "doc" dir. install.c and hier.c modified accordingly
- conf-cc and conf-ld now have -L/usr/local/lib and -I/usr/local/include to look for srs2 library
- conf-cc and conf-ld now have -L/usr/pkg/lib and -I/usr/pkg/include to satisfy netBSD
- vpopmail-dir.sh: minor correction to vpopmail dir existence check
- srs.c: #include <srs2.h> now without path
My qmail package includes the latest versions of several commonly-used qmail patches, applied over the original netqmail-1.06 program. Several other changes have been done by me or others. You can find more info in the changelog.
- qmail-authentication
- qmail-tls
- force-tls
- chkuser
- qmail queue custom error
- qmail-SPF
- qmail-SRS
- oversize DNS
- reread concurrency
- big concurrency
- maildir++
- Better qmail-smtpd logging
- SMTP HELO/EHLO Greeting delay
- DKIM and SURBL
- EXT-TODO
- BIG-TODO
- qmail-inject-null-sender
- doublebounce-trim
- qmail-taps-extended
- outgoingip
- qmail-rfc2821
- smtpd-502-to-500
- qmail-dnsbl
- qmail-moreipme
- qmail-hide-ip-headers
- qmail-date-localtime
- qmail-smtpd liberal-lf
- qmail-maxrcpt
- qmail-empf
- qregex
- brtlimit
- validrcptto
- reject-relay-test
- qlog
- reject null senders
- remove-cname-check
- any-to-cname
- rcptcheck
- qmail-channels
- qmail-remote-logging
- CVE-2005-1513
- qmail-spp
- fastremote
- EAI support
- Authentication-Results header support
- Server Name Indication (SNI) support
- qmail-qfilter
- qmail-remote auth improvements
[Follow the patch details here]
- Netqmail + smtp-auth, qmail-tls and force-tls
qmailbranch with nochkuserand novpopmaildependency- All patches directory
You're invited to take a look at the next page of this guide, which presents several tests for these patches toward the bottom of the page.
Before installing
This package requires the libidn2 library (GNU Internationalized Domain Name library version 2, libidn2-dev on Debian like OS). I also assume that you have already created the qmail users and groups, as mentioned in a previous page.
This qmail package contains chkuser, which has vpopmail as a prerequisite. If you are looking for a qmail variant without chkuser and vpopmail you can switch to the dedicated branch of my github space where you can find this same qmail without chkuser; download the branch in this way:
git clone -b no-chkuser-vpopmail https://github.com/sagredo-dev/qmail.git
Installing libsrs2
- Download: http://www.libsrs2.net (local copy)
This library is a prerequisite of the SRS patch, which is part of my package. You must install this, otherwise the compilation will break.
wget http://www.libsrs2.org/srs/libsrs2-1.0.18.tar.gz tar xzf libsrs2-1.0.18.tar.gz cd libsrs2-1.0.18 ./configure make make install ldconfig cd ../
Be sure that libsrs2 is actually linked, otherwise you are going to have a qmail-send infinite crash and finally an auto-DoS:
> ldconfig -p|grep libsrs2 libsrs2.so.0 (libc6,x86-64) => /usr/local/lib/libsrs2.so.0 libsrs2.so (libc6,x86-64) => /usr/local/lib/libsrs2.so
In some Linux OS like my Slackware, you can add /usr/local/lib to your /etc/ld.so.conf:
echo "/usr/local/lib" > /etc/ld.so.conf.d/qmail.conf
Be aware that conf-cc and conf-ld files holds references to the /usr/local/{lib|include} directories where are usually installed the libraries and their headers. And we have a link to /usr/pkg/{lib|include} for netBSD as well. In case you use a system where these external libraries are not correctly linked let me know dropping a comment below.
Download the sources
If you are wondering why we are going to download and install qmail again, it's worth to mention that the chkuser program embedded in my package has vpopmail as a prerequisite, while vpopmail itself requires to be installed over the vanilla qmail. So the compilation chain is netqmail > vpopmail > patched qmail.
QMAIL_VERSION=2026.04.07
wget https://github.com/sagredo-dev/qmail/archive/refs/tags/v${QMAIL_VERSION}.tar.gz
tar xzf v${QMAIL_VERSION}.tar.gz
cd qmail-${QMAIL_VERSION}
Configuring chkuser
The qmail package you downloaded has chkuser enabled and configured to perform recipient verification and MAV (Mail From: Address Verification). You can customize your configuration by editing the chkuser_settings.h file in the source directory.
force-tls variables
By default the authentication will be denied if the client does not provide the STARTTLS command. If you want to allow connections without TLS, just do
export FORCETLS=0
in your run file. Values other than 0 (or not declaring this variable at all) will force TLS before the authentication.
qmail-auth variables
By default the auth is allowed with LOGIN or PLAIN mechanism. You are invited to look at the README.auth file for further details concerning the use of the SMTPAUTH environment variable, expecially if you want to use CRAM-MD5.
Compiling qmail
FreeBSD doesn't have the libresolv.so library, which is not needed there to compile. Before compiling, FreeBSD users have to erase the very 1st line of conf-lib (leave it blank) or delete that file.
If this is a fresh installation for you compile qmail as follows:
make setup check
Then proceed to next paragraph (Creating an SSL key file), as the qmail configuration is presented in the next page.
Those who are upgrading and have qmail already running should stop qmail before installing it:
qmailctl stop
The BIG-TODO patch included in my combined patch may require that your queue has to be rebuilt. So be aware that all existing messages in the queue will be destroyed when you erase the queue below.
To check if your qmail has messages in the queue:
> qmailctl stat
qmail-smtpd: [ up ] (pid 5638) 4 day(s), 22:25:01
qmail-smtpd/log: [ up ] (pid 5642) 4 day(s), 22:25:01
qmail-smtpsd: [ up ] (pid 5662) 4 day(s), 22:25:01
qmail-smtpsd/log: [ up ] (pid 5663) 4 day(s), 22:25:01
qmail-submission: [ up ] (pid 5644) 4 day(s), 22:25:01
qmail-submission/log: [ up ] (pid 5641) 4 day(s), 22:25:01
qmail-send: [ up ] (pid 5664) 4 day(s), 22:25:01
qmail-send/log: [ up ] (pid 5665) 4 day(s), 22:25:01
vpopmaild: [ up ] (pid 5645) 4 day(s), 22:25:01
vpopmaild/log: [ up ] (pid 5660) 4 day(s), 22:25:01
vusaged: [ up ] (pid 5643) 4 day(s), 22:25:01
vusaged/log: [ up ] (pid 5661) 4 day(s), 22:25:01
messages in queue: 0
messages in queue but not yet preprocessed: 0
Only if this will be the first time you install the combined patch (which contains the BIG-TODO patch), you’ll need to rebuild the queue:
rm -r /var/qmail/queue
Now compile, install and restart qmail:
make setup qmailctl start
Sometimes you can have problems in installing the binaries if qmail-smtpd is busy:
# make setup check ./install install: fatal: unable to write .../bin/qmail-smtpd: text busy make: *** [Makefile:1934: setup] Error 111
In this case you have to kill qmail, install the binaries and then reboot:
qmailctl kill make setup check qmailctl boot
But if you have the rc.local file started as a systemd service this won't work, as systemd immediately resumes qmail. In this case you have to stop the rc-local service (or whatever you called the service which starts rc.local), install the qmail binaries and then restart rc-local in this way:
systemctl stop rc-local make setup check systemctl start rc-local
patches details
The qmail package that we have downloaded contains the following patches:
qmail-authentication
- Author: Erwin Hoffmann (updates the previous work of Krysztof Dabrowski and Bjoern Kalkbrenner)
- Version 0.8.3 (23.08.2015)
- Info: https://www.fehcom.de/qmail/smtpauth.html
- README.auth
It provides cram-md5, login, plain authentication support for qmail-smtpd (port 587) and qmail-remote.
Added FORCEAUTHMAILFROM environment variable to REQUIRE that authenticated user and 'mail from' are identical.
Added SMTPAUTHMETHOD, SMTPAUTHUSER and SMTP_AUTH_USER env variables for external plugins (see http://qmail-spp.sourceforge.net/doc/)
qmail-tls
- Author: Frederik Vermeulen
- Info: http://inoa.net/qmail-tls/
- Version 20231230
- added DISABLETLS environment variable, useful if you want to disable TLS on a desired port
It implements TLS encrypted and authenticated SMTP between the MTAs and from MUA to MTA. I have adjusted the file update_tmprsadh to chown the .pem files to vpopmail, which runs qmail-smtpd.
Patched to dinamically touch control/notlshosts/<fqdn> if control/notlshosts_auto contains any number greater than 0 in order to skip the TLS connection for remote servers with an obsolete TLS version (tx Alexandre Fonceca for the original code and to Diep Pham for spotting a vulnerability).
You may be interested to take a look to the page concerning smtp-auth and TLS testing here.
force-tls
- Author: Marcel Telka
- Patch
- Version: 2016.05.15
optionally gets qmail to require TLS before authentication to improve security.
You have to declare FORCETLS=0 if you want to allow the auth without TLS
chkuser
- Author: Antonio Nati
- Info: http://opensource.interazioni.it/qmail/chkuser.html
- Version 2.0.9
performs recipient verification and Mail From: Address Verification (MAV).
Small adjustments and a bug fix by Luca Franceschini here. Now CHKUSER_DISABLE_VARIABLE, CHKUSER_SENDER_NOCHECK_VARIABLE, CHKUSER_SENDER_FORMAT_NOCHECK, CHKUSER_RCPT_FORMAT_NOCHECK and CHKUSER_RCPT_MX_NOCHECK can be defined at runtime level as well.
chkuser' MAV program has been modified in order to be compliant with EAI (RFC 5336 SMTP Email Address Internationalization). More info here.
You may be interested to take a look to this page concerning chkuser testing.
chkuser has vpopmail as a prerequisite. If you are looking for a qmail variant without chkuser and vpopmail you can switch to the dedicated branch of my github space where you can find this same qmail without chkuser; download the branch in this way:
git clone -b no-chkuser-vpopmail https://github.com/sagredo-dev/qmail.git
qmail-queue-custom-error patch
- Author: Flavio Curti
- Patch
Enables simscan and qmail-dkim to return the appropriate message for each e-mail that qmail refuses to deliver. Simscan rejects with the name of the virus or the spam-score; qmail-dkim rejects with the verification failure message.
qmail-SPF
- Author: Christophe Saout.
- Patch modified by Manvendra Bhangui to make it IPv4-mapped IPv6 addresses compliant.
- Info: http://www.saout.de/misc/spf/
- Version rc5
- SPF configuration
It can check incoming mails inside the SMTP daemon, add Received-SPF lines and optionally block undesired transfers.
qmail-SRS
- Author: Marcelo Coelho
- Info: http://www.mco2.com.br/opensource/qmail/srs/
- SRS configuration
implements Sender Rewriting Scheme fixing SPF break upon email forwarding. To enable SRS read carefully the configuration instructions above.
Oversize DNS
- Author: Christopher K. Davis
- Info: http://www.ckdhr.com/ckd/qmail-103.patch (local copy)
This patch enables qmail to handle large DNS packets.
Reread concurrency patch
- Author: Jul
- Version: 2
- Patch
rereads control/concurrencylocal and control/concurrencyremote files when qmail-send receives a HUP signal.
Big Concurrency patch
- Author: Johannes Erdfelt
- Patch
It sets the spawn limit above 255.
maildir++ patch
- Author: Bill Shupp
- Version: 20050125
- Patch
adds maildirquota support to qmail-pop3d and qmail-local.
Fixed a bug where the filesize part of the S=<filesize> component of the Maildir++ compatible filename is wrong (tx MG). More info here.
Better qmail-smtpd Logging patch
- Author: Kyle B. Wheeler
- Version: 5
- Info: http://www.memoryhole.net/qmail/#logging
Facilitates diagnosing qmail-smtpd logging its actions and decisions (search for a line starting with qmail-smtp:). This is useful for discovering fake IP addresses with bad HELO’s when qmail-smtpd doesn’t log anything.
Greeting delay patch
adds a user-definable delay after SMTP clients have initiated SMTP sessions, prior to qmail-smtpd responding with "220 ESMTP". It can reject connections from clients which tried to send commands before greeting. You can control the delay via the environment variable SMTPD_GREETDELAY (was GREETDELAY in the original patch). A value of SMTPD_GREETDELAY=”30” will delay qmail-smtpd’s response for 30 seconds.
DKIM and SURBL patch
- Author: Manvendra Bhangui (a big thanks for the support)
qmail-dkimuses hackedlibdkimlibraries fromlibdkimproject at http://libdkim.sourceforge.net/surbfilteris built on djb functions and some functions have been ruthlessly borrowed fromqmail surblinterface by Pieter Droogendijk and the surblhost program at http://surblhost.sourceforge.net/- Version: 1.48
- DKIM configuration
- SURBL configuration
- ANNOUNCE.surblfilter
- Original patch
adds DKIM signing & verification support to qmail at both qmail-smtpd and qmail-remote/local level and SURBL filtering support to qmail.
/var/qmail/control/cache and subdirs assigned to the vpopmail user.
EXT-TODO patch
addresses a problem known as the silly qmail (queue) problem.
BIG-TODO patch
- Author: Russell Nelson
- Patch
Makes qmail use a hashing mechanism in the todo folder similar to that used in the rest of the queue.
qmail-inject-null-sender patch
- Author: Stéphane Cottin
- Patch
- More info here
Prevents qmail-inject from rewriting the null sender, fixing an issue with sieve vacation/reject messages.
doublebounce-trim patch
- Authors: Russell Nelson (modified version by Charles Cazabon)
- Download
Prevents double bounces from hitting your queue a second time provided that you delete the first line from /var/qmail/control/doublebounceto
qmail-taps-extended
- Author: Inter7
- Patch
- Extended by Michai Secasiu (http://patchlog.com/patches/qmail-taps-extended/)
Provides the ability to archive each email that flows through the system. Archiving only messages from or to certain email addresses is possible as well.
outgoingip patch
- Author: Andy Repton (adjusted by Sergio Gelato)
- Patch
- Robbie Walker provided a patch to correct qmail-qmqpc.c's call to timeoutconn(), because the function signature was modified by the original outgoingip patch
By default all outgoing emails are sent through the first IP address on the interface. In case of a multiple IP server this patch makes qmail send outgoing emails with the IP eventually stored in control/outgoingip. The ehlo domain is NOT modified by this patch.
qmail-rfc2821 patch
makes qmail rfc2821 compliant.
Ali Erturk TURKER added implicit TLS (SMTPS) support (patch here).
smtpd-502-to-500 patch
makes qmail rfc2821 compliant
qmail-dnsbl patch
- Author: Fabio Busatto
- Download
- Modified by Luca Franceschini to add support for whitelists, TXT and A queries, configurable return codes 451 or 553 with custom messages
- More info here
allows you to reject spam and virus looking at the sender's ip address. Added a line to make qmail-smtpd log the reject reason as well as the envelope to facilitate diagnostics.
qmail-moreipme patch
- Author: Scott Gifford
- Version: 0.6
- More info here
- Configuration
- Patch
prevents a problem caused by an MX or other mail routing directive instructing qmail to connect to itself without realizing it's connecting to itself, saving CPU time.
qmail-hide-ip-headers
- Author: Alex Nee
- Original patch
- My upgrade
It will hide your Private or Public IP in the email Headers when you are sending Mail as a Relay Client.
I upgraded the patch in order to hide also the sender's hostname when the sender is RELAYCLIENT or is authenticated.
qmail-date-localtime patch
- Author: John Saunders
- Patch
causes the various qmail programs to generate date stamps in the local timezone.
qmail-liberal-lf patch
- author: Dean Gaudet
- version: 0.95
- download: http://www.arctic.org/~dean/patches/qmail-0.95-liberal-lf.patch (local copy)
allows qmail-smtpd to accept messages that are terminated with a single \n instead of the required \r\n sequence.
Bare LF are no longer allowed by default due to smuggling vulnerability CVE-2023-51765. Bare LF can be allowed by defining ALLOW_BARELF in the tcprules or in the run file.
qmail-maxrcpt
- author: Michael Samuel
- Patch
allows you to set a limit on how many recipients are specified for any one email message by setting control/maxrcpt. RFC 2821 section 4.5.3.1 says that an MTA MUST allow at least 100 recipients for each message, since this is one of the favourite tricks of the spammer.
I slightly modified the patch also to log its response. If DISABLE_MAXRCPT is defined it skips the check, otherwise outgoing messages from mailing lists would be rejected.
qmail-eMPF patch
eMPF follows a set of administrator-defined rules describing who can message whom. With this, companies can segregate various parts of their organizations email activities, as well as provide a variety of security-enhancing services.
It's useful in case of spammed servers, to temporarily stop outgoing messages. It adds a line like this in your qmail-smtp log:
2015-03-30 18:05:54.442596500 policy_check: remote someone@somewhere.xy -> local user@yourdomain.xy (UNAUTHENTICATED SENDER) 2015-03-30 18:05:54.442612500 policy_check: policy allows transmission
qregex
- By Andrew St. Jean. Contributors: Jeremy Kitchen, Alex Pleiner, Thanos Massias. Original patch by Evan Borgstrom
- More info here
- README
adds the ability to match address evelopes via Regular Expressions (REs) in the qmail-smtpd process.
Added new control file 'badhelonorelay', control/badmailto renamed control/badrcptto (Tx Luca Franceschini).
brtlimit
- Author: Luca Franceschini, patch derived from goodrcptto-12.patch
- man qmail-smptd
adds control/brtlimit and BRTLIMIT variable to limit max invalid recipient errors before closing the connection.
validrcptto
- code grabbed by Luca Franceschini from several patches with additional features: http://qmail.jms1.net/patches/validrcptto.cdb.shtml, https://notes.sagredo.eu/files/qmail/patches/goodrcptto-ms-12.patch, http://patch.be/qmail/badrcptto.html.
It works in conjunction with chkuser with both cdb and mysql accounts. Look here for details
reject-relay-test
- Author: Russell Nelson
- More info here
It gets qmail to reject relay probes generated by so-called anti-spammers. These relay probes have '!', '%' and '@' in the local (username) part of the address.
bug fixed in smtpd.c addrparse function
Fixed a little bug in 'mail from' address handling (see the patch by Andre Opperman at http://qmail.cr.yp.narkive.com/kBry6GJl/bug-in-qmail-smtpd-c-addrparse-function)
qlog patch
- Author: Luca Franceschini
- The qlog patch is inside this bunch of patches (later adjustments here)
smtpd logging with fixed format (note: 'size' field is evaluated only when control/databytes or DATABYTES are set. An entry 'qlogenvelope' is generated after accepting or rejecting every recipients in the envelope phase, example:
qlogenvelope: result=rejected code=553 reason=rblreject detail=b.barracudacentral.org helo=test.machine.it mailfrom=test@domain.com rcptto=test@pippo.com relay=no rcpthosts=yes size= authuser= authtype= encrypted= sslverified=no localip=15.15.15.15 localport=25 remoteip=14.143.30.83 remoteport=57502 remotehost= qp= id=39156 qlogenvelope: result=accepted code=250 reason=rcptto detail=chkuser helo=test mailfrom=test@test.com rcptto=test@pippo.com relay=no rcpthosts=yes size= authuser= authtype= encrypted= sslverified=no localip=15.15.15.15 localport=25 remoteip=12.181.218.154 remoteport=57742 remotehost= qp= pid=37357
an entry 'qlogreceived' is generated after DATA (message accepted o rejected by qmail-queue)
qlogreceived: result=accepted code=250 reason=queueaccept detail= helo=test.machine.it mailfrom=test@domain.com rcptto=test@gmail.com relay=yes rcpthosts= size= authuser=pippo@pippo.com,pluto@pippo.com authtype=login encrypted=tls sslverified=no localip=192.168.200.162 localport=25 remoteip=192.168.200.162 remoteport=52602 remotehost= qp=30982 pid=30980
reject null senders patch
- by Luca Franceschini
useful in special cases if you temporarily need to reject the null sender (although breaks RFC compatibility). You just need to put 1 (actually any number different from 0) in your control/rejectnullsenders or define REJECTNULLSENDERS to reject the null sender with 421 error message.
remove-cname-check patch
- Author: Luca Franceschini
- Download
- More info here https://lists.gt.net/qmail/users/138190
Removed dns_cname call in qmail-remote.c instead of changing the funcion in dns.c,in case another patch requires dns_cname(). Avoids qmail getting large amounts of DNS data we have no interest in and that may overflow our response buffer.
any-to-cname patch
- Author: Jonathan de Boyne Pollard
- Download
Avoids qmail getting large amounts of DNS data we have no interest in and that may overflow our response buffer.
rcptcheck patch
- Author: Luca Franceschini
(based on original patch from Jay Soffian - download, more info) - Download the patch
- Download the rcptcheck-overlimit.sh script
- More info here
Originally designed for the purpose of receipt validation, it can also be used to limit the number of email a given IP and/or auth-user and/or domain can send in a given time interval. It has to be used in conjuction with the rcptcheck-overlimit.sh LF's script.
qmail-channels
Allows you to add an arbitrary number of supplemental remote queues, each distinguished by a list of recipient domains and separate throttling (concurrency) capabilities. This patch also allows dynamic throttling of the concurrency control files so you can just send qmail-send a HUP signal instead of restarting the service every time.
This patch is useful when some email provider complains of too many emails receveid at the same time (in case of news letters for instance).
Edit conf-channels before compiling: Total number of channels (queues) available for delivery. Must be at least 2, and anything above 2 are considered supplemental channels.
qmail-remote-logging
Gets qmail-remote to log sender, recipient and IP adddress all together in the "Delivery success/failure" line
Here is the sample log lines:
@400000004b1bdd4d1f89d84c delivery 10: success: <From:owner-freebsd-current@freebsd.org_To:user@remotedomain.com>_193.140.X.X_accepted_message. /Remote_host_said:_250_ok_1260117440_qp_15626/ @400000004b1bdbb8191f1954 delivery 6: failure: <From:a@surgate.net_To:test323232@remoteserver.com>_212.252.x._does_not_like_recipient. /Remote_host_said:_550_non-existent_recipient/alici_bulunamadi/Giving_up_on_212.252.x.x/
CVE-2005-1513 fix
- Author: notqmail.org
- Patch and info here
addresses a vulnerability issue spotted by Georgi Guninski in 2005.
qmail-spp
- Author: Pawel Foremski
- Version: 0.42
- More info here
qmail-spp provides plug-in support for qmail-smtpd. It allows you to write external programs and use them to check SMTP command argument validity. The plug-in can trigger several actions, like denying a command with an error message, logging data, adding a header and much more.
The qmail-spp functionality is disabled by default, so that it will be transparent for ancient users of this patch. If you want to enable qmail-spp just export the variable ENABLE_SPP in your run file. Note that the variable NOSPP is not available in this combined patch.
fastremote
- Author: Bruce Guenter
- Download original patch
While sending individual messages with qmail consumes very little CPU, sending multiple large messages in parallel can effectively DoS a sender due to inefficiencies in qmail-remote's "blast" function. In its original form, this function scans the message one byte at a time to escape leading periods and newlines, as required by SMTP.
This patch modifies blast to scan the message in larger chunks. Tests show that the change reduces the CPU time consumed by qmail-remote by a factor of 10.
EAI support
- Author: Arnt Gulbrandsen
- Original program
- Patch applied
- More info
adds RFC 5336 SMTP Email Address Internationalization (SMTPUTF8) support to qmail.
Authentication-Results: header support
- Author: Andreas Gerstlauer
adds Authentication-Results: header.
Server Name Indication (SNI) support
- Author: Andreas Gerstlauer
Server Name Indication (SNI) is a TLS extension that enables a server to present different certificates based on the hostname requested by the client during the TLS handshake.
qmail-qfilter
- Author: Bruce Guenter
qmail-qfilter allows the body and/or envelope of a message to be filtered through a series of filters before being passed to the real qmail-queue program, and injected into the qmail queue.
- https://untroubled.org/qmail-qfilter/
- Thanks to Manvendra Bhangui for porting qmail-qfilter to his Indimail and to Andreas Gerstlauer for porting to my qmail (Pull request)
qmail-remote auth improvements
Comments
dh_key_too_small sending error
William Silverstein January 13, 2026 04:49 CET
I am getting the following error when connecting to my other server (much older) at mail.sorehands.com when sending from mail2.sorehands.com:
delivery 10: deferral: TLS_connect_failed:_error:0A00018A:SSL_routines::dh_key_too_smallZConnected_to_23.237.50.67_but_connection_died._(#4.4.2)/
I don’t get this error when sending/connecting with gmail's or yahoo's mail servers.
dh_key_too_small sending error
Roberto Puzzanghera William Silverstein January 13, 2026 06:18 CET
Try like this
echo 'HIGH:MEDIUM:!MD5:!RC4:!3DES:!LOW:!SSLv2:!SSLv3' > /var/qmail/control/tlsserverciphers
dh_key_too_small sending error
WilliamSilverstein Roberto Puzzanghera January 24, 2026 07:29 CET
I tried your suggestion, but I still have an issue when sending an issue.
I tried both
On mail2.sorehands.com (the new server) I used
HIGH:MEDIUM:!MD5:!RC4:!3DES:!LOW:!SSLv2:!SSLv3
and
DEFAULT
And it had the same problem. But, when changed the old server mail.sorehands.com and used
HIGH:MEDIUM:!MD5:!RC4:!3DES:!LOW:!SSLv2:!SSLv3:!DH
it was happy.
For some reason, it thinks the DH key was too small. Noone else did on either the old or new.
dh_key_too_small sending error
Roberto Puzzanghera WilliamSilverstein January 24, 2026 12:11 CET
Great. So it appears that the solution is to add
!DH
GMail now rejecting all messages without Message-ID, even Qmail bounces(!)
Gustavo Castro January 12, 2026 16:57 CET
Hi Roberto,
I've been experiencing many issues lately with GMail, as they are now rejecting messages due to the lack of Message-ID header. The problem arises when you send autorespond messages (the "blah" part of the Message-ID header added by "autorespond" seems not to be "ok" for Google, so I had to modify the autorespond.c program to add a more apropriate value), valid bounces or any other email sent by any client that doesn't create and add the Message-ID header before sending it using qmail-smtpd. As QMail doesn't add that header when coming from the network, this issue is getting quite problematic for us, QMail users. I've written a small quick'n dirty shell script that removes the original Message-ID if exitst and adds a proper header again, but clients are hanging while using it (I've put it into QMAILQUEUE variable and then invoking the next queue processor after it), so I think I have to research more on the matter...
Anyway, I think it's time to add that functionality somewhere in qmail-smtpd.c (checking if Message-ID is already present, or add it if is not), but I wanted to check first if you have seen any patch or add-on, as I wasn't able to find one yet.
Thank you in advance.
Gustavo Castro.
GMail now rejecting all messages without Message-ID, even Qmail bounces(!)
Roberto Puzzanghera Gustavo Castro January 12, 2026 18:48 CET
Hi Gustavo,
thanks for the notice. I can do tests next week.
Can you share your modifications at autorespond.c? Can you mention at least one client that doesn't add a proper message-id, so that I can do tests with it?
PS What is the error message returned by google?
qmail-spp
Ricardo Brisighelli October 3, 2025 15:03 CET
Hello, I’m trying to create a plugin (qmail-spp) to apply in the [data] section, and I can’t manage to get the email itself in order to process it. I do get the environment variables such as SMTPRCPTTO, SMTPMAILFROM, etc.
Do you know if qmail-spp passes the email through stdin or by some other method or variable? or do you have any example?
Regards
qmail-spp
Roberto Puzzanghera Ricardo Brisighelli October 3, 2025 15:47 CET
Sorry, I'm not sure I understood what you mean here... can you explain what you want to do more in detail?
qmail-spp
Ricardo Brisighelli Roberto Puzzanghera October 6, 2025 11:04 CET
I want to pass the entire email (header/body/attachments) to a Python or Bash script that will be processed by qmail-spp. From what I understand, in the [data] section I should be able to access the email, but I can’t manage to do it and I’m not sure if it can actually be done there.
Thanks
qmail-spp
Roberto Puzzanghera Ricardo Brisighelli October 6, 2025 13:22 CET
spp cannot access the email as a whole, e.g. its body content, but only the variables of that email. If you look at the code of smtp_data(), where spp comes into action
if (!spp_data()) return;
seenmail = 0;
if (databytes) bytestooverflow = databytes + 1;
if (qmail_open(&qqt) == -1) { err_qqt(); return; }
qp = qmail_qp(&qqt);
strnumqp[fmt_ulong(strnumqp,qp)] = 0; /* qp for qlog */
out("354 go ahead\r\n");
the spp_data() function is called before the data are sent by the client, as the "354 go ahead" verb still has to come
ARC seal
Shah Imran August 19, 2025 10:38 CET
Hi
I'm constantly following you and thanks for your effort to make qmail still alive. May be you'll remember me, I informed you about simscan's message dropping issue. I see you've given credit about it to your page in "Installing and configuring simscan" section's Changelog:
"unreleased
- message with found viri is now put in quarantine (tx Shah Imran)"
My question is, is qmail capable to sign ARC seal? Is it possible to integrate it? Now days I'm trying to integrate ARC seal in my qmail servers. Hope you can show me some light about it.
Thanks
BR
Shah Imran
ARC seal
Roberto Puzzanghera Shah Imran August 19, 2025 12:03 CET
Hi,
ARC is not available in my qmail and I'm not aware of any available program to use in order to integrate into my package. If you find anything interesting let me know
Qmail Updated Version Error 404
Shailendra Shukla July 13, 2025 16:15 CET
Hi Roberto ,
While trying to download the latest version for upgrading qmail its giving a 404 error.
QMAIL_VERSION=2025.07.10
Location: https://codeload.github.com/sagredo-dev/qmail/tar.gz/refs/tags/v2025.07.10 [following]
--2025-07-13 20:41:37-- https://codeload.github.com/sagredo-dev/qmail/tar.gz/refs/tags/v2025.07.10
Resolving codeload.github.com (codeload.github.com)... 20.207.73.88
Connecting to codeload.github.com (codeload.github.com)|20.207.73.88|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2025-07-13 20:41:37 ERROR 404: Not Found.
Qmail Updated Version Error 404
Roberto Puzzanghera Shailendra Shukla July 13, 2025 20:44 CET
corrected
Qmail Updated Version Error 404
Roberto Puzzanghera Shailendra Shukla July 13, 2025 16:18 CET
Sorry, you have to wait the Sinner final ending... :-) download from gihub for the time being
Some SPP (and RBL) fixes and upgrades
Andreas Gerstlauer June 20, 2025 16:26 CET
Hi Roberto,
I have another small-ish patch. Initially, I just wanted to extend SPP to enable support for conditional greylisting (that will have to come later), but in the process I noticed a few issues with the SPP integration with the rest of the patches. So in the end, my patch now includes multiple things:
1) Fixes for SPP handling. In particular, SPP plugins are supposed to be able to tell qmail-smtp to bypass any of its internal checks ('O' response). Internally, that is when the spp_xxx() functions return 2 instead of 1. But that logic was not always there and in some cases actually reversed (qmail-smtpd would do qregex checks even though spp_mail() returned 2, i.e. told it not to). I fixed that and also added logic to bypass other checks in smtp_helo, smtp_mail and smtp_rcpt if the plugin says so. I decided not to bypass checks that are not directly about RCPT checking, such as RBL checks, as well as calls external tools such as rcptcheck. Also, this integrates with my Debian version of user checking, so needs to be adapted for the chkuser setup (I bypass that by requiring (spp_val == 1) in my case).
2) Added support for additional "[pass]" SPP plugins that get called *after* all the RCPT checks are done and the recipient is accepted.
3) Added support for qmail-smtpd setting an RBLRESULT environment variable (akin to SPFRESULT) together with the option for RBL checks to be ignored (by starting the corresponding line with '=' in control/dnsbllist). Such that checks can be used to only set the variable (and output logs).
Combined patch is here.
I have, however, not tested this extensively. I don't do any of the extra checking options that the various patches enable. Do you have a way to test esp. the SPP handling changes with things like qregex, realbadrcpt, validrcptto, etc.? To make sure I at least didn't break anything? Likewise for RBL.
Once this proves stable, my plan is to look into conditional greylisting with the idea of using it as a [pass] plugin that only greylists e.g. if SPF or RBL checks (set to ignore in qmail-smtpd) fail (via SPFRESULT and RBLRESULT variables). In my setup, I don't outright block all RBLs, but let spamassassin handle some.
Some SPP (and RBL) fixes and upgrades
Roberto Puzzanghera Andreas Gerstlauer July 16, 2025 16:43 CET
Sorry for the late responce to this, but I was engaged in other jobs...
1) Basically I would never bypass [helo] [mail] and [rcpt] plugins, but only [data] plugins. What is the reason to do differently? Is it only in case it passed greylisting or auth? Can it be set in some way?
Please let me know if the patch you linked above is still your latest version, so that I can proceed with some tests
Thanks so much for sharing
Some SPP (and RBL) fixes and upgrades
Andreas Gerstlauer Roberto Puzzanghera July 16, 2025 21:43 CET
The SPP patch linked above should still be the same, I didn't make any more changes.
I am basically just trying to implement the behavior as documented here: https://qmail-spp.sourceforge.net/doc/index.html - if the plugin returns 'O', qmail-smtpd is supposed to bypass other checks.
This was there for MAIL and RCPT, but in some cases the logic was simply wrong (from all I understood), e.g. reversed. So I tried to fix that.
In addition, I extended this also to apply to HELO plugins, i.e. they can now also return 'O' to bypass checks. When SPP was written, there were no checks performed in the HELO phase, so this simply didn't apply then. But the qregex patch adds some checks there, so it made sense to me to extend that functionality to that (in the same way how it applies to qregex checks in MAIL/RCPT). Note that this is optional - it will only apply if the plugin returns 'O', i.e. only in cases where the plugin has been explicitly written to return such a bypass condition (my assumption is that normal HELO plugins won't). In other words, it's set by the plugin.
Finally, note that DATA plugins never had the option to bypass checks (there are no checks during the DATA phase). That remains unchanged.
Some SPP (and RBL) fixes and upgrades
Roberto Puzzanghera Andreas Gerstlauer June 21, 2025 08:23 CET
Thank you. I'll do some tests and get back to you
Authentication-Results: header support
Andreas Gerstlauer June 16, 2025 03:26 CET
Hi Roberto,
I created a patch to add "Authentication-Results:" header support for compliance with RFC 7601.I also made the "Received-SPF:" headers a bit more compliant with the relevant RFC 7208 spec.
I implemented this by letting qmail-smtpd and qmail-dkim pass authentication information to qmail-queue via a QMAILAUTHENTICATED environment variable, where each of them can add relevant info to the header by appending them as semi-colon separated entries to this variable.
qmail-queue then inserts the actual header if QMAILAUTHENTICATED is defined. If QMAILAUTHENTICATED is defined but empty, it will insert a 'none' header entry. The service/server ID for the header can be defined via an optional 'control/authservid' file (defaults to 'control/me').
The patch is available here (add '.diff' to the end ot get an actual patch file).
Authentication-Results: header support
Roberto Puzzanghera Andreas Gerstlauer June 16, 2025 04:13 CET
Thank you, Andreas. I'll check it out
Authentication-Results: header support
Andreas Gerstlauer Roberto Puzzanghera June 16, 2025 04:51 CET
Actually, I fixed a few bugs and improved RFC compliance a bit more. Also, while the "DKIM-Status:" header is not in any RFC (the standard way to communicate DKIM results is the "Authentication-Results:" header it seems), I reverted to mirroring the way the historic RFC sets the "DomainKeys-Status:" header when setting "DKIM-Status:" (e.g. using "good" instead of "pass" the way it was before - also to not break things that may depend on that).
Patch on top of the other patch is here, i.e. please apply both (this after the other).
Alternatively, here is the full patch that includes both (as well as a Makefile fix and a README.md change for my repo fork, i.e. the latter you can ignore).
Authentication-Results: header support
Roberto Puzzanghera Andreas Gerstlauer June 16, 2025 05:02 CET
Is the patch for your divergent fork or for my original branch? In latter case a PR would be great
Authentication-Results: header support
Andreas Gerstlauer Roberto Puzzanghera June 16, 2025 06:13 CET
It's on my forked branch. Probably easier to just apply tihs patch - it should apply to your original branch I would think. Just revert/don't apply the README.md change that is in there.
Authentication-Results: header support
Roberto Puzzanghera Andreas Gerstlauer June 17, 2025 09:26 CET
It works nicely here!
Authentication-Results: smtp.sagredo.eu; spf=pass (smtp.sagredo.eu: SPF record at _netblocks.google.com designates 209.85.221.172 as permitted sender) smtp.mailfrom=sender@gmail.com; dkim=pass header.d=gmail.com.20230601.gappssmtp.com header.i=@gmail.com.20230601.gappssmtp.com header.s=20230601
Segfault in qmail-smtpd with GREETDELAY
Andreas Gerstlauer June 8, 2025 04:44 CET
The code for qmail-smtpd.c in the latest Github repo has a bug when using GREETDELAY without DROP_PRE_GREET. Basically, the greetdelay integer value is passed to the logging function where a char* is expected, leading to a segfault.
I created a patch to fix this (while also making logging more consistent) here.
Segfault in qmail-smtpd with GREETDELAY
Roberto Puzzanghera Andreas Gerstlauer June 8, 2025 09:34 CET
Thank you. I can't believe no one ever noticed this problem
Let me test some more days the CRLF fix and I'll pull both your fixes on my github
Segfault in qmail-smtpd with GREETDELAY
Andreas Gerstlauer Roberto Puzzanghera June 9, 2025 17:22 CET
I can't believe no one ever noticed this problem
Yes, it's a quite obvious bug, so not sure how it ended up there. The original GREETDELAY patch did not have this line of code for logging, so not sure when and where it was added. I would have also expected the compiler to catch this and at least throw a warning. Makes you wonder...
SSL / TLS Error on smtpsd and submission
Shailendra Shukla March 25, 2025 20:52 CET
Hi Roberto ,
I have recently upgraded my server as per the guide mentioned here on your site . The server is up and running and i have migrated the users to the new server . But few of the users are facing issue as below
SSL Error when configuring ports 465 smtpsd as outgoing server on Microsoft Outlook
2025-03-25 16:09:41.556666409 sslserver: ok 353235 abc.com:0.0.0.0:465 192.168.55.11::51082
2025-03-25 16:09:41.557265905 sslserver: fatal: (111) unable to accept TLS from: 192.168.55.11 for pid: 353235 unsupported protocol
TLS Error when configuring port 587 submission as outgoing server on Microsoft Outlook
2025-03-25 14:47:23.581863089 tcpserver: ok 328388 103.252.55.4:587 192.168.55.11::50786
2025-03-25 14:47:23.602716462 qmail-smtpd: read failed (tls connection failed): (null) from 192.168.55.11to (null) helo SAIPC
Also User cannot connect to Dovecot on imaps 993 port until I had to change the following setting in dovecot 10-ssl.conf
#ssl_min_protocol = TLSv1.1 if this is enabled user cannot connect from Microsoft Outlook 15
ssl_min_protocol = TLSv1 Once changed to this user was able to connect from Microsoft Outlook 15
Any pointers that you can guide me towards so that I can resolve these issues
Regards
SSL / TLS Error on smtpsd and submission
Roberto Puzzanghera Shailendra Shukla March 25, 2025 21:24 CET
I think that you have to allow SSLv3 in /var/qmail/control/tlsserverciphers, but you know that is an unsecure protocol, so do it at your own risk.
!SSLv3 should be deleted from that configuration file if you want to allow SSLv3. So /var/qmail/control/tlsservercipher will be
HIGH:MEDIUM:!MD5:!RC4:!3DES:!LOW:!SSLv2
Another method to allow *only* a particular domain is to touch control/notlshosts/FQDN where FQDN is the domain to allow. In this case all other domains advertising SSLv3 will be banned while microsoft will be allowed. But the important thing to know is that the TLS connection is skipped, so I don't know if it's what you want.
If you declare control/notlshosts_auto containing any number greater than 0 the TLS connection for remote servers with an obsolete TLS version is skipped, i.e. the control/notlshosts/FQDN is dinamically created for you and the next time it connects it will be allowed.
SSL / TLS Error on smtpsd and submission
Shailendra Shukla Roberto Puzzanghera March 26, 2025 04:05 CET
Its not about FQDN , has to do with the Email Client being used as these users are belonging to the same mydomain.tld. The incoming mail is not a issue at all. Its just the dovecot imaps 993 and the 465 smtpsd and 587 submission which is not functioning as it should with the old email client being used for this upgraded new version of the mail server.
I had to change the setting for dovecot 993 port in 10-ssl.conf to allow min
ssl_min_protocol = TLSv1 instead of the default ssl_min_protocol = TLSv1.1
Only this way the Email Client Microsoft Outlook was able to connect to the Imaps port .
I guess this has to do with the email client Microsoft Outlook version 15 etc . I will try with Mozilla ThunderBird which I personally use for my gmail account and has been working well for years now .
Also all these users are from the same domain mydomain.tld and are on a fixed subnet , any tweaking that can be done to facilitate these users without compromising the actual intended functionality of all the upgrades done .
SSL / TLS Error on smtpsd and submission
Roberto Puzzanghera Shailendra Shukla March 26, 2025 06:40 CET
So the client is using an obsolete protocol that your qmail is refusing. Try the first option in my message above
SSL / TLS Error on smtpsd and submission
Roberto Puzzanghera Roberto Puzzanghera March 26, 2025 08:22 CET
I would also make tests to find out if TLS 1.0 is sufficient or you have to open to SSLv3 as well
SSL / TLS Error on smtpsd and submission
Luis Roberto Puzzanghera June 9, 2025 21:30 CET
Hi Roberto,
Wanted to check if is correct, I had to change the supervise/qmail-smtpsd/run script to avoid above errors, I'm not getting errors while using SSL with Outlok client on port 465:
Uncomented from the run script:
export FORCETLS=0
export DISABLETLS=1
also commented out:
# qmail-spp plugins
#export HELO_DNS_CHECK=GNLR
#if [ ! -f $QMAILDIR/control/smtpplugins ] || [ ! -d $QMAILDIR/plugins ]; then
export ENABLE_SPP=0
#else
# export ENABLE_SPP=1
#fi
My control/tlsserverciphers:
HIGH:MEDIUM:!MD5:!RC4:!3DES:!LOW:!SSLv2:!SSLv3
I have TLS on port 587 and SSL on port 465 working OK using a Microsoft Outlook client.
Your supervise/qmail-submission/run script is working unchanged on port 587 using TLS on my system..
SSL / TLS Error on smtpsd and submission
Roberto Puzzanghera Luis June 9, 2025 21:48 CET
Yes it seems to be ok. TLS has to be disabled on port 465, while tlsciphers are useful on ports where tls is enabled, i.e. 25 and 587. I would leave on the helo dns check plugin also on 465 service
SSL / TLS Error on smtpsd and submission
Luis Roberto Puzzanghera June 9, 2025 22:27 CET
Thanks for your reply,
When HELO_DNS_CHECK is turned on with:
export HELO_DNS_CHECK=GNLR
, then I get the error:
2025-06-09 17:20:23.396401419 sslserver: tls 216997 accept TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384
2025-06-09 17:20:43.428969597 helo-dns-check: malformed HELO/EHLO [LUIS11] from [x.x.x.x]
2025-06-09 17:20:43.429043008 helo-dns-check: blocked with: malformed HELO/EHLO
and in Outlook displays:
The connection to the server was interrupted.
Maybe needs different options.
SSL / TLS Error on smtpsd and submission
Roberto Puzzanghera Luis June 10, 2025 07:19 CET
You are right. The helo dns check must disabled on 465 and 587 ports. I have to correct my example run scripts
SSL / TLS Error on smtpsd and submission
Luis Roberto Puzzanghera June 10, 2025 13:49 CET
Thanks Roberto, it is working with the new options now.
The new supervise/qmail-smtpsd/run script you posted is missong the &1 at the end of the last line.
Thank you for your support.
Error when sending email to external mail server not suport unicode
Jacky December 13, 2024 14:44 CET
Hi roberto puzzanghera
I have installed new version 2024.12.01 but got some error below.
How can I fix it?
Connected_to_27.86.106.68_but_server_does_not_support_unicode_in_email_addresses./Remote_host_said:_250-msmx.au.com/250-PIPELINING/250-SIZE_3145728/250-ETRN/250_8BITMIME/Connected_to_202.93.78.241_but_server_does_not_support_unicode_in_email_addresses./Remote_host_said:_250-mtagw0033.mail.otm.ynwp.yahoo.co.jp/250-PIPELINING/250-8BITMIME/250_SIZE_41943040/
Error when sending email to external mail server not suport unicode
Roberto Puzzanghera Jacky December 15, 2024 19:56 CET
I have evaluated this problem more carefully and checked the code again. The error that you reported
Connected_to_27.86.106.68_but_server_does_not_support_unicode_in_email_addresses./Remote_host_said:_250-msmx.au.com/250-PIPELINING/250-SIZE_3145728/250-ETRN/250_8BITMIME/Connected_to_202.93.78.241_but_server_does_not_support_unicode_in_email_addresses./Remote_host_said:_250-mtagw0033.mail.otm.ynwp.yahoo.co.jp/250-PIPELINING/250-8BITMIME/250_SIZE_41943040/
is triggered by qmail-remote when **sending** UTF8 characters. You don't have any Received header in your sent mail, therefore you don't have to worry about the Received header check. The connection is closed by your server because the outgoing message has UTF8 characters but the remote server does not advertise the SMTPUTF8 capability after the greeting, as can be seen in the above log line.
As you know, if a server can handle EAI, this is how the conversation must begin
# telnet 0 25
Trying 0.0.0.0...
Connected to 0.
Escape character is '^]'.
220 smtp.sagredo.eu ESMTP
ehlo test
250-smtp.sagredo.eu
250-STARTTLS
250-PIPELINING
250-SMTPUTF8
250-8BITMIME
250 SIZE 10000000
Error when sending email to external mail server not suport unicode
Roberto Puzzanghera Jacky December 13, 2024 14:56 CET
Hi Jacky,
it is related to the new EAI feature. It means that you are receiving a message with UTF8 characters, but the remote server is violating the RFC protocol, as it's not advertising the SMTPUTF8 verb after the MAIL FROM. So the connection is closed by your server just like if it was garbage.
You could enable recordio in your qmail-smtpd and check if this is the case. The MAIL FROM field in the smtp conversation should look like this if one of the addresses brings special characters:
MAIL FROM:<òòòò@remoteserver.tld> SMTPUTF8
RCPT TO:<mimì@yourserver.tld>
you can test yourself your server telnetting in that way.
Possibly you have addresses with special characters that you can allow. Be aware that things are changed a bit in this new release.
Error when sending email to external mail server not suport unicode
Roberto Puzzanghera Roberto Puzzanghera December 13, 2024 15:21 CET
Sorry, the error appears at qmail-remote level, so it's because you are sending special characters in the from and/or rcpt address, but the remote server is not advertising the SMTPUTF8 after the greeting, so the conversation is closed by you.
Error when sending email to external mail server not suport unicode
Roberto Puzzanghera Roberto Puzzanghera December 13, 2024 15:13 CET
PS: if you want to add additional special characters to the alphanumeric set, look for the CHKUSER_ALLOWED_CHARS variable at the bottom of chkuser_settings.h in the source. Then recompile and restart qmail
Error when sending email to external mail server not suport unicode
Jacky Roberto Puzzanghera December 13, 2024 17:20 CET
Hi roberto puzzanghera
Thank you for your advice.
I have also checked checkutf8message() functions in eai.c file.
it not only check characters in the from and/or rcpt address but also check Received: header has [UFT8] character
Received: header with UTF8
Received: from xxx (xxxx)
by mail4 with UTF8SMTPS (TLS_AES_128_GCM_SHA256 encrypted); 13 Dec 2024 14:55:01 +0900
Received: header without UTF8
Received: from xxx (xxx)
by mail4. with SMTP; 13 Dec 2024 10:07:55 +0900
Should we check Received: header?
Error when sending email to external mail server not suport unicode
Roberto Puzzanghera Jacky December 13, 2024 18:51 CET
According to the RFC5336 https://datatracker.ietf.org/doc/html/rfc5336#section-3.2
An SMTP server that announces this extension MUST be prepared to accept a UTF-8 string [RFC3629] in any position in which RFC 2821 specifies that a mailbox can appear.
so yes... let me understand why it can be a problem for you.
Error when sending email to external mail server not suport unicode
Jacky Roberto Puzzanghera December 15, 2024 04:51 CET
Hi Roberto Puzzanghera
I don’t doubt RFC5336, but after checking all the headers in the email, there were no UTF-8 characters.
However, just because there was a UTF8SMTP string in the Received header, the email couldn’t be sent externally, which seems a bit strange. I’m considering removing the check for the Received header or using an older version.
Error when sending email to external mail server not suport unicode
Roberto Puzzanghera Jacky December 15, 2024 07:16 CET
And this is always happening or just for a specific mail? How can I reproduce it? Send me more details please
Error when sending email to external mail server not suport unicode
Jacky Roberto Puzzanghera December 15, 2024 10:22 CET
Hi roberto puzzanghera
That just happened with 3 marketing emails.
I am currently testing version 2024-12-01 and debugging it on one server.
If this issue keeps happening, I will contact you.
Error when sending email to external mail server not suport unicode
Jacky Jacky December 24, 2024 01:59 CET
Hi Roberto Puzzanghera
After debugging for a week, everything is stable, and no errors have occurred with this patch.
Thank you for your advice.
Error when sending email to external mail server not suport unicode
Roberto Puzzanghera Jacky December 24, 2024 06:53 CET
Thanks to you for the feedback!
qmail-remove_chkuser_vpopmail.patch
Ernesto November 14, 2024 01:00 CET
Hi Roberto, thanks for your awesome work and support.
I tried to patch QMAIL_VERSION=2024.10.26 with qmail-remove_chkuser_vpopmail.patch, but failed at hier.c, I think because of this line which is not in the context lines of the relevant portion of the patch:
d(auto_qmail,"control/notlshosts",auto_uidr,auto_gidq,0755);
It also refused to delete chkuser_settings.h.
Regards!
qmail-remove_chkuser_vpopmail.patch
Roberto Puzzanghera Ernesto November 14, 2024 05:54 CET
Unfortunately I don't have the time to upgrade that patch. But you can use the specific github branch where chkuser has been dropped
Latest stable version
Steve Owens November 1, 2024 17:15 CET
The top of this document says that the latest stable version is v2024.10.26. But since that version does not even compile I would hardly call it stable.
root@mail:~/qmail# git branch
* (HEAD detached at v2024.10.26)
main
netqmail-1.06
root@mail:~/qmail# make setup check
./compile chkuser.c
chkuser.c:39:10: fatal error: vpopmail.h: No such file or directory
39 | #include "vpopmail.h"
| ^~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:333: chkuser.o] Error 1
The only branch I have seen that compiles without error so far is netqmail-1.06. The remaining branches fail to complete the make process
Latest stable version
Roberto Puzzanghera Steve Owens November 1, 2024 18:01 CET
It compiles for those who read the docs. You didn't install vpopmail. I would pay more respect when approaching a free product, expecially when not giving any kind of contribution to it, or switch to commercial software
Issue report
Steve Owens November 1, 2024 16:12 CET
I am following the setup instructions here on a debian host (Ubuntu). They are pretty straightforward. I followed the instructions to the point where it got to t
- Download and compile
make make setup check
Make ran the first time but then running make setup check yields the following output:
root@mail:~/qmail# make setup check
( ./auto-uid auto_uida `head -1 conf-users` \
&&./auto-uid auto_uidd `head -2 conf-users | tail -1` \
&&./auto-uid auto_uidl `head -3 conf-users | tail -1` \
&&./auto-uid auto_uido `head -4 conf-users | tail -1` \
&&./auto-uid auto_uidp `head -5 conf-users | tail -1` \
&&./auto-uid auto_uidq `head -6 conf-users | tail -1` \
&&./auto-uid auto_uidr `head -7 conf-users | tail -1` \
&&./auto-uid auto_uids `head -8 conf-users | tail -1` \
&&./auto-uid auto_uidv `head -9 conf-users | tail -1` \
&&./auto-gid auto_gidq `head -1 conf-groups` \
&&./auto-gid auto_gidn `head -2 conf-groups | tail -1` \
&&./auto-gid auto_gidv `head -3 conf-groups | tail -1` \
) > auto_uids.c.tmp && mv auto_uids.c.tmp auto_uids.c
fatal: unable to find user alias
make: *** [Makefile:121: auto_uids.c] Error 111
IT may be entirely possible that maike failed the first time as well, I can't scroll back that far to see. At any rate running make now yields the same result as make setup check. It seems like there needs to be certain user preconditions met or something but nothing in the documentation mentions this.
Issue report
Roberto Puzzanghera Steve Owens November 1, 2024 16:56 CET
I guess you forgot to create the qmail users
Recompiling qmail error
Shailendra Shukla October 20, 2024 08:50 CET
Hi Roberto,
I am getting the following error while recompiling qmail below are the details
QMAIL_VERSION=2024.06.08
Openssl Version
OpenSSL 1.0.1e-fips 11 Feb 2013
./compile qmail-remote.c
qmail-remote.c: In function âtls_initâ:
qmail-remote.c:437: error: âOPENSSL_INIT_LOAD_SSL_STRINGSâ undeclared (first use in this function)
qmail-remote.c:437: error: (Each undeclared identifier is reported only once
qmail-remote.c:437: error: for each function it appears in.)
qmail-remote.c:438: warning: passing argument 1 of âSSL_CTX_newâ makes pointer from integer without a cast
/usr/include/openssl/ssl.h:1630: note: expected âconst struct SSL_METHOD *â but argument is of type âintâ
make: *** [qmail-remote.o] Error 1
Regards
Shailendra
Recompiling qmail error
Roberto Puzzanghera Shailendra Shukla October 20, 2024 15:13 CET
Hi Shailendra, this is because of your old openssl version. You have to choose between one of the following options
- upgrade your openssl (I woudn't do it if I don't know which other package must be recompiled (openssh?))
- use an old qmail patch of mine, downloading it from the archive https://notes.sagredo.eu/files/qmail/patches/roberto-netqmail-1.06/. Just pick up the one with the date around your OS release and try. I think at least 10/12 years ago for openssl v. 1.0
- download my latest qmail, manually remove the qmail-tls patch from f.v., then add an old version of the same patch. You can find all qmail-tls patches here https://notes.sagredo.eu/files/qmail/patches/tls/. Just look for the one where the string OPENSSL_INIT_LOAD_SSL_STRINGS is not matched by grep
Recompiling qmail error
Roberto Puzzanghera Roberto Puzzanghera October 20, 2024 21:06 CET
It appears that the tls patch released in 2020 compiles successfully against openssl v. 1.0
Adjustments in qmail-remote for sending emails with TLS to older servers?
Alexandre Fonceca September 19, 2024 18:14 CET
Hello everyone,
I found an error with the delivery of some emails involving TLS.
When using a server with a newer version of OpenSSL, TLS 1.0 and 1.1 were left out, leaving only 1.2 and 1.3. However, because of this, qmail-remote, when delivering emails to older servers, generates a TLS/SSL error and the email returns to the queue.
Error example: delivery 50838: deferral: TLS_connect_failed:_error:0A00018A:SSL_routines::dh_key_too_small;_connected_to_187.8.50.70. (but there are other types).
However, qmail will NEVER attempt to send without TLS to these servers since they report that they support STARTTLS in the connection. Perhaps some adjustment in qmail-remote could be made so that when a TLS/SSL error occurs, it adds the domain's MX FQDN to /var/qmail/control/notlshosts/, so that on the next delivery attempt, it sends without using STARTTLS.
I even found government servers with outdated TLS, which would not receive emails until I added their FQDN to /var/qmail/control/notlshosts for qmail to send without using TLS.
Best regards,
Adjustments in qmail-remote for sending emails with TLS to older servers?
Roberto Puzzanghera Alexandre Fonceca October 26, 2024 20:41 CET
fixed in version 2024.10.26
Adjustments in qmail-remote for sending emails with TLS to older servers?
Shah Imran Alexandre Fonceca October 21, 2024 09:43 CET
Hi,
I'm also getting "dh_key_too_small" error while delivering mail to some host. Following are some example host where I get dh_key_too_small error.
itokin.com.hk
mail1.tfzipper.com
mail4.optimaxbd.net
mailgw1e.hk2china.com
mail.mekodenim.com.pk
mail.pot-bd.com
There are many hosts that does not accept mail until I add to /var/qmail/control/notlshosts/. I think there should be an automated script that will add file to /var/qmail/control/notlshosts/ location.
I'm running Debian Bookworm, OpenSSL 3.0.14 4 Jun 2024 (Library: OpenSSL 3.0.14 4 Jun 2024)
Thanks.
Adjustments in qmail-remote for sending emails with TLS to older servers?
Roberto Puzzanghera Shah Imran October 21, 2024 18:08 CET
I still have to reproduce this issue, I'll try again.
For me, we can add Alexandre's patch but I would require that the user enables the functionality by means of a control file, say control/enablenotlshosts, where to put 1 inside, just to avoid unwanted surprises for those who don't want to allow clients with obsolete tls
Alexandre, do you have upgrades for your patch?
Adjustments in qmail-remote for sending emails with TLS to older servers?
Alexandre Fonceca Roberto Puzzanghera October 21, 2024 19:13 CET
I'm using the patch I made above in production, and it has been working... since that day until today, I have 97 hosts that only support TLS 1.0 or 1.1, and since I don't have support for that, it results in an error. Then it adds the host to notlshosts, and on the next attempt, it sends without using any TLS
Adjustments in qmail-remote for sending emails with TLS to older servers?
Roberto Puzzanghera Alexandre Fonceca October 22, 2024 19:46 CET
Can you guys give this patch a try?
git clone -b fix-dh_key_too_small https://github.com/sagredo-dev/qmail.git
you need to enable the feature defining control/notlshosts_auto with a value greater than 0
Adjustments in qmail-remote for sending emails with TLS to older servers?
Roberto Puzzanghera Alexandre Fonceca September 23, 2024 18:15 CET
I cannot reproduce this issue. I'm sending to a remote server (openssl 0.9.8 with TLS 1.1 not available) and my remote messages have been sent by qmail-remote with no errors.
It would be great if you can mention a public server with an old openssl, to use for a quick test
Adjustments in qmail-remote for sending emails with TLS to older servers?
Roberto Puzzanghera Alexandre Fonceca September 19, 2024 18:48 CET
which version of my qmail package or TLS patch are you using? According to my logs, I haven't had a TLS_connect_failed error for the past 6 years now.
Adjustments in qmail-remote for sending emails with TLS to older servers?
Alexandre Fonceca Roberto Puzzanghera September 19, 2024 18:55 CET
I'm using the latest version, qmail-2024.06.08, compiled on Debian 12.
Testing the remote hosts that showed an error with 'openssl s_client -connect XXXX:25 -starttls,' I see that they still support TLS 1.0 or 1.1, while the version compiled on Debian 12 supports only 1.2 or 1.3.
Adjustments in qmail-remote for sending emails with TLS to older servers?
Roberto Puzzanghera Alexandre Fonceca September 19, 2024 18:58 CET
which version of openssl is installed in debian 12? I'll try to reproduce the issue in the following days, but I think that this is something to submit to f.vermeulen attention
Adjustments in qmail-remote for sending emails with TLS to older servers?
Alexandre Fonceca Roberto Puzzanghera September 19, 2024 19:01 CET
OpenSSL 3.0.13 30 Jan 2024 (Library: OpenSSL 3.0.13 30 Jan 2024)
Adjustments in qmail-remote for sending emails with TLS to older servers?
Alexandre Fonceca Alexandre Fonceca September 19, 2024 19:14 CET
I made a temporary (ugly?) solution here that worked... when a TLS error is generated, it adds the FQDN to notlshosts.
In qmail-remote.c, in the function void tls_quit(const char *s1, const char *s2),
I changed from:
void tls_quit(const char *s1, const char *s2)
{
out((char *)s1); if (s2) { out(": "); out((char *)s2); } TLS_QUIT;
}
to:
void tls_quit(const char *s1, const char *s2)
{
FILE *fp; // ACF
char acfcommand[1200]; // ACF
sprintf(acfcommand, "/bin/touch /var/qmail/control/notlshosts/'%s'", partner_fqdn);
fp = popen(acfcommand, "r");
if (fp == NULL) {
printf("Failed to run command\n" );
exit(1);
}
pclose(fp);
out((char *)s1); if (s2) { out(": "); out((char *)s2); } TLS_QUIT;
}
Note that /var/qmail/control/notlshosts needs to have ownership qmailr:qmail so that it can write to it!
I’m currently using this on a test server to see if I don’t accidentally cause another issue... before moving it to production.
Re: Adjustments in qmail-remote for sending emails with TLS to older servers?
Roberto Puzzanghera Alexandre Fonceca April 20, 2026 20:25 CET
Just to advise anyone still using the above code that it introduces a vulnerability. Fixed here https://github.com/sagredo-dev/qmail/pull/42
Adjustments in qmail-remote for sending emails with TLS to older servers?
Roberto Puzzanghera Alexandre Fonceca September 19, 2024 19:17 CET
Great! Let us know if it works
compile with vpopmail, use a different virtual mail mgr?
pcg June 20, 2024 20:34 CET
Greetings,
Short question: can I compile netqmail with your unified patch, and then just ignore the vpopmail piece?
Long question: I have a very old qmail installation that I've been carrying along from CentOS to CentOS version. It's currently on CentOS 7 and built from Bruce Guenter's old RPMs, but it's time to modernize and I'm looking at building from scratch+patch. However, we do not use vpopmail (and will not be using it), but rather use a different virtual mail manager.
Is it possible to use this unified patch, but effectively ignore vpopmail after install? I'm perfectly capable of changing permissions, ownership, run scripts, and the like, but without having built this before, it's unclear whether vpopmail is so heavily integrated into this package as to render the package unusable if vpopmail is unused.
Thanks in advance!
Peter
compile with vpopmail, use a different virtual mail mgr?
Roberto Puzzanghera pcg June 20, 2024 21:19 CET
you can use without it but it won't compile. So install vpopmail and then forget about. Also disable chkuser.
Or you can try to remove chkuser and the call to vpopmail from the Makefile. It's not difficult to do.
compile with vpopmail, use a different virtual mail mgr?
Roberto Puzzanghera Roberto Puzzanghera June 26, 2024 16:36 CET
you have here a patch to remove chkuser and vpopmail from the sources https://github.com/sagredo-dev/qmail/blob/main/other-patches/qmail-remove_chkuser_vpopmail.patch
If you prefer to do it manually, be aware that the "control/cache" dir and the control/*.pem files have to be owned by the user who runs qmail-smtpd, so you should adjust the update_tmprsadh.sh file
version 2024.06.08 not found
Chava2b June 12, 2024 09:08 CET
Hi Roberto
When I try to download https://github.com/sagredo-dev/qmail/archive/refs/tags/v2024.06.08.tar.gz, the file is indicated like not found (404)
Could you verify ?
Thanks
version 2024.06.08 not found
Chava2b Roberto Puzzanghera June 12, 2024 12:58 CET
It's OK, thank you.
Upgrading from netqmail-1.06 to github version
idollar March 18, 2024 22:56 CET
Hello Roberto,
Thanks a lot for all your work. I would not be able to have my own server if wouldn´t be because of your patch.
I am running a qmail patched with netqmail-1.06 in my mail server. The server is 100% configured and operational.
I need to add DKIM support.
I downloaded your version from the github and compiled without any issue.
From your notes, I understand that the installation would simply consist on executing:
qmailctl stop
rm -r /var/qmail/queue
make setup
qmailctl start
My question is simple ... would this keep my old configuraiton and add qmail-dkim ?
If the answer is positive, i believe that I should just upgrade, wait to ensure compatibility and configure dkim after some days.
Am I correct ?
Thanks for your support !
i$
Upgrading from netqmail-1.06 to github version
Roberto Puzzanghera idollar March 19, 2024 09:10 CET
Hi, probably your current DKIM configuration won't work as it was revised recently. After the upgrade you should refer to the dkim documentation
Upgrading from netqmail-1.06 to github version
idollar Roberto Puzzanghera March 19, 2024 09:29 CET
Hello Roberto,
Apologies, I was not clear enough.
Let me try again:
- My current netqmail-1.06 does not have DKIM configured nor enabled
- I noticed the new way to configure DKIM, this is why ...
- ... I have compiled a new qmail GITHUB_based version without any problem.
If I install the upgraded qmail (github_based) using the following procedure:
qmailctl stop
rm -r /var/qmail/queue
make setup
qmailctl start
Will my old configuration remain and work ?
In case of a positive answer, I will upgrade first to then configure DKIM following the new procedure.
Many thanks !
Regards
Upgrading from netqmail-1.06 to github version
Roberto Puzzanghera idollar March 19, 2024 09:41 CET
Yes, your old configuration will work
Upgrading from netqmail-1.06 to github version
idollar Roberto Puzzanghera March 19, 2024 21:59 CET
Thanks a lot Roberto,
I has worked perfectly.
Thanks !
qmail package
George Smith January 24, 2024 07:34 CET
May I ask if your qmail package (included patches) can be installed in CentOS 5.3?
When I run "make setup check", it stops with a number of errors.
srs.c:3:37: error: /usr/local/include/srs2.h: No such file or directory
srs.c: In function ‘srsforward’:
srs.c:86: error: ‘srs_t’ undeclared (first use in this function)
........
srs.c:144: error: ‘SRS_SUCCESS’ undeclared (first use in this function)
make: *** [srs.o] Error 1
If I download netqmail-1.06.tar.gz and patch dkim-netqmail-1.06.patch-1.46 , it compile successfully. However, there is a lot of error if I add other patches. It cannot send email at all.
Please advise how I can install the qmail-dkim into our qmail installed in CentOS 5.3. Thanks a lot!
qmail package
Roberto Puzzanghera George Smith January 24, 2024 07:51 CET
Hi, my qmail requires the libsrs2 library. Read the docs above.
Concerning the other problem, building a composite patch is a bit complicated and for me mantaining my one is enough. It would be impossible to teach how to do that in this reply, also because it is beyond the scope of this guide, sorry
Where can I download the roberto-netqmail-1.06.patch-20240120.gz ?
Pablo Murillo January 22, 2024 02:13 CET
Hi
I'm a little old :D, and I really don't like github :D
Ajajajajaja
I was from the very old school, ftp, download links, and everyone working on its own :D
Aajajaja
Where can I download the roberto-netqmail-1.06.patch-20240120.gz ?
Roberto Puzzanghera Pablo Murillo January 22, 2024 14:21 CET
Hi Pablo :-), I'm old school too but there's no github knowledge required... just take the time to read the new instructions and you'll find the link :-)
Where can I download the roberto-netqmail-1.06.patch-20240120.gz ?
Pablo Murillo Roberto Puzzanghera January 22, 2024 22:32 CET
Hi again ! :D
I can't find the old format (1 file patch), I only see the qmail source allready patched :D
What I'm missing ?
Where can I download the roberto-netqmail-1.06.patch-20240120.gz ?
Roberto Puzzanghera Pablo Murillo January 22, 2024 22:38 CET
Pablo, there's no patch anymore. You have to download the patched sources, then unpack. It's explained at the top of this page. Just cut and paste the code. No need to use git
Where can I download the roberto-netqmail-1.06.patch-20240120.gz ?
Pablo Murillo Roberto Puzzanghera January 22, 2024 23:59 CET
ok, thanks
As I was talking with some friends, programming now is for lazy people, now, nobody knows what are using, nobody know what is a patch, nobody ever read a source file !
Neither patches, now, I want the file alredy patched
Ajajajja
The way we did software is dead !
A guy who works with phyton told me that he use chat gtp to wrote code !
We are going to become extinct in a few years
ajajajajj
Where can I download the roberto-netqmail-1.06.patch-20240120.gz ?
Roberto Puzzanghera Pablo Murillo January 23, 2024 16:18 CET
and nobody ever read the docs! :-)
About CVE-2023-51765
Jacky January 18, 2024 13:39 CET
Hi roberto puzzanghera
I am not sure but I think qmail-liberal-lf patch in our patch is affeted with CVE-2023-51765
Is that correct?
About CVE-2023-51765
Roberto Puzzanghera Jacky January 21, 2024 08:41 CET
I released an update which denies bare LF by default. Now bare LF can be allowed by defining ALLOW_BARELF in tcprules or in the run file
About CVE-2023-51765
Roberto Puzzanghera Jacky January 18, 2024 20:08 CET
I did the tests here and found out that my package is vulnerable to smuggling. Removing the liberal-lf solves.
I uploaded my changes here in a testing branch. I'll relase a new package in the following days if further tests without that patch are ok. If you want to try it you are welcome.
Thanks for the advice!
PS this is the reject logline of my server once I repaired it
2024-01-18 20:45:15.679975634 qlogenvelope: result=rejected code=451 reason=bad_newlines detail= helo=check.smtpsmuggling.com mailfrom=test@check.smtpsmuggling.com rcptto= relay=yes rcpthosts= size=268 authuser= authtype= encrypted= sslverified=no localip=10.0.0.4 localport=25 remoteip=10.0.0.4 remoteport=43466 remotehost=smtp.sagredo.eu qp=31931 pid=31923
About CVE-2023-51765
Roberto Puzzanghera Jacky January 18, 2024 14:35 CET
Honestly I didn't have the time to dig into it, just read discussions in qmail lists
PS if anyone can play with these test tools concerning the alleged smuggling security issue it would be welcome https://github.com/The-Login/SMTP-Smuggling-Tools
Compiling error when chkuser is enabled
Gabriel Torres January 16, 2024 14:57 CET
Hi,
When I enable chkuser with the 2024.01.15 version, I get a compilation error:
chkuser.c:953:45: warning: implicit declaration of function ‘vmaildir_readquota’ [-Wimplicit-function-declaration]
953 | if (vmaildir_readquota(tmp_path.s,format_maildirquota(user_passwd->pw_shell))
| ^~~~~~~~~~~~~~~~~~
make: *** [Makefile:333: chkuser.o] Error 1
However, with the 2024.01.05 version, I don't get this error...
Thanks.
Compiling error when chkuser is enabled
Roberto Puzzanghera Gabriel Torres January 16, 2024 17:02 CET
weird... this part wasn't touched during latest upgrade. It's not recognizing your vpopmail installation directory.
can you do this from the qmail source directory?
/bin/sh vpopmail-dir.sh
it should output your vpopmail installation directory
Compiling error when chkuser is enabled
Roberto Puzzanghera Gabriel Torres January 16, 2024 14:59 CET
Hi Gabriel, which Linux distribution and which gcc version?
Compiling error when chkuser is enabled
Gabriel Torres Roberto Puzzanghera January 17, 2024 01:17 CET
Hi Roberto,
Thanks for trying to help me.
I tried to compile the 2024.01.05 version again with chkuser enabled, and the same error is now showing up. So I must correct what I said before. The error is showing up regardless of the version now. If I disable chkuser in chkuser_settings.h, the error doesn't show up.
Answering your questions:
Running /bin/sh vpopmail-dir.sh replies /home/vpopmail, which is the correct path.
Here we use Debian 12.4 and gcc (Debian 12.2.0-14) 12.2.0.
Thank you in advance.
Gabriel.
Compiling error when chkuser is enabled
Roberto Puzzanghera Gabriel Torres January 17, 2024 15:53 CET
got it! The actual error was before the line you reported
chkuser.c:124:2: error: #error "chkuser setting error: CHKUSER_ALWAYS_ON and CHKUSER_STARTING_VARIABLE are mutually esclusive. Edit your chkuser_settings.h and disable one of them"
124 | #error "chkuser setting error: CHKUSER_ALWAYS_ON and CHKUSER_STARTING_VARIABLE are mutually esclusive. Edit your chkuser_settings.h and disable one of them"
| ^~~~~
so you have enabled chkuser by removing the comment on the variable CHKUSER_ALWAYS_ON, which is commented by default. In this case, as reported in the error message, you have to comment CHKUSER_STARTING_VARIABLE.
Be aware that enabling chkuser in this way prevents the possibility of disabling it in the run file.
Compiling error when chkuser is enabled
Roberto Puzzanghera Gabriel Torres January 17, 2024 15:29 CET
Hi Gabriel, it compiles with no errors here on Debian 12...
can you verify that the file /home/vpopmail/etc/lib_deps exists and that the libriaries listed in that file are linked?
ldd /home/vpopmail/bin/vadddomain
Compiling error when chkuser is enabled
Gabriel Torres Roberto Puzzanghera January 18, 2024 01:40 CET
Hi Roberto,
Actually the whole thing was my mistake. I followed your guide, at Configuring chkuser, you say to uncomment the #define lines, and I edited the chkuser_settings.sh and removed the starting # from those lines thinking that # meant "comment". I am not well versed in the C language. Only after you last message I understood that commenting is done with /* and */ and I shouldn't have touched the #define lines, because they were already uncommented in the chkuser_settings.sh inside the .tar.gz file you provide, I belive the whole "Configuring chkuser" section listing each #define line is completely unecessary and should be removed, so other people don't do the same mistake as I did.
Or at least the wording should be changed to say that the reader must COMMENT those lines if he wants to disable each one of the features -- since they are already enabled. If you read carfuly, you say that those lines must be "uncommented", but they are already uncommented...
Cheers,
Gabriel.
Compiling error when chkuser is enabled
Roberto Puzzanghera Gabriel Torres January 18, 2024 06:28 CET
Ok... I'll try to improve that section. Unfortunately I don't think I have chances to do the same with my english :-)
New qmail-TLS patch has been released
Greg Bell January 15, 2024 01:47 CET
Hi, the qmail-tls patch has been updated by its author to support OpenSSL v3. (Until now, OpenSSL 1.1 support was required, which some linuxes have been dropping i.e. debian!)
New patch is: http://inoa.net/qmail-tls/notqmail-1.08-tls-20231230.patch
I am going to try to manually figure out how to apply this to my build (at the moment based on roberto 2020.12.04) , but meanwhile I wanted to let you know so you could update the new distribution. Some day soon I would like to update mine to a use a more recent sagredo distribution :)
New qmail-TLS patch has been released
Roberto Puzzanghera Greg Bell January 15, 2024 15:30 CET
I merged your changes to my tree on github. In my Slackware I still have the old openssl-1.1 version. Did you test everything on Debian/openssl-3?
New qmail-TLS patch has been released
Greg Bell Roberto Puzzanghera January 15, 2024 16:07 CET
Yes I am running "my" version as of yesterday night and it is alive and fine. ldd command on qmail-remote and qmail-smtpd indicate they are linked with libssl 3 :)
New qmail-TLS patch has been released
Roberto Puzzanghera Greg Bell January 15, 2024 06:02 CET
Thanks for the advice. I'll upgrade my patch
Download of qmail not found
Bob January 4, 2024 17:58 CET
wget https://github.com/sagredo-dev/qmail/archive/refs/tags/v${QMAIL_VERSION}.tar.gz
--2024-01-04 11:53:59-- https://github.com/sagredo-dev/qmail/archive/refs/tags/v2024.01.04.tar.gz
Resolving github.com (github.com)... 140.82.112.4
Connecting to github.com (github.com)|140.82.112.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/sagredo-dev/qmail/tar.gz/refs/tags/v2024.01.04 [following]
--2024-01-04 11:54:00-- https://codeload.github.com/sagredo-dev/qmail/tar.gz/refs/tags/v2024.01.04
Resolving codeload.github.com (codeload.github.com)... 140.82.114.9
Connecting to codeload.github.com (codeload.github.com)|140.82.114.9|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2024-01-04 11:54:00 ERROR 404: Not Found.Download of qmail not found
Roberto Puzzanghera Bob January 4, 2024 20:55 CET
2023.01.04 was removed. Use 2023.01.05
qmail-smtpd for submission - block auth attemp / dont wait , drop
miki October 27, 2023 07:55 CET
Hi,
Im looking if its possible to have some control file for qmail or mechanism for dropping auth attemp for certain emails ?
like: qmail-smtpd[2706450]: auth: auth-failed type=login user=<mailer-daemon@com.com>
qmail-smtpd: read failed (connection closed by the client before the quit cmd): (null) from 195.190.115.42 to (null) helo mxv.trucksparts.ru
its piling up and fail2ban dont really help, as each auth is from different IPs once.
im looking if there is way to have /control/blockauth kind of file , where i put for example mailer-daemon@com.com and qmail-smtp or sslserver will just close conenction imediately
similar way as badrcptto is working.
thank you
qmail-smtpd for submission - block auth attemp / dont wait , drop
Roberto Puzzanghera miki October 27, 2023 08:34 CET
There's no options like this, but you can use control/authsenders to redirect the Auth of certain users to a different (unexistent) port. Look at the man for more info
qmail-smtpd for submission - block auth attemp / dont wait , drop
miki Roberto Puzzanghera October 27, 2023 11:10 CET
Hi,
thnx for hint, but authsender are for ourtgoing smtp . im looking for incoming auth conenction / where bots are trying to login with some crendentials of non existen accounts
i want qmail to drop connection once a certain login name is used /dotn wait for auth, drop it/
seems no way round this
anyway, thnx
miki
Please add "senderip" patch to allow specific domain to use specific outgoing IP
Shah Imran October 20, 2023 16:55 CET
Hi, Please add "senderip" patch so that specific domain can use specific IP for outgoing mail. JMS has this patch at: https://qmail.jms1.net/patches/combined-details.shtml#:~:text=domain:1.2.3.4
Please add
Roberto Puzzanghera Shah Imran October 20, 2023 17:08 CET
Hi, I cannot find the patch source at the link you provided
Please add "senderip" patch
Shah Imran Roberto Puzzanghera October 21, 2023 06:29 CET
hi,
Thanks for your reply. I also searched in the web, but did not find any patch. As I'm not a programmer, so it's really difficult for me to identify what's inside the code. But original qmail-1.03 holds following codes in timeoutconn.c file. Hope this can enlighten expert like you:
timeoutconn.c: struct constmap senderip ;
timeoutconn.c: switch ( control_readfile ( &stext , "control/senderip" , 0 ) )
timeoutconn.c: if ( ! constmap_init ( &senderip , stext.s , stext.len , 1 ) )
timeoutconn.c: chosenip = constmap ( &senderip , domain.s , domain.len ) ;
below are the difference after applying the patch:
timeoutconn.c: struct constmap senderip ;
timeoutconn.c: switch ( control_readfile ( &stext , "control/senderip" , 0 ) )
timeoutconn.c: if ( ! constmap_init ( &senderip , stext.s , stext.len , 1 ) )
timeoutconn.c: chosenip = constmap ( &senderip , domain.s , domain.len ) ;
timeoutconn.c.orig: struct constmap senderip ;
timeoutconn.c.orig: switch ( control_readfile ( &stext , "control/senderip" , 0 ) )
timeoutconn.c.orig: if ( ! constmap_init ( &senderip , stext.s , stext.len , 1 ) )
timeoutconn.c.orig: chosenip = constmap ( &senderip , domain.s , domain.len ) ;
Binary file timeoutconn.o matches
Hope this can give you some clue.
thanks.
Please add
Roberto Puzzanghera Shah Imran October 21, 2023 07:12 CET
Hi, it's not an easy task. Please understand that I'm not in the position to fullfill personal requests for free...
Please add
Shah Imran Roberto Puzzanghera October 21, 2023 08:32 CET
OK, I'll try to figure it out. If I succeed, I'll post here so that everybody can get benefited.
thanks.
Please add
Shah Imran Shah Imran November 11, 2023 09:50 CET
Hi,
I've found that patch. Below is the patch. Requesting you to add it in your combined patch.
Patch link: https://qmail.jms1.net/patches/newbind.patch
BR
newband patch
William Silverstein Shah Imran May 16, 2025 16:05 CET
You can always add the patch yourself.
However, it won't link unless you add an extern prior to the reference in tcp-env.c.
I have not fully tested it yet, but will. I am not sure what will happen if you use the outgoingip and senderip file at the same time.
Please add
Roberto Puzzanghera Shah Imran November 11, 2023 11:43 CET
Hi, I think I already replied to your request above
libdomainkeys-openssl-1.1 for OpenSSL 3.0.9
João September 14, 2023 03:20 CET
Hi,
I'm trying to compile qmail in Debian 12 that come with OpenSSL 3.0.9 and I'm getting some errors. Is there any way to compile with OpenSSL 3.0.9?
Thanks
Joao
libdomainkeys-openssl-1.1 for OpenSSL 3.0.9
Roberto Puzzanghera João September 14, 2023 06:09 CET
Hi, libdomainkeys is no longer a prerequisite of my patch. Qmail compiles with no errors here.
libdomainkeys-openssl-1.1 for OpenSSL 3.0.9
João Roberto Puzzanghera September 14, 2023 19:19 CET
Hello, Roberto, thank you for replying.
I'm using your patch but my vpopmail authentication is cdb. Do I need libdomainkeys?
Thanks
Joao
libdomainkeys-openssl-1.1 for OpenSSL 3.0.9
Roberto Puzzanghera João September 14, 2023 20:21 CET
No. It was a prerequisite of the dkim program inside qmail, to sign messages with the old domainkeys signature. Now that part has been dropped, so we can forget about libdomainkeys
ARC authentication
Chava2b July 19, 2023 08:39 CET
Hello Roberto
Sometimes the email recipients make a redirection to their Gmail box. Then the DKIM and SPF systems no longer work and emails are considered to be spam.
I read that it was possible to add an ARC signature (Authenticated Received Chain).
Do you know and what do you think of this system. Would this system suit the problem of redirects? Do you know if a patch exists to add this signature?
Thanks
ARC authentication
Roberto Puzzanghera Chava2b July 19, 2023 12:38 CET
Hi, is the forward performed by qmail or via sieve rules? In the first case SRS can be the solution, as you know.
I haven't played with ARC yet. But I think that in case of a sieve rule qmail can't do much, because the decision of forwarding the message is up to the LDA and it should be the LDA (dovecot) to change the header and add the ARC certification... in this case I would look for a dovecot plugin.
On the qmail side, did you have a look at https://github.com/mbirth/mail-arc?
Let me know if you find something interesting
PS an idea can be to modify that python and prepend it in the .qmail so that it can do the ARC stuff before passing the message to dovecot
ARC authentication
Chava2b Roberto Puzzanghera July 19, 2023 13:43 CET
Roberto, redirection is not done from my server. My problem is when I send an external email to abc@domain.com and that abc@domain.com makes a redirection to a Gmail account. The email goes to spam at Gmail because the SPF and DMARC are no longer good.
I find so little information on arc certification that I do not know if this certification must be added before I send the email by my Qmail server or if it is the external server when it makes the transfer. .. I continue to seek;)
ARC authentication
Roberto Puzzanghera Chava2b July 19, 2023 13:52 CET
So it's not your server responsibility to certify with ARC those forwards for you. That remote server can use ARC or better SRS. Your server is already providing its credentials when it uses SPF and/or DKIM correctly
ARC authentication
Anonymous Roberto Puzzanghera July 19, 2023 14:03 CET
Well, I have a job less ;) Thanks
ARC authentication
Roberto Puzzanghera Anonymous July 19, 2023 14:25 CET
You will have when you forward via sieve :-)
ARC authentication
Chava2b Roberto Puzzanghera July 19, 2023 14:48 CET
For the moment, I have not installed Dovecot/Sieve as it is not tempted to look at how it works ...
vpopmail-dir.sh blank
BenV July 5, 2023 11:14 CET
Heia,
Thanks for all the continued effort on the qmail patch!
Tried to update to the latest today, but it broke on not finding vpopmail.h
(note that I'm building from a clean alpine docker by adding prerequisites first, this has always worked so far)
Some digging later I noticed your new script to detect the include dir, with empty output:
bash -x ./vpopmail-dir.sh
+ PASSWD=/etc/passwd
+ '[' '!' -f /etc/passwd ']'
++ head -9 conf-users
++ tail -1
+ VUSR=vpopmail
+ SED=
+ for f in /usr/bin/sed /bin/sed /usr/sbin/sed /sbin/sed /usr/local/bin/sed /usr/local/sbin/sed
+ test -x /usr/bin/sed
+ for f in /usr/bin/sed /bin/sed /usr/sbin/sed /sbin/sed /usr/local/bin/sed /usr/local/sbin/sed
+ test -x /bin/sed
+ SED=/bin/sed
+ break
+ '[' /bin/sed = '' ']'
++ /bin/sed -n '/#/! s/^vpopmail:.*:.*:.*::\(.*\):.*/\1/p' /etc/passwd
+ echo
Compare this against the added user in /etc/passwd:
grep vpopmail /etc/passwd
vpopmail:x:89:89:Linux User,,,:/home/vpopmail:/sbin/nologin
Maybe use getent instead? E.g.
getent passwd vpopmail | cut -d: -f6
/home/vpopmail
vpopmail-dir.sh blank
Roberto Puzzanghera BenV July 5, 2023 18:19 CET
I uploaded a new combined patch with your suggestion based on getent
vpopmail-dir.sh blank
Roberto Puzzanghera BenV July 5, 2023 14:34 CET
Hi,
getent would be ok, but I would like to understand what's wrong in my approach based on sed. Do you have any idea?
I downloaded a very minimal alpine LXC image and it works as is in finding the vpopmail dir, even before I install anything.
PS /etc/passwd in the alpine installation already had the vpopmail user :-) are you the maintainer of that LXC image?
vpopmail-dir.sh path check for sed
Mike G July 2, 2023 21:32 CET
The vpopmail-dir.sh should look for 'sed' in '/bin' as well - which is how it is on Ubuntu 20 LTS at least.
vpopmail-dir.sh path check for sed
Roberto Puzzanghera Mike G July 2, 2023 22:30 CET
Thanks for letting me know. That's easy to correct. I'll do it as soon as possible
vpopmail-dir.sh path check for sed
Mike G Roberto Puzzanghera July 2, 2023 23:53 CET
np! Took me a bit to figure out a weird error I was getting until I realized it couldn't find sed 😂
DNS query timeout
Jacky June 29, 2023 03:29 CET
Hi roberto puzzanghera
Today I faced this error below in smtpd log.
Do you know anything about this error? .This is qmail error or my resolve DNS .
2023-06-28 01:06:57.006281500 DNS query timeout for ***.com
2023-06-28 09:26:16.487948500 DNS query timeout for ***.com
2023-06-28 10:37:49.557948500 DNS query timeout for ***.jp
DNS query timeout
Roberto Puzzanghera Jacky June 29, 2023 08:25 CET
I can't say much more than what it already says... did you try to query that DNS from the command line?
DNS query timeout
Jacky Roberto Puzzanghera July 5, 2023 05:10 CET
Hi roberto puzzanghera
Thank you for your advice.
I checked all DNS resolver server. Everything is good.
Receiving and sending email is not affected by this log message. I think it is not qmail 's problem.
dateformat in log
Chavazas Olivier June 26, 2023 09:16 CET
Hi
I may have missed a trick, but is there a possibility for the date to be readable directly in the qmail log files ?
For the moment I am forced each time to use tai64nlocal
Thanks
dateformat in log
Roberto Puzzanghera Chavazas Olivier June 30, 2023 10:33 CET
Hi, I've just added a patch for daemontools which provides a readable datetime format like this
2023-06-28 16:17:26.501272173 tcpserver: status: 0/200/0
This will be compatible with the convert-multilog and qlog archive programs, while the patch that I suggested below will break them.
Look at the daemontools page for details
dateformat in log
Roberto Puzzanghera Chavazas Olivier June 26, 2023 13:00 CET
You have to patch daemontools with this patch. But in this case the archive_qmail_qlog functionality will not work, so you have to choose which one you want.
Edit: also the JMS multilog backup will not work with this
qqfailure
Rodrigo Graeff June 15, 2023 15:44 CET
Hi brother, first of all, thanks for your excellent work here with this huge patch. I used to have one myself long time ago, but gave up with no time for maintaining. Your patch is outstanding. I have a small suggestion if you allow me to:
the reject code 451 is listed in several distinct errors on qmail-smtpd.c
the error:
@40000000648b1bd90cba9d14 qlogreceived: result=rejected code=451 reason=queuedelay detail=qq_internal_bug_(#4.3.0) helo=ams1b-admin-mta-01.mta.blizzard.com mailfrom=noreply@battle.net rcptto=RODRIGO@DELPHUS.ORG relay=no rcpthosts= size=59959 authuser= authtype= encrypted=tls sslverified=no localip=177.67.83.195 localport=25 remoteip=185.60.113.118 remoteport=50444 remotehost=ams1b-admin-mta-07.mta.blizzard.com qp=15137 pid=15132
the code:
void die_alarm() { qlogenvelope("rejected","alarmtimeout","","451"); logit("timeout"); out("451 timeout (#4.4.2)\r\n"); flush(); _exit(1); }
void straynewline() { qlogenvelope("rejected","badnewlines","","451"); logit("bad newlines"); out("451 See http://pobox.com/~djb/docs/smtplf.html.\r\n"); flush(); _exit(1); }
void err_qqt() { qlogenvelope("rejected","qqtfailure","","451"); out("451 qqt failure (#4.3.0)\r\n"); }
and there is another one in RBL, SPF and CHKUSER code as well. Is that related to temp problems ? my qq problem is quite persistent
I am sure I am getting the last one, the qqfailure, but I don't know why. message goes to the last qqx loop at qmail-smtpd.c
[pid 16171] read(0, "\27\3\3\26\261", 5) = 5
[pid 16171] read(0, " /\10\203z\340~\217\361b\331\21J\365B\247`\227X\270\324\261+\267\244 \215\322\232\340\35\305"..., 5809) = 5809
[pid 16171] read(0, "\27\3\3\26\261", 5) = 5
[pid 16171] read(0, "6\3\3708Y\f\302\345\221\352\233\227Pd\233\254\350\300hq\345\267d\357\216a\36\274}\370\306\26"..., 5809) = 5809
[pid 16171] read(0, "\27\3\3\26\261", 5) = 5
[pid 16171] read(0, "%RN\327\312\rJ\10\355#,\317\234e xHF\30646q\26\350\3117\377Vk2\346\333"..., 5809) = 5809
[pid 16171] read(0, "\27\3\3\26\261", 5) = 5
[pid 16171] read(0, "\221{\327S\265\213\232\304b\376\317qe\251o\10\340m\0256Q\223\350\4\0260k\277\215r\7Q"..., 5809) = 4207
[pid 16171] read(0, 0x55e5f9d4d6b7, 1602) = -1 EAGAIN (Resource temporarily unavailable)
[pid 16171] select(1, [0], NULL, NULL, {tv_sec=1200, tv_usec=0}) = 1 (in [0], left {tv_sec=1199, tv_usec=790431})
[pid 16171] read(0, "\253ez\4\332|\351\245/\25147\7so\27!\343\356\271F\341{\212{\3\377]\220\354\7\377"..., 1602) = 1602
[pid 16171] read(0, "\27\3\3\26\261", 5) = 5
[pid 16171] read(0, "d\351\245\335\236\221\365pQ\223CO\334\t4\2637\vnN\275d\7\307\277\230|\207\r\365\0F"..., 5809) = 5809
[pid 16171] read(0, "\27\3\3\26\261", 5) = 5
[pid 16171] read(0, "7\321qC\221\22\f\320\317^s\235\313\364\346G\237\312Q\233R4\24\6\17\33E\377\343yc,"..., 5809) = 5809
[pid 16171] read(0, "\27\3\3\26\261", 5) = 5
[pid 16171] read(0, "\232H\301D\372\2=\2358\22/\265!\312\21t\366\370\0\367)\272\311Qot\"[\344\345\7\4"..., 5809) = 5809
[pid 16171] read(0, "\27\3\3\16E", 5) = 5
[pid 16171] read(0, "2D\10\210\16H\364~t\237\263\t\204]\16s\212\217\211\332v\261/z2QQ%/\201\2277"..., 3653) = 3653
[pid 16171] close(4) = 0
[pid 16171] close(6) = 0
[pid 16171] read(7, "", 1024) = 0
[pid 16171] close(7) = 0
[pid 16171] wait4(16172, [{WIFEXITED(s) && WEXITSTATUS(s) == 81}], 0, NULL) = 16172
[pid 16171] select(3, NULL, [2], NULL, {tv_sec=1200, tv_usec=0}) = 1 (out [2], left {tv_sec=1199, tv_usec=999996})
[pid 16171] write(2, "qlogreceived: result=rejected co"..., 406) = 406
[pid 16171] select(3, NULL, [2], NULL, {tv_sec=1200, tv_usec=0}) = 1 (out [2], left {tv_sec=1199, tv_usec=999998})
[pid 16171] write(2, "\n", 1) = 1
[pid 16171] select(3, NULL, [2], NULL, {tv_sec=1200, tv_usec=0}) = 1 (out [2], left {tv_sec=1199, tv_usec=999998})
[pid 16171] write(2, "qmail-smtpd: message delayed (qq"..., 160) = 160
[pid 16171] write(1, "\27\3\3\0/\7C\320\30])%U\21\264\231\301\211\256*\\w\254[?%y\334HB!\10"..., 52) = 52
[pid 16171] write(1, "\27\3\3\0'\237\324\5\332\217C\0M5\37$\1.\311\267\362\250{\353\32\232[\362\266\244+\37"..., 44) = 44
[pid 16171] write(1, "\27\3\3\0\23f\213P?*\223\337\360.$p\346\252\374^\351)\337\f", 24) = 24
[pid 16171] exit_group(0) = ?
[pid 16171] +++ exited with 0 +++
I have even tried to "fix" qmail-queue with that perl recomended here, I have removed queue and installed a new one from qmail check setup, none makes any difference.
I'm quite lost atm, but I am sure I have more than one host with such problems.
any comments appreciated
thanks, Rodrigo
qqfailure
Roberto Puzzanghera Rodrigo Graeff June 15, 2023 16:58 CET
are you using my latest patch?
have also a look at this thread https://notes.sagredo.eu/en/qmail-notes-185/testing-qmail-smtp-and-auth-22.html#comment2960
qqfailure
Rodrigo Graeff Roberto Puzzanghera June 15, 2023 18:11 CET
Fantastic.
Well I am not sure what's wrong with qmail-dkim, but since it's not my submission, I've switched from qmail-dkim to qmail-queue and it worked like a charm. I see in the strace that somehow dkim is not quite able to lookup hosts, tho my /etc/resolv.conf points to 127.0.0.1 which is dnscache and it works like a charm. I will investigate it further, as qmail-dkim works perfectly when called from my submission, well it signs just fine.
Thanks Brother.
Rodrigo
qqfailure
Roberto Puzzanghera Rodrigo Graeff June 15, 2023 22:12 CET
Sure that you are not affected by the same bug, which was cured on March 18? According to the code lines that you posted above you are not using the latest patch...
qqfailure
Rodrigo Roberto Puzzanghera June 15, 2023 23:32 CET
Oh I see. It is possible indeed. I have patched with latest today. I will try dkim once again and let you know about it.
thanks
qqfailure
Roberto Puzzanghera Rodrigo Graeff June 15, 2023 16:42 CET
Hi brother,
can you show the entire qmail-smtpd log line? It is not shown completely in your strace...
Edit: I see now your qlog error line, sorry for asking
Small modification
Radu March 29, 2023 07:55 CET
Hello
Please modify the
gunzip -c ../roberto-netqmail-1.06.patch-latest.gz | patch
with
gunzip -c ../roberto-netqmail-1.06.patch-2023.03.01.gz |patch
Or save wget with latest .
can not send email to special domain
Jacky March 26, 2023 07:46 CET
Hi roberto puzzanghera
After applied the latest patch. I could not send email account with domain s--and--s.net
The error is "553 5.1.3 sorry, mailbox syntax not allowed ". I think 「--」 is not accepted.
Before updated the latest patch. I used 2022.05.22 patch.
$ telnet 172.24.4.23 25
Trying 172.24.4.23...
Connected to 172.24.4.23.
Escape character is '^]'.
220 mail.local Welcome to SMTP server ESMTP
AUTH LOGIN
334 VXNlcm5hbWU6
xxxxx
334 UGFzc3dvcmQ6
xxxxx
235 ok, go ahead (#2.0.0)
mail from:test@mail.local
250 ok
rcpt to:test@s--and--s.net
553 5.1.3 sorry, mailbox syntax not allowed
quit
221 mail.local Welcome to SMTP server
Connection closed by foreign host.
can not send email to special domain
Roberto Puzzanghera Jacky March 26, 2023 13:22 CET
I cannot reproduce the issue. And I remember that we cured it here...
can you double check that you are actually applying the latest patch?
can not send email to special domain
Jacky Roberto Puzzanghera March 26, 2023 19:29 CET
hi roberto puzzanghera
Yes, I tried to compile again with the lastest patch. but the same is displayed.
In chkuser_settings.h , i uncommented 383 line and recomplied again everything is going well
#define CHKUSER_DISABLE_VARIABLE "RELAYCLIENT"
can not send email to special domain
Roberto Puzzanghera Jacky March 26, 2023 20:19 CET
Do you have CHKUSER_SENDER_NOCHECK_VARIABLE defined as RELAYCLIENT?
can not send email to special domain
Jacky Roberto Puzzanghera March 27, 2023 07:04 CET
Yes ,I have #define CHKUSER_SENDER_NOCHECK_VARIABLE "RELAYCLIENT" in chkuser_settings.h too.
can not send email to special domain
Roberto Puzzanghera Jacky March 27, 2023 11:06 CET
Weird... This option would be sufficient to let RELAYCLIENT send even garbage in the domain syntax.
My tests work as expected. And if I disable RELAYCLIENT from tcprules mails with the double hyphen are sent anyway
can not send email to special domain
Jacky Roberto Puzzanghera March 27, 2023 11:44 CET
Thank you roberto puzzanghera
Now I can not figure out the problem. So I will run qmail with this setting.
#define CHKUSER_DISABLE_VARIABLE "RELAYCLIENT"
can not send email to special domain
Ali Erturk TURKER Jacky March 27, 2023 12:53 CET
Hi Jacky
Unfortunately you are playing with the wrong knobs. Please undo what you did.
The patch Roberto mentioned previously corrected "check_sender_address_format()" function.
But you are bitten by "check_rcpt_address_format()" function.
Please search this function after patching, and comment out the lines below as follows:
/*
} else {
if (strstr (domain->s, "--") != NULL)
return 0;
*/
can not send email to special domain
Roberto Puzzanghera Ali Erturk TURKER March 27, 2023 14:44 CET
Thanks Ali. Patch updated
can not send email to special domain
Jacky Roberto Puzzanghera March 28, 2023 10:55 CET
Hi roberto puzzanghera and Ali Erturk TURKER
Thank you very much!
I applied the latest patch. Everything is going well.
Appreciated
STARTTLS/SMTPS AUTH header fix for qmail-smtpd
Ali Erturk TURKER March 12, 2023 12:19 CET
Hi Roberto,
As you will see here the qmail-auth patch sets the protocol string as "ESMTPA", even though the user is authenticated via starttls/smtps. We need a patch like this to correct the headers generated by qmail-smtpd (which should cleanly apply on your combined patch). After the patch, the mail headers will change from "ESMTPA" to "ESMTPSA" and the
ssl_cipher used will be provided as follows:
Before patch:
Received: from unknown (HELO ?172.16.10.2?) (turkerali@xxxxxx.xxx@172.16.10.2)
by xxx.xxxxxx.com with ESMTPA; 10 Mar 2023 20:33:57 -0000
After patch:
Received: from unknown (HELO ?172.16.10.2?) (turkerali@xxxxxx.xxx@172.16.10.2)
by xxx.xxxxxx.com with ESMTPSA (TLS_AES_128_GCM_SHA256 encrypted, authenticated); 12 Mar 2023 12:32:03 -0000
Feel free to test and share on your website.
Regards,
AET
STARTTLS/SMTPS AUTH header fix for qmail-smtpd
Roberto Puzzanghera Ali Erturk TURKER March 12, 2023 13:33 CET
Thank you, Ali. Added
qmail-remote CRLF patch on steroids
Ali Erturk TURKER March 1, 2023 10:01 CET
Hi Roberto,
Bruce Guenter (a qmail guru) has written a patch which offers the exact same functionality of your qmail-remote CRLF patch, while providing 10x less CPU usage for qmail-remote. He accomplishes this by reading the message in 4K chunks (instead of byte-by-byte) while substituting the control characters, and pushing the mail to the remote mail server.
That makes perfect sense, as almost all major filesystems in use today (ext4, btrfs, xfs) default to 4K blocksize.
I modified his patch so that it applies cleanly on your combined patch. Feel free to download from this link, test and share on your website.
qmail-remote CRLF patch on steroids
Roberto Puzzanghera Ali Erturk TURKER March 1, 2023 15:59 CET
Hi Ali, thanks for the advise. Patch added
qmail-remote CRLF patch on steroids
Andreas Gerstlauer Roberto Puzzanghera June 5, 2025 15:35 CET
Roberto and Ali,
the old patch from Bruce is actually not doing the same as the CRLF patch. It addresses a different concern (performance), but does not fix the CRLF issue. Not sure the performance problem is still valid on modern systems (the OS should really do the buffering/caching internally), but if you want to keep Bruce's performance mod, a patch to incorporate the CRLF fix into it is attached (that I hacked together, i.e. no guarantees). I can't get the attachment to paste correctly, but the diff is also here (ignore the qmail-smtpd.c patch that is part of it):
https://github.com/agerstla/qmail/commit/c215bb0c03568dc69dd4d438ba99b9380f907762.diff
Andreas
diff --git a/qmail-remote.c b/qmail-remote.c
index 3d52b69..3531636 100644
--- a/qmail-remote.c
+++ b/qmail-remote.c
@@ -344,10 +344,11 @@ void blast()
char in[4096];
char out[4096*2+1];
int sol;
+ int cr;
substdio_put(&smtpto,firstpart.s,firstpart.len);
- for (sol = 1;;) {
+ for (sol = 1, cr = 0;;) {
r = substdio_get(&ssin,in,sizeof in);
if (r == 0) break;
if (r == -1) temp_read();
@@ -360,18 +361,32 @@ void blast()
while (i < r) {
if (in[i] == '\n') {
sol = 1;
+ cr = 0;
++i;
out[o++] = '\r';
out[o++] = '\n';
break;
}
+ if (cr) {
+ sol = 1;
+ cr = 0;
+ out[o++] = '\r';
+ out[o++] = '\n';
+ break;
+ }
+ if (in[i] == '\r') {
+ ++i;
+ cr = 1;
+ continue;
+ }
out[o++] = in[i++];
}
}
substdio_put(&smtpto,out,o);
}
-
- if (!sol) perm_partialline();
+
+ if (cr) substdio_put(&smtpto,"\r\n",2);
+ else if (!sol) perm_partialline();
flagcritical = 1;
substdio_put(&smtpto,".\r\n",3);
substdio_flush(&smtpto);
qmail-remote CRLF patch on steroids
Roberto Puzzanghera Andreas Gerstlauer June 5, 2025 16:23 CET
Thanks for the contribution, I'll check it out
vpopmail needed?
Dimi February 28, 2023 20:59 CET
Hi Roberto,
Thank you for putting together the combined patch that adds so many useful feature to netqmail-1.06.
Will the combine patch work without vpopmail? I would like to use it on servers where I do not have mysql and vpopmail installed.
vpopmail needed?
Roberto Puzzanghera Dimi March 1, 2023 04:51 CET
No, it has vpopmail as a prerequisite
qmail-rfc2821 patch does not cover implicit TLS (SMTPS) connections.
Ali Erturk TURKER February 27, 2023 09:51 CET
Hi Robert
As you will see here, if the remote port is given as "465" in control/smtproutes file, qmail-remote automatically switches to implicit TLS ("SMTP over TLS" or "smtps"). I believe qmail-rfc2821 patch appeared before the qmail-tls support, therefore it does not cover implicit TLS (SMTPS) connections. Since I am a fan of implicit TLS connections myself, (due to STARTTLS MitM attacks), I created this patch. Feel free to test and share on your website.
qmail-rfc2821 patch does not cover implicit TLS (SMTPS) connections.
Roberto Puzzanghera Ali Erturk TURKER February 27, 2023 14:36 CET
Do you think that it shoukd be like this?
# ifdef TLS
- if (tls_init())
+ if (tls_init()) {
if (smtps) {
code = smtpcode();
if (code >= 500 && code < 600) quit("DTLS Connected to "," but greeting failed");
if (code >= 400 && code < 500) return; /* try next MX, see RFC-2821 */
if (code != 220) quit("ZTLS Connected to "," but greeting failed");
}
/* RFC2487 says we should issue EHLO (even if we might not need
* extensions); at the same time, it does not prohibit a server
* to reject the EHLO and make us fallback to HELO */
code = ehlo();
+ }
# endif
qmail-rfc2821 patch does not cover implicit TLS (SMTPS) connections.
Ali Erturk TURKER Roberto Puzzanghera February 27, 2023 14:49 CET
Hi Roberto,
I also removed 2 lines from tls_init() to move the connection checks to smtp() function,
to make the code consistent with the previous qmail-rfc2821 patch. Please check my patch again.
It should apply cleanly on your combined patch.
AET
qmail-rfc2821 patch does not cover implicit TLS (SMTPS) connections.
Roberto Puzzanghera Ali Erturk TURKER February 27, 2023 14:58 CET
Yes, I see those other two lines removed.
But I don't understand why in your patched file this line
code = ehlo();
is no longer inside the if (tls_init())
qmail-rfc2821 patch does not cover implicit TLS (SMTPS) connections.
Anonymous Roberto Puzzanghera February 27, 2023 15:07 CET
Hi Roberto,
Probably there is a misunderstanding. My patch does not replace the qmail-rfc2821 patch.
My patch should be applied on top of your latest combined patch (netqmail-1.06 v. 2023.02.24).
After patching, qmail-remote.c should look like this. Please check and let me know if you have any questions.
Regards
AET
qmail-rfc2821 patch does not cover implicit TLS (SMTPS) connections.
Roberto Puzzanghera Anonymous February 27, 2023 15:15 CET
Exactly. What I don't understand is why that last
code = ehlo();
before your patch is inside the if (tls_init()) block
if (tls_init())
/* RFC2487 says we should issue EHLO (even if we might not need
* extensions); at the same time, it does not prohibit a server
* to reject the EHLO and make us fallback to HELO */
code = ehlo();
while after your patch it is outside the same block
if (tls_init())
if (smtps) {
code = smtpcode();
if (code >= 500 && code < 600) quit("DTLS Connected to "," but greeting failed");
if (code >= 400 && code < 500) return; /* try next MX, see RFC-2821 */
if (code != 220) quit("ZTLS Connected to "," but greeting failed");
}
/* RFC2487 says we should issue EHLO (even if we might not need
* extensions); at the same time, it does not prohibit a server
* to reject the EHLO and make us fallback to HELO */
code = ehlo();
qmail-rfc2821 patch does not cover implicit TLS (SMTPS) connections.
Anonymous Roberto Puzzanghera February 27, 2023 15:42 CET
Hi Roberto
You are %1000000000000 right.
First I created the patch on my win10 machine and it's exactly how you suggested.
Then I manually created it again on my linux vm to rebase it on your combined patch, and screwed up.
I revised the patch , should be OK now.
qmail-rfc2821 patch does not cover implicit TLS (SMTPS) connections.
Roberto Puzzanghera Anonymous February 27, 2023 16:17 CET
Impossible not to have at least a bug when you develop on Windows :-)
Patch updated
qregex patch needs to be corrected
Ali Erturk TURKER February 24, 2023 06:11 CET
Hi Roberto
At some point in time, Luca Franceschini had renamed control/badmailto and control/badmailtonorelay files to control/badrcptto and control/badrcpttonorelay files in:
qmail-smtpd.8
qmail-smtpd.c
Unfortunately this patch overlooked these files, which still contain the old naming scheme.
README.qregex
qmail-control.9
qmail-smtpd.8
qmail-showctl.c
The above files should also be updated accordingly.
Regards,
Ali Erturk TURKER
qregex patch needs to be corrected
Roberto Puzzanghera Ali Erturk TURKER February 24, 2023 06:38 CET
corrected. Thank you
Timeout Log
Jacky November 15, 2022 00:53 CET
Hi roberto puzzanghera
Today, I got many error in SMTP log.
Can you tell me the meaning of「reason=alarmtimeout 」 . And how can I tunning any qmail 's parameter to fix it ?
2022-11-14 19:40:42.017547500 mail1 qlogenvelope: result=rejected code=451 reason=alarmtimeout detail= helo=xxx mailfrom=xxx@163.com rcptto= relay=no rcpthosts= size=148766 authuser= authtype= encrypted= sslverified=no localip=xxxx localport=25 remoteip=xxxxx remoteport=16847 remotehost=m12-15.163.com qp=3063 pid=2630
Timeout Log
Roberto Puzzanghera Jacky November 16, 2022 10:40 CET
Hi Jacky,
it is an error belonging to the timeoutread function of qmail-smtpd, which doesn't have any comment inside. It is triggered when the client does not provide some of the mandatory commands in time, such as helo, mailfrom, rcptto etc. When I have this error I can always see a missing helo, or a missing mailfrom or rcptto just like when the client didn't provide them in time. You can see that rcptto is empty also in your example.
I don't think that this is your server's renponsibility. Anyway you can try to increase the "timeoutsmtpd" time in your control/timeoutsmtpd if you have set it to a very short time interval. It defaults to 1200s (20 minutes), which is a very long time.
You can reproduce that logline by connecting to your server, not providing the helo or mailfrom or rcptto commands and letting the remote server close the connection after the timeout (of course it's better to shorten it modifying your control/timeoutsmtpd file).
Timeout Log
Jacky Roberto Puzzanghera November 17, 2022 08:10 CET
I increased timoutsmtpd to 600 second. Until now I did not get any alarmtimeout log anymore.
Thank you roberto puzzanghera
Get size of message via environment variable
Jacky July 2, 2022 15:03 CET
Hi roberto puzzanghera
I am trying to write a qmail-spp plugin to deny the message that over size limit of our partner mail server.
So can I get size of message via environment variable like TCPREMOTEHOST ?
Get size of message via environment variable
Roberto Puzzanghera Jacky July 2, 2022 16:37 CET
Hi,
I'm not sure that the environment variables visible for qmail-smtpd will be directly visible inside a qmail-spp program. You can see which variables you have in the readme file at point 5 https://notes.sagredo.eu/files/qmail/patches/qmail-spp/README. I don't recall if/where the size of the incoming message is stored, but you can easily print those variables to find out where it is.
Get size of message via environment variable
Anonymous Roberto Puzzanghera July 6, 2022 07:00 CET
Hi roberto puzzanghera
I will try to set enviroment MAILSIZE in qmail-smtpd.c
I have one more question. Is there limit maximum of allowed recipients(To,Cc or Bcc). I try to send 1000 recipients
but it does not work well
I dont set CHKUSER_RCPTLIMIT variable.
Get size of message via environment variable
Roberto Puzzanghera Anonymous July 6, 2022 10:54 CET
yes, look at the concurrencylocal and concurrencyremote config files (http://www.lifewithqmail.org/lwq.html#configuration)
edit: be sure not to have set limits here for that particular account https://notes.sagredo.eu/en/qmail-notes-185/limiting-the-number-of-emails-sent-by-a-given-auth-userdomainip-231.html
incoming maximum number of recipients allowed
luchris May 31, 2022 03:53 CET
Hi Roberto and all,
Recently one of my domains keep getting 550_5.5.3_sorry,_reached_maximum_number_of_recipients_allowed_in_one_session_(chkuser) when someone sent more than 20 recipients to them. How and where do i increase this limit?
Thank you
incoming maximum number of recipients allowed
Roberto Puzzanghera luchris May 31, 2022 08:04 CET
Hi, just edit control/concurrencyincoming and restart qmail
qmail-smtpd: read failed (hang up before quit cmd)
Gabriel Torres May 22, 2022 16:32 CET
Hi Roberto,
I see a lot of messages like this from time to time in the smptd log. I don't know if this is something we should worry about or it is normal and safe to ignore.
Thank you in advance!
qmail-smtpd: read failed (hang up before quit cmd)
qmail-smtpd: read failed (hang up before quit cmd)
Roberto Puzzanghera Gabriel Torres May 23, 2022 15:17 CET
I recorded a qmail-smtpd session just to be sure what that messages means:
2022-05-22 20:13:44.267014500 tcpserver: pid 27286 from 199.249.230.87
2022-05-22 20:13:44.357670500 tcpserver: ok 27286 smtp.sagredo.eu:10.0.0.4:25 tor38.quintex.com:199.249.230.87::37602
2022-05-22 20:14:04.363400500 27286 > 220 smtp.sagredo.eu ESMTP^M
2022-05-22 20:14:06.787104500 27286 < [EOF]
2022-05-22 20:14:06.787172500 qmail-smtpd: read failed (hang up before quit cmd): (null) from 199.249.230.87 to (null) helo >
2022-05-22 20:14:06.787488500 27286 > [EOF]
2022-05-22 20:14:06.787591500 tcpserver: end 27286 status 256
It is an issue due to the fact that the client closed the connection unexpectedly without sending the quit command. Tecnically it is something that should not happen, so the read error.
PS often this happens after the client received a reject message from our qmail. I've just modified the error messages in the patch of may 22 from "hang up before quit cmd" to "client closed the connection before the quit command"
Failed after apply roberto-netqmail-1.06.patch-2022.02.13
Bruno Ribas May 13, 2022 15:30 CET
Hello,
After apply the patch roberto-netqmail-1.06.patch-2022.02.13, i got this error:
compilation terminated.
make: *** [: srs.o] Erro 1
Failed after apply roberto-netqmail-1.06.patch-2022.02.13
Roberto Puzzanghera Bruno Ribas May 13, 2022 15:35 CET
Did you install libsrs2 first?
If yes please post the entire error string
Failed after apply roberto-netqmail-1.06.patch-2022.02.13
Anonymous Roberto Puzzanghera May 17, 2022 18:57 CET
Thanks, I installed libsrs2 and the process advanced a little further, changing the error message:
make: *** [Makefile:1674: qmail-remote.o] Erro 1
Failed after apply roberto-netqmail-1.06.patch-2022.02.13
Roberto Puzzanghera Anonymous May 17, 2022 19:32 CET
Can you provide the entire error string, please?
Failed after apply roberto-netqmail-1.06.patch-2022.02.13
Bruno Ribas Roberto Puzzanghera May 19, 2022 20:23 CET
This is the complete output after I run the command 'make setup check'
Makefile:156: aviso: sobrescrevendo os comandos para o alvo 'base64.o'
Makefile:152: aviso: ignorando comandos antigos para o alvo 'base64.o'
Makefile:239: aviso: sobrescrevendo os comandos para o alvo 'byte_cspn.o'
Makefile:235: aviso: ignorando comandos antigos para o alvo 'byte_cspn.o'
Makefile:255: aviso: sobrescrevendo os comandos para o alvo 'byte_rcspn.o'
Makefile:251: aviso: ignorando comandos antigos para o alvo 'byte_rcspn.o'
Makefile:1845: aviso: sobrescrevendo os comandos para o alvo 'qmail-todo'
Makefile:1831: aviso: ignorando comandos antigos para o alvo 'qmail-todo'
Makefile:1853: aviso: sobrescrevendo os comandos para o alvo 'qmail-todo.o'
Makefile:1839: aviso: ignorando comandos antigos para o alvo 'qmail-todo.o'
Makefile:2172: aviso: sobrescrevendo os comandos para o alvo 'spf.o'
Makefile:2154: aviso: ignorando comandos antigos para o alvo 'spf.o'
Makefile:2177: aviso: sobrescrevendo os comandos para o alvo 'spfquery'
Makefile:2160: aviso: ignorando comandos antigos para o alvo 'spfquery'
Makefile:2184: aviso: sobrescrevendo os comandos para o alvo 'spfquery.o'
Makefile:2167: aviso: ignorando comandos antigos para o alvo 'spfquery.o'
Makefile:2222: aviso: sobrescrevendo os comandos para o alvo 'str_cpyb.o'
Makefile:2218: aviso: ignorando comandos antigos para o alvo 'str_cpyb.o'
Makefile:2311: aviso: sobrescrevendo os comandos para o alvo 'strsalloc.o'
Makefile:2306: aviso: ignorando comandos antigos para o alvo 'strsalloc.o'
./compile qmail-remote.c
qmail-remote.c: In function ‘dropped’:
qmail-remote.c:128:7: error: ‘ssl_err_str’ undeclared (first use in this function)
128 | if (ssl_err_str) { out((char *)ssl_err_str); out(" "); }
| ^~~~~~~~~~~
qmail-remote.c:128:7: note: each undeclared identifier is reported only once for each function it appears in
qmail-remote.c: In function ‘ssl_timeoutread’:
qmail-remote.c:158:10: warning: implicit declaration of function ‘ERR_error_string’ [-Wimplicit-function-declaration]
158 | out(ERR_error_string(ERR_get_error(), buf)); out("\n");
| ^~~~~~~~~~~~~~~~
qmail-remote.c:158:27: warning: implicit declaration of function ‘ERR_get_error’; did you mean ‘SSL_get_error’? [-Wimplicit-function-declaration]
158 | out(ERR_error_string(ERR_get_error(), buf)); out("\n");
| ^~~~~~~~~~~~~
| SSL_get_error
In file included from qmail-remote.c:7:
qmail-remote.c: At top level:
substdio.h:12:64: warning: initialization of ‘int (*)()’ from incompatible pointer type ‘ssize_t (*)(int, void *, size_t)’ {aka ‘long int (*)(int, void *, long unsigned int)’} [-Wincompatible-pointer-types]
12 | #define SUBSTDIO_FDBUF(op,fd,buf,len) { (buf), 0, (len), (fd), (op) }
| ^
qmail-remote.c:231:17: note: in expansion of macro ‘SUBSTDIO_FDBUF’
231 | substdio ssin = SUBSTDIO_FDBUF(read,0,inbuf,sizeof inbuf);
| ^~~~~~~~~~~~~~
substdio.h:12:64: note: (near initialization for ‘ssin.op’)
12 | #define SUBSTDIO_FDBUF(op,fd,buf,len) { (buf), 0, (len), (fd), (op) }
| ^
qmail-remote.c:231:17: note: in expansion of macro ‘SUBSTDIO_FDBUF’
231 | substdio ssin = SUBSTDIO_FDBUF(read,0,inbuf,sizeof inbuf);
| ^~~~~~~~~~~~~~
qmail-remote.c: In function ‘quit’:
qmail-remote.c:350:30: error: ‘smtps’ undeclared (first use in this function); did you mean ‘smtpto’?
350 | if (state & TLS_ST_OK || (!smtps && state & TLS_ST_BEFORE))
| ^~~~~
| smtpto
qmail-remote.c: In function ‘smtp’:
qmail-remote.c:585:13: warning: implicit declaration of function ‘strcasecmp’ [-Wimplicit-function-declaration]
585 | if (strcasecmp(fqdn,commonName)){
| ^~~~~~~~~~
qmail-remote.c:622:9: warning: implicit declaration of function ‘b64encode’ [-Wimplicit-function-declaration]
622 | if (b64encode(&auth_smtp_plain,&slop)) temp_nomem();
| ^~~~~~~~~
make: *** [Makefile:1674: qmail-remote.o] Erro 1
Failed after apply roberto-netqmail-1.06.patch-2022.02.13
Roberto Puzzanghera Bruno Ribas May 19, 2022 20:33 CET
did you installed openssl? which version?
can you post which version of gcc and which os you have?
Failed after apply roberto-netqmail-1.06.patch-2022.02.13
Bruno Ribas Roberto Puzzanghera May 23, 2022 17:52 CET
OpenSSL Version:
OpenSSL 1.1.1n 15 Mar 2022
In 'gcc -v' the result is this:
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/10/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 10.2.1-6' --with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-10 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-10-Km9U7s/gcc-10-10.2.1/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-10-Km9U7s/gcc-10-10.2.1/debian/tmp-gcn/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-mutex
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.1 20210110 (Debian 10.2.1-6)
And my OS is Debian 11.3
Failed after apply roberto-netqmail-1.06.patch-2022.02.13
Roberto Puzzanghera Bruno Ribas May 23, 2022 18:45 CET
ssl_err_str was defined around line 72 of qmail-remote.c, isn't it?
did you get any error during the patch process?
Implement reject null senders patch only for port 465 or 587
Jacky February 25, 2022 14:15 CET
Hi roberto puzzanghera
In this qmail patch can I apply reject null senders only for special port (465 or 587) with environment variable ?
Implement reject null senders patch only for port 465 or 587
Roberto Puzzanghera Jacky February 25, 2022 14:48 CET
try this patch defining REJECTNULLSENDERS in your run file https://notes.sagredo.eu/files/qmail/patches/roberto-netqmail-1.06/roberto-netqmail-1.06.patch-2022.02.25.gz
let me know
Implement reject null senders patch only for port 465 or 587
Jacky Roberto Puzzanghera February 25, 2022 15:14 CET
Hi roberto puzzanghera
Thank your patch.
After apply new patch I got this error below.
# telnet 127.0.0.1 587
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
421 unable to read controls (#4.3.0)
Connection closed by foreign host.
# openssl s_client -connect localhost:587 -starttls smtp
CONNECTED(00000003)
didn't found starttls in server response, try anyway...
write:errno=32
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 38 bytes and written 25 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
Protocol : TLSv1.2
Cipher : 0000
Session-ID:
Session-ID-ctx:
Master-Key:
Key-Arg : None
Krb5 Principal: None
PSK identity: None
PSK identity hint: None
Start Time: 1645801919
Timeout : 300 (sec)
Verify return code: 0 (ok)
---
Implement reject null senders patch only for port 465 or 587
Roberto Puzzanghera Jacky February 25, 2022 15:36 CET
try downloading again now
Implement reject null senders patch only for port 465 or 587
Jacky Roberto Puzzanghera February 25, 2022 23:17 CET
Hi roberto puzzanghera
Everything is fine. Thank you very much.
P/s: I think if add ipv6 support this patch is the best patch for qmail.![]()
Implement reject null senders patch only for port 465 or 587
Roberto Puzzanghera Jacky February 26, 2022 07:21 CET
Yes, I think because this is the only maintained patch published on the internet!
Ipv6 would be great! Which patch are you testing?
Implement reject null senders patch only for port 465 or 587
Jacky Roberto Puzzanghera February 26, 2022 10:02 CET
I tested this patch roberto-netqmail-1.06.patch-2022.02.25.gz
and implemented to one production server for workload test.
Implement reject null senders patch only for port 465 or 587
Roberto Puzzanghera Jacky February 26, 2022 13:06 CET
I'm not sure that ipv6 can work without patching the core of qmail...
Implement reject null senders patch only for port 465 or 587
Jacky Roberto Puzzanghera February 26, 2022 13:34 CET
Exactly,
I just applied tcpserver for ipv6 only . incomming email is fine(RBL is not working well) ,
but outgoing does not work.![]()
Implement reject null senders patch only for port 465 or 587
Roberto Puzzanghera Jacky February 26, 2022 16:23 CET
I guess that the rblsmtpd program by eh embedded in ucspi-tcp6 will work
I think that also at least spf and moreipme have to patched.
If you want to help, can you test the Manvendra's ipv6 patch here https://sourceforge.net/projects/indimail/files/netqmail-addons/qmail-dkim-1.0/ against Saout's spf?
Implement reject null senders patch only for port 465 or 587
Jacky Roberto Puzzanghera February 27, 2022 06:21 CET
this patch with name dkim+spf+ipv6.patch-1.14.gz right?
If you need one machine with ipv6 let me know.
Implement reject null senders patch only for port 465 or 587
Roberto Puzzanghera Jacky February 27, 2022 07:57 CET
yes, this one. At a certain point Manvendra added ipv6 to the original dkim patch, but I've never found the time to add it to my patch.
I would install it on a vanilla qmail and test it as is. Then I would install the spf patch (https://notes.https://notes.sagredo.eu/files/qmail/patches/qmail-spf-rc5.patchsagredo.eu/files/qmail/patches/qmail-spf-rc5.patch) on top of it and test spf.
Thanks for the collaboration and for the possibility to use a machine of yours. This month I don't have free time because I have to migrate this server.
We can continue this discussion on ipv6 in private via mail if you like (contact button on the top of this page).
not-qmail?
Ryan February 17, 2022 03:14 CET
Hey Robert,
Long time reader, first time caller. Recently came across the not-qmail project (GH/not-qmail/not-qmail), from some former qmail users who went over to postfix and came back. Was wondering if you'd taken a look at their work, or if you think net-qmail is still the best base for qmail?
not-qmail?
Roberto Puzzanghera Ryan February 17, 2022 09:57 CET
Hi Ryan, certainly a combined patch based on the qmail legacy like mine can't represent the future of qmail and one day we'll have to look at some of those qmail successors like not-qmail. I've never played with not-qmail but I have a big respect for such an ambitious project, and the fact that it comes from qmail gurus like Manvendra Bhangui and the others sounds like a garantee for me. But, as their wishlist says, most common features still have to be implemented, so let's give them their time.
Nowadays, if I'd have to use in production a qmail successor, I'd rather consider Manvendra's indimail (it has everything) and Erwin Hoffmann's s/qmail (very active and complete)
Got error with netqmail-1.06 v. 2022.02.10
Jacky February 13, 2022 14:43 CET
Hi roberto puzzanghera
I tried to apply newest patch combined patch for netqmail-1.06 v. 2022.02.10
but got some error below. Can you check it for me. is it displayed only on my server?
./compile qmail-smtpd.c
In file included from tls.h:4:0,
from qmail-smtpd.c:36:
qmail-smtpd.c: In function ‘tls_init’:
qmail-smtpd.c:2351:28: error: ‘SSL_OP_NO_RENEGOTIATION’ undeclared (first use in this function)
SSL_CTX_set_options(ctx, SSL_OP_NO_RENEGOTIATION);
^
qmail-smtpd.c:2351:28: note: each undeclared identifier is reported only once for each function it appears in
make: *** [qmail-smtpd.o] Error 1
Got error with netqmail-1.06 v. 2022.02.10
Roberto Puzzanghera Jacky February 13, 2022 14:59 CET
can you try with this one please? https://notes.sagredo.eu/files/qmail/patches/roberto-netqmail-1.06/roberto-netqmail-1.06.patch-2022.02.13.gz
Got error with netqmail-1.06 v. 2022.02.10
Roberto Puzzanghera Jacky February 13, 2022 14:48 CET
Hi, which version of openssl do you have?
Got error with netqmail-1.06 v. 2022.02.10
Jacky Roberto Puzzanghera February 13, 2022 19:17 CET
Hi,
I am using openssl version below. Is it old?
OpenSSL 1.0.2k-fips 26 Jan 2017
Got error with netqmail-1.06 v. 2022.02.10
Roberto Puzzanghera Jacky February 13, 2022 19:36 CET
openssl is now at v. 1.1.
The patch that I linked above should solve your problem. Let me know.
Got error with netqmail-1.06 v. 2022.02.10
Jacky Roberto Puzzanghera February 14, 2022 11:13 CET
Hi roberto puzzanghera
When i tried to apply the link you gave to me. I got some text below.
what should i do? Just enter to countinue?
# gunzip -c ../roberto-netqmail-1.06.patch-2022.02.13.gz |patch
The next patch would delete the file CHANNELS, which does not exist! Assume -R? [n]
Got error with netqmail-1.06 v. 2022.02.10
Roberto Puzzanghera Jacky February 14, 2022 11:40 CET
Sorry, the patch that I uploaded yesterday is corrupted. Please download it again and retry
Got error with netqmail-1.06 v. 2022.02.10
Jacky Roberto Puzzanghera February 15, 2022 00:42 CET
Hi Roberto Puzzanghera
Thank you very much .
I applied new patch successfully.
Until now everything is good.
qmail-smtp get 100% of CPU
Jacky January 23, 2022 14:54 CET
Hi roberto puzzanghera
Yesterday, I updated the latest this patch. After that i faced the problem with qmail-smtpd process.
It made my CPU to 100% . Did you have the same issue? Do you have any advice for me to check my server?
Send and receive e-mail is ok.
Tasks: 717 total, 2 running, 581 sleeping, 0 stopped, 0 zombie
%Cpu(s): 6.5 us, 0.2 sy, 0.0 ni, 93.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 65429236 total, 24054772 free, 2695836 used, 38678628 buff/cache
KiB Swap: 8388604 total, 8344368 free, 44236 used. 58790728 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
17142 vpopmail 20 0 43068 4764 4176 R 100.0 0.0 8:28.19 qmail-smtpd
21070 root 20 0 164140 5152 3804 R 0.7 0.0 0:00.06 top
qmail-smtp get 100% of CPU
Roberto Puzzanghera Jacky January 23, 2022 15:19 CET
Hi Jacky, no I don't have the same problem.
What do you have in the tcpserver: status line?
2022-01-23 16:16:37.153586500 tcpserver: status: 1/200
PS If I understand well, you are one of the most ancient commentators of this place :-)
qmail-smtp get 100% of CPU
Jacky Roberto Puzzanghera January 23, 2022 16:24 CET
Hi roberto puzzanghera
Thank you for your reply ! It is my qmail-smtpd in status line.
2022-01-24 01:17:40.458419500 tcpserver: ok 26702 mail1.xxx.com:172.24.xxx.xxx:25 service.axxx.xxx:209.141.xxx.xxx::45762
2022-01-24 01:17:41.066480500 tcpserver: end 26549 status 2562022-01-24 01:17:41.066481500 tcpserver: status: 15/600
2022-01-24 01:17:41.722767500 tcpserver: end 26593 status 256
2022-01-24 01:17:41.722767500 tcpserver: status: 14/600
2022-01-24 01:17:41.841063500 tcpserver: status: 15/600
2022-01-24 01:17:41.841284500 tcpserver: pid 26723 from 107.16xxx.xxx
2022-01-24 01:17:42.313190500 tcpserver: end 26588 status 256
2022-01-24 01:17:42.313191500 tcpserver: status: 14/600
2022-01-24 01:17:42.854308500 tcpserver: status: 15/600
2022-01-24 01:17:42.854440500 tcpserver: pid 26726 from 134.73.xxx.xxx
2022-01-24 01:17:42.854926500 tcpserver: ok 26726 mail1.xxx.com:172.24.xxx.xxx:25 :134.73.xxx.xxx::61096
2022-01-24 01:17:43.897306500 tcpserver: status: 16/600
2022-01-24 01:17:43.897474500 tcpserver: pid 26727 from 151.52.xxx.xxx
2022-01-24 01:17:43.990919500 tcpserver: ok 26652 mail1.xxx.com:172.24.xxx.xxx:25 :107.16xxx.xxx::54474
qmail-smtp get 100% of CPU
Roberto Puzzanghera Jacky January 23, 2022 19:10 CET
Are the servers' date and time correct?
Secondly, I would try to see what smtpd is doing with strace
qmail-smtp get 100% of CPU
Jacky Roberto Puzzanghera January 24, 2022 02:01 CET
Hi roberto puzzanghera
This is my strace qmail-smtpd. I used "strace -fp 24210" command. i
strace: Process 24210 attached
brk(NULL) = 0x840000
brk(NULL) = 0x840000brk(0x83c000) = 0x83c000
brk(NULL) = 0x83c000
write(1, "\26\3\1\0001\2\0\0-\3\1\223\310\"\312Q\0\202\321\223\303.b;}\245I'\276\225\313\344"..., 4095) = 4095
read(0, 0x810c43, 5) = -1 EAGAIN (Resource temporarily unavailable)fcntl(0, F_GETFL) = 0x802 (flags O_RDWR|O_NONBLOCK)
fcntl(0, F_SETFL, O_RDWR) = 0fcntl(1, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(1, F_SETFL, O_RDWR) = 0select(2, NULL, [1], NULL, {tv_sec=60, tv_usec=0}) = 1 (out [1], left {tv_sec=59, tv_usec=999997})
write(1, "454 TLS connection failed: timed"..., 47) = 47
brk(NULL) = 0x83c000brk(NULL) = 0x83c000
brk(0x83a000) = 0x83a000brk(NULL) = 0x83a000
brk(NULL) = 0x83a000brk(NULL) = 0x83a000
brk(0x836000) = 0x836000brk(NULL) = 0x836000
brk(NULL) = 0x836000brk(NULL) = 0x836000brk(0x82b000) = 0x82b000
brk(NULL) = 0x82b000select(3, NULL, [2], NULL, {tv_sec=60, tv_usec=0}) = 1 (out [2], left {tv_sec=59, tv_usec=999996})
write(2, "qmail-smtpd: read failed (tls co"..., 114) = 114
exit_group(1) = ?+++ exited with 1 +++
qmail-smtp get 100% of CPU
Roberto Puzzanghera Jacky January 24, 2022 10:04 CET
you have a TLS connection failure, I guess in your submission service. Can you check your TLS certificate state in this way
openssl s_client -starttls smtp -crlf -connect localhost:587 -cert /var/qmail/control/servercert.pem -key /var/qmail/control/servercert.pem -state
qmail-smtp get 100% of CPU
Jacky Roberto Puzzanghera January 26, 2022 12:06 CET
Hi roberto puzzanghera
Sorry for late reply .
I added recordio command before qmail-smtpd in config file to get more detail log. but no TLS error log .
I changed qmail-smtpd/run config [/usr/local/bin/softlimit -m 10000000]->][/usr/local/bin/softlimit -m 200000].
So after 2 days everything is ok. and my server 's cpu is sage now. I think softlimit is over-spec . Thank you for your kindly support.
I am still trying to get qmail using IPv6 . Have a nice day.
qmail-smtp get 100% of CPU
Jacky Roberto Puzzanghera January 24, 2022 10:48 CET
Here is command 's result on my server. I am using "SMTPD_GREETDELAY" for greeting delay too.
Maybe this make server resouce is higher than normal? I will remove SMTPD_GREETDELAY option.
openssl s_client -starttls smtp -crlf -connect localhost:587 -cert /var/qmail/control/servercert.pem -key /var/qmail/control/servercert.pem -state
CONNECTED(00000003)
SSL_connect:before/connect initialization
SSL_connect:SSLv2/v3 write client hello A
SSL_connect:SSLv3 read server hello A
depth=2 C = BE, O = GlobalSign nv-sa, OU = Root CA, CN = GlobalSign Root CA
verify return:1
depth=1 C = BE, O = GlobalSign nv-sa, CN = AlphaSSL CA - SHA256 - G2
verify return:1
depth=0 CN = *.no1-serxxx.com
verify return:1
SSL_connect:SSLv3 read server certificate A
SSL_connect:SSLv3 read server key exchange A
SSL_connect:SSLv3 read server done A
SSL_connect:SSLv3 write client key exchange A
SSL_connect:SSLv3 write change cipher spec A
SSL_connect:SSLv3 write finished A
SSL_connect:SSLv3 flush data
SSL_connect:SSLv3 read server session ticket A
SSL_connect:SSLv3 read finished A
---
Certificate chain
0 s:/CN=*.no1-serxxx.com
i:/C=BE/O=GlobalSign nv-sa/CN=AlphaSSL CA - SHA256 - G2
1 s:/C=BE/O=GlobalSign nv-sa/CN=AlphaSSL CA - SHA256 - G2
i:/C=BE/O=GlobalSign nv-sa/OU=Root CA/CN=GlobalSign Root CA
---
Server certificate
-----BEGIN CERTIFICATE-----
MIIGRzCCBS+gAwIBAgIMTy0J+wRHU1/6EtfPMA0GCSqGSIb3DQEBCwUAMEwxCzAJ
BgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMSIwIAYDVQQDExlB
bHBoYVNTTCBDQSAtIFNIQTI1NiAtIEcyMB4XDTIxMDYxMTA4MDQwOFoXDTIyMDcx
MzA4MDQwOFowHTEbMBkGA1UEAwwSKi5ubzEtc2VydmVyMjguY29tMIIBIjANBgkq
hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqTXFrhHBizsjq4CCBeTADUN/7bl1F2yc
xHfWiptQzGTnY3ohDCbnsY4/pYqh3AX6/e5ay5++XHHsDlnh9hKFHwEDoBV8f2Jx
NGVChH1JLwGTXEzseeEse76JkqZQj4K6ImxrUvieS4OisN0BTxtkFQ1cazAwHCL1
CjtIoULJK6keoIdZ24H6bNjKX/stmqb6sUp2ttHQOnzTojbZ4dmqqtI/fhfN0dLn
SQrq1aV0owfkgplMS48whjRjfRvuCLGDYy1vl4hpbhBTEQgv4TKxR/cEozAMwDJD
Rhqj2Gujn7CRnlN37ywptBSKStQD9Jsjx2WsNnkSlZMPIaj4dhe1oQIDAQABo4ID
VjCCA1IwDgYDVR0PAQH/BAQDAgWgMIGJBggrBgEFBQcBAQR9MHswQgYIKwYBBQUH
MAKGNmh0dHA6Ly9zZWN1cmUyLmFscGhhc3NsLmNvbS9jYWNlcnQvZ3NhbHBoYXNo
YTJnMnIxLmNydDA1BggrBgEFBQcwAYYpaHR0cDovL29jc3AyLmdsb2JhbHNpZ24u
Y29tL2dzYWxwaGFzaGEyZzIwVwYDVR0gBFAwTjBCBgorBgEEAaAyAQoKMDQwMgYI
KwYBBQUHAgEWJmh0dHBzOi8vd3d3Lmdsb2JhbHNpZ24uY29tL3JlcG9zaXRvcnkv
MAgGBmeBDAECATAJBgNVHRMEAjAAMD4GA1UdHwQ3MDUwM6AxoC+GLWh0dHA6Ly9j
..
-----END CERTIFICATE-----
subject=/CN=*.no1-serxxx.com
phaSSL CA - SHA256 - G2
---
No client certificate CA names sent
Peer signing digest: SHA512
Server Temp Key: ECDH, P-256, 256 bits
---
SSL handshake has read 3605 bytes and written 450 bytes
---
New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES256-GCM-SHA384
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
Protocol : TLSv1.2
Cipher : ECDHE-RSA-AES256-GCM-SHA384
Session-ID: AB98869F6AA62BD90D91E8F6EAFDB4B0EFD014FFD6019560C21242593A9CF8E9
Session-ID-ctx:
Master-Key: CFB1310D7B82FCA44346348EB4C2D57FF53E4AFB7A63C7BDA61F772F8DDC2FB73A2C95E1A1EC03CFF52A4186C7748F62
Key-Arg : None
Krb5 Principal: None
PSK identity: None
PSK identity hint: None
TLS session ticket lifetime hint: 300 (seconds)
TLS session ticket:
0000 - 37 05 25 6f d9 34 73 41-dd c7 fb 5c b7 61 00 21 7.%o.4sA...\.a.!
0010 - e2 dd 4f 35 c3 f5 86 12-d8 59 39 97 b2 db 66 ec ..O5.....Y9...f.
0020 - 5f e4 70 39 8f 54 e9 46-55 a9 41 6f d6 dd 3b b1 _.p9.T.FU.Ao..;.
0030 - 0a f1 49 64 3e 68 30 fe-ba 93 df 39 da 1a 8d bb ..Id>h0....9....
0040 - 5c 76 e0 5f 34 83 33 b1-d8 67 c2 81 9b 75 bd 79 \v._4.3..g...u.y
0050 - 09 11 bb a0 56 d8 3b a3-e6 fe f2 b5 48 40 2f 43 ....V.;.....H@/C
0060 - 9f f4 0e 25 36 db e0 e4-39 1b 69 be 02 0b 6f 79 ...%6...9.i...oy
0070 - 9e fa 8b 20 73 ff 60 0f-54 cc c4 e9 dc e7 f9 26 ... s.`.T......&
0080 - c9 11 b9 93 7c 40 92 57-2c 1c 2a fc c1 c5 8c fb ....|@.W,.*.....
0090 - 14 34 b3 1d 0f e4 cf 58-d0 0b a4 18 25 61 d6 c3 .4.....X....%a..
Start Time: 1643020850
Timeout : 300 (sec)
Verify return code: 0 (ok)
---
250 SIZE 20480000
qmail-smtp get 100% of CPU
Roberto Puzzanghera Jacky January 24, 2022 11:19 CET
No, greetdelay will not engage your cpu, just absorbs spammers' resources :-)
First of all consider an update of your openssl server or disable the connections with SSL 3.0, because of the POODLE vulberability. Anyway your certificate seems ok.
Can you check the logs (both smtpd and submission) and look for those "454 TLS connection failed"? Can you do
openssl s_client -starttls smtp -crlf -connect yourserver.tld:25/587
from remote, using the port that advertise STARTTLS?
Problem of check sender email address with ~ character
Jacky January 5, 2022 07:08 CET
Hi roberto
Today I faced the problem with WBErbxishu_citizen~micro_205_0_0@abc.com
When i remove [~] character everything is ok. So I wonder if we can add exception of [~] character in chckuser.
I checked patch is uncommented [~] character . But it does not work . Can you please check it ?
+#define CHKUSER_ALLOW_SENDER_CHAR_5 '*'
+#define CHKUSER_ALLOW_SENDER_CHAR_6 '^'
+#define CHKUSER_ALLOW_SENDER_CHAR_7 '~'
Problem of check sender email address with ~ character
Roberto Puzzanghera Jacky January 5, 2022 08:08 CET
Hi Jacky, WBErbxishu_citizen~micro_205_0_0@abc.com works here...
Problem of check sender email address with ~ character
Jacky Roberto Puzzanghera January 5, 2022 09:30 CET
Hi roberto
telnet mail-xxx.xxx-xxxx.com 25
Trying 158.101.69.33...
Connected to mail-xxx.xx-xxx.com.
Escape character is '^]'.
220 mail.no1-xxx.com Welcome to SMTP server ESMTP
ehlo
250-mail.no1-xxx.com Welcome to SMTP server
250-STARTTLS
250-PIPELINING
250-8BITMIME
250-AUTH LOGIN PLAIN CRAM-MD5
250 SIZE 20480000
mail from: <WBErbxishu_citizen~micro_205_0_0@biem.eco-serv.jp>
553 5.1.7 sorry, mailbox syntax not allowed (chkuser)
mail from: <WBErbxishu_citizen?micro_205_0_0@rbiem.eco-serv.jp>
553 5.1.7 sorry, mailbox syntax not allowed (chkuser)
mail from: <WBErbxishu_citizen~micro_205_0_0@rbiem.eco-serv.jp>
553 5.1.7 sorry, mailbox syntax not allowed (chkuser)
I deployed newest patch but it does not work for me.
do you have any advice for me.
Problem of check sender email address with ~ character
Roberto Puzzanghera Jacky January 5, 2022 10:00 CET
weird... it's seems like you're not using the same chkuser...
I would check the chkuser's source code in order to verify that you are using the same patch. Check these lines https://notes.sagredo.eu/files/qmail/patches/roberto-netqmail-1.06/2021.06.19_patch.diff
Did you restart qmail after last compile/install?
Problem of check sender email address with ~ character
Anonymous Roberto Puzzanghera January 5, 2022 13:46 CET
hi Roberto
Thank you for your advice.
I figured out my problem. This issue is in my qmail-smtp run config is still using old qmail-smtpd file . i am terribly sorry.
Thank you very much.
Problem with latest patch
Adebola Ajiboye October 25, 2021 21:29 CET
Hello Roberto
Thank you for your excellent work, time and support of this patch.
The latest patch builds fine. I can send outgoing mail. However, problems with vdelivermail leaves mail in the queue, perpetually deffered with database_down errors. Have spent a day troubleshooting this new build and could not locate the issue, hoping you can point me in the right direction.
Here is what I have:
## -> mlcat send
2021-10-25 16:05:54.914534500 delivery 2: deferral: vdelivermail:_deferred,_database_down/
I have double-checked all the usual suspects... queue looks good, brand new build anyways, still not sure what's missing here. Any pointers is much appreciated. Thank you.
Thank you very much.
Problem with latest patch
Roberto Puzzanghera Adebola Ajiboye October 26, 2021 18:13 CET
Hi, I had a look at the source code
/* if the database is down, deferr */
if ( verrori == VA_NO_AUTH_CONNECTION )
vexiterr (EXIT_DEFER, "vdelivermail: deferred, database down");
it seems that it cannot connect to your mysql. So, double check your mysql connection/priviledges and your vpopmail/mysql configuration
Problem with latest patch
KPC Roberto Puzzanghera September 2, 2023 22:27 CET
After the help dealing with the log date patch, this seems to be the error I now face.
I can successfully make users and valiases, can successfully query those on port 89, can successfully do
mysql -h 127.0.0.1 -u vpopmail -pPASSWORD vpopmail
and the same if I swap it to 0.0.0.0
the line in
more /home/vpopmail/etc/vpopmail.mysql is: 0.0.0.0|0|vpopmail|PASSWORD|vpopmail
though has been in testing this, localhost and 127.0.0.1.
I the various GRANT etc statements gave me issues and seemed to be related to:
But I assumed that once I navigated to a place where I could make accounts and the like I was fine, as I was the last time I did this whole process and had the same error with the GRANT commands.
What is the best way to find out where this is now failing and remedy it?
System is Ubuntu 22.04 LTS with the database packages installed from apt.
Problem with latest patch
Roberto Puzzanghera KPC September 2, 2023 23:15 CET
I will try tomorrow with your Ubuntu version also to try to reproduce the bug with the daemontools patch. Regarding the database/user query, I don't see the problem in the page you link. My query is exactly as suggested there...
BTW, which is the exact query are you using? I suggest to use localhost everywhere if the mail server and the mysql server are the same
Problem with latest patch
KPC Roberto Puzzanghera September 2, 2023 23:54 CET
I'm floored with the level you're willing to go to help people with this process and the guide. Very impressive. Thank you again.
The last time I did this my notes on the
>GRANT USAGE ON * . * TO 'vpopmail'@'mailserver-IP' IDENTIFIED BY 'jz_jcsX4yW' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
Command prompted me to make note of the URL shared above in my build log. That was with 20.04 LTS (MySQL Server version: 8.0.27-0ubuntu0.20.04.1 (Ubuntu) )
This time:
Server version: 8.0.34-0ubuntu0.22.04.1 (Ubuntu)
Copyright (c) 2000, 2023, Oracle and/or its affiliates.
mysql> GRANT USAGE ON * . * TO 'vpopmail'@'localhost' IDENTIFIED BY 'PASSWORD' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED BY 'X8vFVtChqVwf' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOU' at line 1
In both cases I was able to proceed with a GRANT USAGE that trunkates after localhost - not applying the limits. But in the 20.04 case I did not run into the vdelivermail:_deferred,_database_down/ error.
Many things have changed in the years gap. I find myself wondering if the default mysql password type matters, as that appears to have changed from then to now based on my trying to resolve this.
I have another error in my qmail/send/current log regarding a TLS_connect_failed when sending a remote message, unsupported protocol an I'd have expected that to fall back to unsecure for non-submission ie: port 25. I know a good deal about the other server as the one I'm building is backupmx for some of it's domains, so ideally I just need this to work too - until that other one gets rebuilt. Given this is the rather minimal rc run script I'm not sure how to adjust that setting.
I'm also happen to take the more extended conversation on this to email or another system if you'd rather not have all of it here.
Problem with latest patch
Roberto Puzzanghera KPC September 3, 2023 00:19 CET
Try to use
GRANT USAGE ON * . * TO 'vpopmail'@'localhost' WITH MAX_QUERIES_PER_HOUR and all the rest
as explained in the link you provided above.
Let's continue the conversation here for now, as it can be of interest for others
Problem with latest patch
KPC Roberto Puzzanghera September 3, 2023 00:29 CET
mysql> GRANT USAGE ON * . * TO 'vpopmail'@'localhost' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USE' at line 1
Removing the password section does not seem to be enough.
Problem with latest patch
Roberto Puzzanghera KPC September 3, 2023 09:28 CET
No idea... is there a particular reason why you are using MySQL? What about switching to mariadb and get rid of these issues? It's available in the Ubuntu store, as you know
Problem with latest patch
KPC Roberto Puzzanghera September 3, 2023 18:52 CET
I've swapped databases as suggested, the grant statements now work with the limits.
I've rebuilt the vdomains, vusers, valiases due to switching databases. All went as smoothly as before.
Messages still do not get delivered with the same
2023-09-03 13:40:07.895332212 delivery 10: deferral: vdelivermail:_deferred,_database_down/
Though operations work on the database to make the users etc which I assume uses the same authentication file and the same data channel as vdelivermail does.
Thank you again for all of your assistance.
Problem with latest patch
Roberto Puzzanghera KPC September 3, 2023 19:27 CET
You have a failed connection to database (VA_NO_AUTH_CONNECTION) while attempting to read the virtual aliases. Did you test vpopmail with telnet 0 89?
Do you have mariadb and qmail on the same host? Try to do a connection from the commad line:
mysql -u vpopmail -p vpopmailpwd
look for errors in mariadb log.
Check the priviledge. What do you have in vpopmail.mysql? Of course hide your pwd. Be aware that vpopmail@localhost is a different user than vpopmail@127.0.0.1 from the database point of view...
Problem with latest patch
KPC Roberto Puzzanghera September 3, 2023 20:00 CET
postmaster for a vdomain can successfully authenticate with the telnet 0 89 test yes.
Both are hosted on the same machine yes:
# mysql -u vpopmail -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 1496
Server version: 10.6.12-MariaDB-0ubuntu0.22.04.1 Ubuntu 22.04
mariadb(mysql) error log is empty, 0 bytes.
vpopmail.mysql file:
-rw-r----- 1 vpopmail vchkpw 43 Sep 3 14:39 vpopmail.mysql
localhost|0|vpopmail|PASSWORD|vpopmail
localhost was used for all the GRANT statements - so matching that seemed important but in testing I've cycled through 'localhost' '127.0.0.1' and '0.0.0.0' - am tempted to add additional matching GRANT statements for all of these in hopes it would help.
Problem with latest patch
Roberto Puzzanghera KPC September 3, 2023 20:13 CET
Ok. So I assume that you have a database user vpopmail@localhost with privileges to use the vpopmail db.
The delivery fails only when sending to a valias or even to an ordinary mailbox?
Problem with latest patch
KPC Roberto Puzzanghera September 3, 2023 21:35 CET
I re-ran
MariaDB [(none)]> CREATE USER 'vpopmail'@'localhost' IDENTIFIED BY 'PASSWORD';
ERROR 1396 (HY000): Operation CREATE USER failed for 'vpopmail'@'localhost'
MariaDB [(none)]> select User from mysql.user;
+-------------+
| User |
+-------------+
| mariadb.sys |
| mysql |
| root |
| vpopmail |
+-------------+
4 rows in set (0.001 sec)
MariaDB [(none)]> GRANT USAGE ON * . * TO 'vpopmail'@'localhost' IDENTIFIED BY 'PASSWORD' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
Query OK, 0 rows affected (0.001 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON `vpopmail` . * TO 'vpopmail'@'localhost';
Query OK, 0 rows affected (0.001 sec)
Failure is happening on non-alias virtualusers. Haven't tested the aliases, though I have made aliases.
Problem with latest patch
Roberto Puzzanghera KPC September 3, 2023 21:44 CET
You should select not only the user field but also the host. Anyway it seems that vpopmail@localhost exists.
I've no idea. I think that if you recompiile without valias it will work as no dB connection is needed.
Does the valias table exist? Try to create a valias and see if it's written correctly
Problem with latest patch
Roberto Puzzanghera Roberto Puzzanghera September 3, 2023 21:53 CET
I'd also try to connect with the vpopmail account and to
USE vpopmail;
SELECT * from valias;
Problem with latest patch
KPC Roberto Puzzanghera September 5, 2023 17:15 CET
I'm really at a loss.
As posted the other day the valias database seems to be correctly populated.
I've now granted access on all three of 0.0.0.0 localhost and 127.0.0.1 and tried those values in the file.
I've been able to get errors out of mariadb by looking at the service status and if I mangle the password intentionally it will throw a password error. When I restart qmail there is an aborted connection warning.
I've now set the vpopmail.mysql file to be 127.0.0.1 and changed the port to 3306. Per:
Sep 05 11:56:08 mariadbd[431485]: 2023-09-05 11:56:08 0 [Note] Server socket created on IP: '127.0.0.1'.
Sep 05 11:56:08 mariadbd[431485]: 2023-09-05 11:56:08 0 [Note] /usr/sbin/mariadbd: ready for connections.
Sep 05 11:56:08 mariadbd[431485]: Version: '10.6.12-MariaDB-0ubuntu0.22.04.1' socket: '/run/mysqld/mysqld.sock' port: 3306 Ubuntu 22.04
Though from this perspective 0 seemed to work as did 0.0.0.0 and localhost.
I recompiled vpopmail without valias, no change. I attempted to recompile it without any of the sql-database options (I could live without it using mysql/mariadb as long as dovecot pop/imap also works down the line) and that wouldn't compile at all.
Problem with latest patch
Roberto Puzzanghera KPC September 5, 2023 17:34 CET
Hi, can we continue the discussion via mail, just to avoid the bombing for those who subscribed the comments? :-) Please use the contact button above.
Please send the errors you eventually get in the mysql log.
If you disabled valias and continue to get db connections errors like "vdelivermail: deferred, database down", your vpopmail installation is a mess. The code speaks clearly:
file vdelivermail.c:
#ifdef VALIAS
/* process valiases if configured */
if ( process_valias() == 1 )
vexiterr (EXIT_OK, "vdelivermail: valiases processed");
/* if the database is down, deferr */
if ( verrori == VA_NO_AUTH_CONNECTION )
vexiterr (EXIT_DEFER, "vdelivermail: deferred, database down");
#endif
You can't get that error without VALIAS defined. Or your previous installation has not been overwritten. Check if VALIAS has been defined or not in ~vpopmail/include/config.h
Also you may have called an old vdelivermail and not installed vpopmail in another folder. Please post the following
which vdelivermail
grep -r vpopmail /etc/passwd
and the content of your .qmail-default
Problem with latest patch
Anonymous Roberto Puzzanghera September 3, 2023 22:00 CET
# mysql -u vpopmail -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
our MariaDB connection id is 1508
Server version: 10.6.12-MariaDB-0ubuntu0.22.04.1 Ubuntu 22.04
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> USE vpopmail;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MariaDB [vpopmail]> SELECT * from valias;
+----+---------------+------------------------+--------------------------+
| id | alias | domain | valias_line |
+----+---------------+------------------------+--------------------------+
(and it appears correctly populated)
I need aliases. though can get away with using .qmail-VUSER files if need be.
qmail outgoing ip with Ipv6 support
jacky August 27, 2021 21:02 CET
Hi all,
I search "Ipv6" keyword on this page but can not find the answer.
So qmail can send email to other mail server with IPv6 support or not?
I use tcpserver daemon to run qmail.
qmail outgoing ip with Ipv6 support
Roberto Puzzanghera jacky August 27, 2021 21:05 CET
Not with this qmail patch.
Edit: Only ucspi-tcp6 is ipv6 ready
qmail outgoing ip with Ipv6 support
Anonymous Roberto Puzzanghera August 27, 2021 22:16 CET
Hi Roberto
I will install ucspi-tcp6 and try to send and receive with IPv6
add qmail-spp to this patch
Jaky August 27, 2021 13:47 CET
Sorry , anyone can help me install qmail-spp http://qmail-spp.sourceforge.net/doc/ with this patch?
add qmail-spp to this patch
Roberto Puzzanghera Jaky August 27, 2021 17:58 CET
Hi, it should be quite easy to add the patch that was built for the old Bill Shupp's combined patch. But you should do it by hand because the qmail-smtpd.c from Shupp's patch is very different from mine
add qmail-spp to this patch
jacky Roberto Puzzanghera August 27, 2021 20:55 CET
Hi Roberto ,
Thank you for your reply. I will try to add by hand .
add qmail-spp to this patch
Roberto Puzzanghera jacky August 27, 2021 21:01 CET
Remember that those two qmail-qpp files are new and can be copied from a vanilla qmail patched with the same patch.
Then you only have to take care of the makefile, which is easy to adjust, and qmail-smtpd.c, where you just have to put those new lines in the right place
"TLS connect failed" on netqmail-tls 1.06.20110119_1
Andreas Bachmann July 8, 2021 14:34 CET
Hi Roberto,
My qmail installation (netqmail-tls 1.06.20110119_1 over the FreeBSD ports) can't send mails to Microsoft (and others) anymore for a few month. qmail tries to send it for a week and then give up. I read that Microsoft (and others) rejects TLSv1.0 now and accepts only TLSv1.2.
I just checked the last FreeBSD port. It uses the latest Frederik Vermeulen's patch (https://inoa.net/qmail-tls/netqmail-1.06-tls-20200107.patch). But I couldn't find any version number like TLSv1.0, TLSv1.1, TLSv1.2, etc.
- Does it not depend on qmail but on OpenSSL?
- So the patch from f.vermeulen will work with TLSv1.2?
TLS connect failed
Roberto Puzzanghera Andreas Bachmann July 8, 2021 18:31 CET
I think that the latest version will work with all TLS versions, I just remember that the SSLv3 support was removed after POODLE was spotted, but I'm not sure. You should contact the author of the patch for further informations
Or you can install the latest tls patch and test the connection against microsoft using openssl as explained in this guide
expanding allowed characters in mail adresses
Thomas June 18, 2021 19:33 CET
Hi Roberto,
in the patch there are a range of characters that are allowed in the mail address. The CHKUSER_ALLOW_RCPT_CHAR_* variables are used in the functions check_sender_address_format and check_rcpt_address_format in chkuser.c.
Our server with your latest patch rejects mails because of the address includes slashes. I really have no idea why people are thinking this is a good idea :)
2021-06-14 14:41:18.754723500 qlogenvelope: result=rejected code=553 reason=chkusersender detail=senderformat helo=**************** mailfrom=SRS0=R/yv=LI=**************** rcptto= relay=no rcpthosts= size= authuser= authtype= encrypted=tls sslverified=no localip=**************** localport=25 remoteip=**************** remoteport=56562 remotehost=**************** qp= pid=4456
2021-06-14 15:07:27.879168500 CHKUSER rejected sender: from <SRS0=R/yv=LI=****************|remoteinfo/auth:|chkuser-identify:> remote <helo:|remotehostname:****************|remotehostip:****************> rcpt <> : invalid sender address format
What do you think about either replace f.e. #define CHKUSER_ALLOW_RCPT_CHAR_9 '#' (because of '#' is also declared in the 2 functions ) or (my favorite) patch the 2 functions to declare the rest of the allowed characters?
&& (user->s[x] != '#')
&& (user->s[x] != '/')
and so on ...
As I understand the rfc the allowed characters are: !#$%&'*+-/=?^_`.{|}~
Regards Thomas
expanding allowed characters in mail adresses
Roberto Puzzanghera Thomas June 18, 2021 20:34 CET
Hi Thomas,
I think we can patch to define a CHKUSER_ALLOW_RCPT/SENDER_CHAR_11 for the slash character, so that those addresses will be allowed even when CHKUSER_ALLOW_RCPT_SRS is not defined. I'll do it in the following days.
expanding allowed characters in mail adresses
Thomas Roberto Puzzanghera June 24, 2021 18:50 CET
This will be good. I am awaiting your patch :)
expanding allowed characters in mail adresses
Roberto Puzzanghera Thomas June 24, 2021 18:54 CET
The patch is already in place ;)
expanding allowed characters in mail adresses
Thomas Roberto Puzzanghera July 8, 2021 19:00 CET
Oh. I did not realise this. Thank you :)
RSA/DH keys
Eric Broch June 11, 2021 01:57 CET
Hi Roberto,
I noticed the change of RSA/DH keys (rsa4096.pem/dh4096.pem) to length 4096 created by 'update_tmprsadh.sh', but the code has not changed, qmail-smtpd.c still only opens the rsa/dh pem files (below) of 2048 and 1024 length:
FILE *in = fopen("control/rsa2048.pem", "r")
FILE *in = fopen("control/dh2048.pem", "r")
FILE *in = fopen("control/dh1024.pem", "r");
This may be a stupid question by how does qmail utilize these new keys?
Eric
RSA/DH keys
Roberto Puzzanghera Eric Broch June 11, 2021 21:04 CET
Hi Eric,
yes, you are right. Actually I'm not using the self signed cert and didn't realized the problem.
RSA/DH keys
Ali Erturk TURKER Roberto Puzzanghera January 30, 2023 11:39 CET
Hi Roberto,
Thanks for your great website. I really learn a lot from you.
In your combined patch, below code from "qmail-smpt.c" looks buggy, and may cause performance issues when using TLS.
The statement "if (keylen == 2048)" will always fail and an ephemeral key will be created on every request, instead of using the static one:
+RSA *tmp_rsa_cb(SSL *ssl, int export, int keylen)
+{
+ ;
+
+ if (!export) keylen = 4096;
+ if (keylen == 2048) {
+ FILE *in = fopen("control/rsa4096.pem", "r");
+ if (in) {
+ rsa = PEM_read_RSAPrivateKey(in, NULL, NULL, NULL);
+ fclose(in);
+ if (rsa) return rsa;
+ }
+ }
RSA/DH keys
Roberto Puzzanghera Ali Erturk TURKER January 30, 2023 13:14 CET
Hi Ali, thanks for your comment.
I don't remember much of that piece of code, but I see that it's different from the original tls patch here
+if (!export) keylen = 4096;
-if (!export) keylen = 2048;
if (keylen == 2048) {
I think it was changed when there was a request to icreasethe RSA key and DH parameters to 4096 bit.
Unfortunately I'm very busy these days and I can't play with this before a couple of weeks. If you already know how to correct this, please post your solution
RSA/DH keys
Ali Erturk TURKER Roberto Puzzanghera January 30, 2023 17:00 CET
Hi again Roberto,
If you consider the file it tries to open is named rsa4096.pem, "keylen == 2048" is meaningless there,
and this bug will cause the creation of a temporary key in every request, which is a bad thing (TM).
The fix is pretty straightforward (build tested):
diff -ruN netqmail-1.06/qmail-smtpd.c netqmail-1.06-fixed/qmail-smtpd.c
--- netqmail-1.06/qmail-smtpd.c 2023-01-30 17:01:57.920116546 +0400
+++ netqmail-1.06-fixed/qmail-smtpd.c 2023-01-30 17:03:03.752370617 +0400
@@ -2156,7 +2156,7 @@
RSA *rsa;
if (!export) keylen = 4096;
- if (keylen == 2048) {
+ if (keylen == 4096) {
FILE *in = fopen("control/rsa4096.pem", "r");
if (in) {
rsa = PEM_read_RSAPrivateKey(in, NULL, NULL, NULL);
RSA/DH keys
Roberto Puzzanghera Ali Erturk TURKER January 30, 2023 17:06 CET
Thank you. I'll correct as soon as possible
Key too small
Anonymous March 19, 2021 08:51 CET
Debian 10 after update openssl have error
TLS_connect_failed:_error:141A318A:SSL_routines:tls_process_ske_dhe:dh_key_too_small
Key too small
Roberto Puzzanghera Anonymous March 19, 2021 20:36 CET
which version of openssl? what do you have in your /etc/ssl/openssl.cnf -> default_bits? do you get the error if you put default_bits=2048?
Key too small
Roberto Puzzanghera Anonymous March 20, 2021 18:27 CET
What openssl version? Do you have any hint to exactly reproduce the issue?
Key too small
Martin Sluka Roberto Puzzanghera October 1, 2022 07:18 CET
This problem is caused by target domains which do not support current encryption standards.
Some current examples for such domains are foni.net or versanet.de.
You can use https://www.checktls.com/TestReceiver to find out if a certain domain is affected; in the test output you should then see something like this:
| SSLVersion in use: TLSv1_2 | ||
| Cipher in use: DHE-RSA-AES256-GCM-SHA384 | ||
| Perfect Forward Secrecy: yes | ||
| Session Algorithm in use: DHE(1024 bits) | ||
| This may block some email, see DH key too small |
Of course the best way to solve this would be that the administrators of the target domain update their configuration. However, since we are currently experiencing this problem with a bunch of target domains since upgrading our system, I am currently looking for a workaround how we can still/again send e-mails to them encrypted until they have done so.
I find it interesting that sending an e-mail to these domains still works when I use "swaks -tls …" on the same system. But qmail refuses to talk to them. Any hints?
Or even:
Key too small – Workaround
Martin Sluka Martin Sluka October 1, 2022 12:32 CET
FYI: My current workaround is now:
cat /var/qmail/control/tlsclientciphers DEFAULT:!DH
I'm a bit afraid, however, that this might cause TLS problems with other target servers.
Key too small – Workaround
Roberto Puzzanghera Martin Sluka October 1, 2022 12:35 CET
Ok, thanks for your hint. Let us know if this causes problems with other servers
Key too small
Roberto Puzzanghera Martin Sluka October 1, 2022 09:40 CET
I didn't checked, but I think tls won't work if you disable SSL and leave active only TLS-1.x in your openssl configuration.
Error in qmail recompiling
Andy_GC December 18, 2020 18:11 CET
Hi,
I'm using Debian 10.7.0-amd64. Installation followed step-by-step with your directions.
During last recompiling (chkuser options included) I've got such errors
./compile chkuser.c
In file included from chkuser.c:43:
chkuser_settings.h:54:1: error: unknown type name ‘define’
define CHKUSER_STARTING_VARIABLE "CHKUSER_START"
^~~~~~
chkuser_settings.h:54:34: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before string constant
define CHKUSER_STARTING_VARIABLE "CHKUSER_START"
When chkuser all variables commented, recompilling qmail without any errors.
Error in qmail recompiling
Roberto Puzzanghera Andy_GC December 18, 2020 18:14 CET
please post your chkuser_settings.h somewhere (not here, 'cause it's too long), so that I can check the syntax
Error in qmail recompiling
Andy_GC Roberto Puzzanghera December 18, 2020 19:44 CET
I don't see my reply with link to my chkuser_settings.h so here post the part that generate errors
/*
* Uncomment the following line if you want chkuser to work depending on a VARIABLE setting
* VALUE HERE DEFINED is the name of the variable
* Values admitted inside the variable: NONE | ALWAYS | DOMAIN
* NONE = chkuser will not work
* ALWAYS = chkuser will work always
* DOMAIN = chkuser will work depending by single domain settings
* CHKUSER_STARTING_VARIABLE cannot be defined together with CHKUSER_ALWAYS_ON
* if CHKUSER_STARTING_VARIABLE is defined, and no variable or no value is set, then chkuser is disabled
*/
define CHKUSER_STARTING_VARIABLE "CHKUSER_START"
Error in qmail recompiling
Roberto Puzzanghera Andy_GC December 18, 2020 20:39 CET
You should not delete that hash # which goes before define, because in C language it's not intended as a character for comments. So it will be
#define CHKUSER_STARTING_VARIABLE "CHKUSER_START"
If you want to comment out a line, do like this
/* #define CHKUSER_STARTING_VARIABLE "CHKUSER_START" */
Error in qmail recompiling
Andy_GC Roberto Puzzanghera December 19, 2020 09:32 CET
Thx very much.
I don't know C language, in bash # is a comment so my misunderstunding.
Compilation error qmail with path and vpopmail
Bodan December 3, 2020 10:47 CET
Hi,
I have problem with compiling vpopmail and qmail with your patchset.
I can not compile qmail with chkuser because he required vpopmail:
./compile chkuser.c
chkuser.c:38:10: fatal error: vpopmail.h: No such file or directory
38 | #include "vpopmail.h"
| ^~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:334: chkuser.o] Error 1
I can not compile vpopmail because he reqired qmail:
configure: error: Unable to find your qmail-newu file, specify --enable-qmail-newu=/full/path/to/qmail-newu
Compilation error qmail with path and vpopmail
Roberto Puzzanghera Bodan December 3, 2020 14:12 CET
Please take the time needed to read these pages.
You must compile vanilla qmail, not the patched one, and then compile vpopmail on top of it. Then patch and recompile
Last pacth fail to compile
Ruben October 26, 2020 18:34 CET
Hi Roberto.
I'm using your directions to build some qmail servers. Pretty good job, sure.
Now I'm trying to update one of the servers, and receive a compilation error. I only have modified the chkuser_settings.h uncommenting the setting that you have noted. I was using the patch from 26-Aug-2018 before without those modification to this file, just apply patch and compile. My system is a Centos 7.5.1804.
./compile chkuser.c
In file included from chkuser.c:43:0:
chkuser_settings.h:306:1: error: nombre de tipo ‘define’ desconocido
define CHKUSER_RCPT_MX
^
chkuser_settings.h:313:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘define’
define CHKUSER_SENDER_FORMAT
^
chkuser_settings.h:313:1: error: nombre de tipo ‘define’ desconocido
make: *** [chkuser.o] Error 1
Last pacth fail to compile
Roberto Puzzanghera Ruben October 26, 2020 19:12 CET
Hi Ruben, can you post the content of line 306?
please take this into consideration related to qmail vulnerabilities
C July 27, 2020 00:15 CET
I am a qmail fan and i like your website ... used it to install qmailservers several times
please take this into consideration add the pach in your bundle if possible: https://cxsecurity.com/issue/WLB-2020050189
Thanks in advance
please take this into consideration related to qmail vulnerabilities
Roberto Puzzanghera C July 27, 2020 13:15 CET
Thank you. Patch added
Only Single E-mail Delivered
kittonian June 16, 2020 19:55 CET
I ran across a situation I did not know existed until yesterday when I was building an e-mail webapp and I'm hoping you can help explain and/or solve this.
When I send an e-mail to two aliases that both resolve to the same user account, only a single message gets delivered.
For example:
To: foo@bar.com
CC: foo2@bar.com
Both of these addresses are .qmail-foo and .qmail-foo2 inside the bar.com domain directory. Inside these files is the same real user's e-mail address so that they are forwarding accounts only.
If I send that e-mail to both of those aliases, only the latter gets delivered (i.e. the headers show that it was delivered to foo2@bar.com, even though qmail logs that it should be sending two e-mails and both the To and Cc headers are present).
If I change the message to send to foo@bar.com and bar@yahoo.com everything gets delivered properly. I read about someone else seeing the same thing with EXIM and while I'm sure it's a cool feature to limit bandwidth, it cause me hours of trying to nail down a problem with my code that didn't exist. So, I'd love to be able to disable this feature if possible. Thanks!
Only Single E-mail Delivered
kittonian kittonian June 16, 2020 21:24 CET
Never mind. This was traced out and qmail is working just fine, as is Vpopmail. It appears that Apple Mail is automatically deleting duplicate messages delivered to the same inbox.
rcptcount in qmail-smtpd.c
Alexandre Fonceca April 24, 2020 22:28 CET
I had some customers that create several emails in offline mode and when they connect, their outlook starts sending the emails saved in the outbox but some times gives the maxrcpt error (like when the mail has more rcpt to than "control/maxrcpt").
I noted that Outlook sends all emails sequentially, in a single connection, giving a rset after each message sending. But rcptcount is not reset.
to get around this, I had to add:
rcptcount = 0;
within the void smtp_rset function in qmail-smtpd.c
this solved the problem, so the maxrcpto error only occurs if you exceed the limit "control/maxrcpt" in the same email, but not in multiple messages sequentially.
regards,
void smtp_rset(arg) char *arg;
{
seenmail = 0; /* seenauth = 0; RFC 5321: retain authentication */
mailfrom.len = 0; rcptto.len = 0;
rcptcount = 0; // add by me
out("250 flushed\r\n");
}
rcptcount in qmail-smtpd.c
Roberto Puzzanghera Alexandre Fonceca April 25, 2020 14:43 CET
Thanks for the advise, I've updated my patch.
After speaking with Luca Franceschini, my italian friend who authored qlogenvelope and heavily modified the qmail-smtpd stuff, I patched as follows
void smtp_rset(arg) char *arg;
{
seenmail = 0; /* seenauth = 0; RFC 5321: retain authentication */
mailfrom.len = 0; rcptto.len = 0;
+rcptcount = 0;
+envelopepos = 1;
out("250 flushed\r\n");
}
Luca suggested also to add envelopepos = 1 just to set qlogenvelope as we are after an HELO/EHLO.
It's not clear WHEN outlook is going to RSET the session, hopefully not after the data has been sent, in that case we should also verify that the total size of the message is reset as well, not to exceed the 'datalimit' for multiple messages.
Chkuser configuration
kittonian February 15, 2020 20:01 CET
I am using your previous patch (Dec 8, 2019) and chkuser and vpopmail are playing nicely. I am not using Mysql with vpopmail, just file based.
When I installed your latest patch (Jan 11, 2020) I could send e-mails out but could not receive anything. All messages failed back to the sender with a failure notice stating "sorry, no mailbox here by that name (chkuser)"
I stopped all qmail services and installed the previous version I kept as a backup, just in case I had issues with the new patch, and everything is back and working.
So, it would be great to get this resolved.
That being said, I am having a major issue with how qmail is processing e-mails prior to sending through SpamAssassin. This is an old system and I am using Qmail-Scanner to connect SA and Qmail. It works just fine, but Qmail is apparently stripping out certain portions of the e-mail because two things are occurring:
1. None of my whitelist_from_rcvd or whitelist_auth lines work.
We tested this against a postfix system and used the entire text of the e-mail against SpamAssassin on this server, and sure enough whitelisting worked as it should. DKIM headers are missing and who knows what else.
2. Every e-mail gets tagged with no rDNS, even though obviously Yahoo, Gmail, etc. all have correct PTR entries for their domain names. Again, when the same e-mail from postfix was tested on this server, SA had no issues finding the rDNS for the sender's domain.
Thanks!
Chkuser configuration
Roberto Puzzanghera kittonian February 15, 2020 20:42 CET
This is strange as the latest modifications did not touch qmail-smtpd.c, where chkuser acts and concerns only ssl (diff here). Can you post your run and tcp.smtp files?
Concerning the qmail-scanner issue, I replaced it with simscan ages ago and I don't even remember how it works, I'm sorry.
Chkuser configuration
kittonian Roberto Puzzanghera February 15, 2020 22:11 CET
The good news is that I finally solved my whitelisting and rdns issue by removing the -H flag from my /service/qmail-smtpd/run file (i.e. /usr/bin/tcpserver -v -R -l "$LOCAL"). That re-enabled dns lookups and everything started working properly again on that front. The other issue with chkuser is still a problem of course so I'm using your previous patch as mentioned above.
This is my /service/qmail-smtpd run file
#!/bin/sh
QMAILDUID=`id -u qmaild`
NOFILESGID=`id -g qmaild`
MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`
SOFTLIMIT=`cat /var/qmail/control/softlimit`
LOCAL=`head -1 /var/qmail/control/me`
# This enables greetdelay for qmail-smtpd
export SMTPD_GREETDELAY=20
export DROP_PRE_GREET=1
# This enables chkuser
export CHKUSER_START=ALWAYS
# DKIM - SURBL configuration
# DKIMQUEUE and SURBLQUEUE are front-ends of qmail-queue
export SURBL=1 # Comment out to disable SURBL filtering
export QMAILQUEUE=/var/qmail/bin/surblqueue # executes surblfilter
export SURBLQUEUE=/var/qmail/bin/qmail-dkim # executes qmail-dkim afer sublfilter
export DKIMQUEUE=/var/qmail/bin/simscan # simscan is executed after qmail-dkim
# DKIM verification. Use carefully
#export DKIMVERIFY="FGHKLMNOQRTVWjp"
# This is to avoid verification of outgoing messages
export RELAYCLIENT_NODKIMVERIFY=1
# This turns off TLS on port 25
export DISABLETLS="1"
# Requires that authenticated user and 'mail from' are identical
#export FORCEAUTHMAILFROM="1"
# rcptcheck-overlimit. Limits the number of emails sent by relayclients
#export RCPTCHECK=/var/qmail/bin/rcptcheck-overlimit.sh
#export RCPTCHECKRELAYCLIENT="1"
# This enables simscan debug
#export SIMSCAN_DEBUG=4
exec /usr/local/bin/softlimit -m "$SOFTLIMIT" \
/usr/bin/tcpserver -v -R -l "$LOCAL" \
-x tcp.cdb -c "$MAXSMTPD" \
-u "$QMAILDUID" -g "$NOFILESGID" 0 25 \
/var/qmail/bin/qmail-smtpd \
/home/vpopmail/bin/vchkpw /bin/tru 2>&1
This is my /service/qmail-smtpd/tcp file
# rules for qmail-smtpd see tcprules(1)
127.:allow,RELAYCLIENT="",QS_SPAMASSASSIN="",QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue"
:allow,QS_SPAMASSASSIN="",QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue"
:allow,DKVERIFY="DEGIJKfh,CGHIJMQRkl",AUTH_UNSET_DKVERIFY=""
Chkuser configuration
Roberto Puzzanghera kittonian February 15, 2020 22:21 CET
you should run qmail-smtpd as vpopmail, not qmaild
Secondly, assigning QMAILQUEUE to qmail-scanner in your tcp.smtp certainly prevents dkim to sign your outgoing mails.
Chkuser configuration
Anonymous Roberto Puzzanghera February 15, 2020 22:28 CET
I use a qmail-remote wrapper script so that my outgoing messages are signed, which works perfectly.
Not sure about running as vpopmail as your previous patch works just fine. It's only the new patch that seems to break chkuser against vpopmail.
Chkuser configuration
Roberto Puzzanghera Anonymous February 16, 2020 12:27 CET
So how can chkuser check users' existence without vpopmail priviledges?
I guess that in your previous installation you enabled CHKUSER_ENABLE_UIDGID before compiling, in order to run qmail-smtpd with a user diffrerent from vpopmail (look here).
Chkuser configuration
Anonymous Roberto Puzzanghera February 16, 2020 14:51 CET
Nope. I compared the previous chkuser_settings.h with the new one and the new one has quite a bit more code in it. However, the exact same lines were commented out in both.
Here are the variables that are commented out in both:
ALWAYS_ON
ENABLE_UIDGID
SPECIFIC_BOUNCING
VGET_REAL_DOMAIN
ENABLE_VALIAS
ENABLE_USERS_EXTENSIONS
ENABLE_MAILMAN_LISTS
ACCEPT_NULL_SENDER
ENABLE_NULL_SENDER_WITH_TCPREMOTEHOST
EXTRA_MUSTAUTH_VARIABLE
Chkuser configuration
kittonian Anonymous June 16, 2020 20:53 CET
My apologies that I did not come back and post the solution to this issue, which btw, is still present in your latest patch.
Here's how to solve it:
nano chkuser_settings.h
Look for the line
#define CHKUSER_STARTING_VARIABLE "CHKUSER_START"
Comment out this line by:
/*
#define CHKUSER_STARTING_VARIABLE "CHKUSER_START"
*/
Chkuser configuration
Roberto Puzzanghera kittonian June 16, 2020 21:30 CET
Not defining CHKUSER_STARTING_VARIABLE completely disables chkuser, unless you have CHKUSER_ALWAYS_ON defined. I don't think this is what we want
Chkuser configuration
kittonian Roberto Puzzanghera June 17, 2020 21:48 CET
Makes sense, however this is the only way I can get qmail to compile and install with your latest patches, and everything works just fine for me. If chkuser was disabled, wouldn't vpopmail fail to send and deliver messages?
Chkuser configuration
Roberto Puzzanghera kittonian June 17, 2020 22:32 CET
chkuser is disabled in this way, and even though qmail/vpopmail can work without it you'll get an increase of spam. chkuser and vpopmail can work together with my configuration, which is the same suggested by the author, i.e. running qmail as vpopmail
qmail-send concurrency issue
Gabriel Torres January 7, 2020 11:26 CET
Hi Roberto,
We have an old issue here that we were never able to understand or fix.
We have concurrencyremote set to 120
When sending out a newsletter to 400,000 subscribers, the number of concurrent connections always drops to less than 10.
Right now we are sending our newsletter and here is what we have:
@400000005e146a3a2ef8509c status: local 0/40 remote 7/120 suppl0 0/1 suppl1 2/5 suppl2 0/1
See how we only have 7 concurrent connections going on.
But if we use qmailctl to check the queue, we still have a huge number of queued emails:
messages in queue: 135384
messages in queue but not yet preprocessed: 135305
I was never able to understand what causes this behavior of qmail-remote not going anywhere close to the concurrencyremove limit. I did a Google search several times, found other people with the same issue, but no solution or any hint of how to debug this or what might be causing it.
If you have any pointers on how to start debugging this I'd appreciate it.
Thank you in advance!
qmail-send concurrency issue
Roberto Puzzanghera Gabriel Torres January 8, 2020 17:43 CET
Hi Gabriel,
I don't know exactly what can be the cause, but the CHANNELS file (CAVEATS) reminds us that <<concurrencyremote, concurrencysupplX, etc are each subject to the hard limit in conf-spawn, which in turn is bounded by per-process limits>>... anyway your concurrency seems to be very low.
chkuser
ChangHo.Na November 30, 2019 03:21 CET
Hi.
MariaDB log:
[Warning] Aborted connection 58 to db: 'vpopmail' user: 'vpopmail' host: 'localhost' (Got an error reading communication packets)
# The client connected successfully but terminated improperly (and may relate to not closing the connection properly)
chkuser_settings.h:
#define CHKUSER_DB_CLEANUP
chkuser.c:
void chkuser_cleanup (int exit_value) {
#if defined CHKUSER_DB_CLEANUP
vclose (); /* can't call function */
#endif
_exit (exit_value);
}
Modify:
#define CHKUSER_DB_CLEANUP -> #define CHKUSER_DB_CLEANUP 1
or
#if defined CHKUSER_DB_CLEANUP -> #ifdef CHKUSER_DB_CLEANUP
Thank you.
chkuser
Roberto Puzzanghera ChangHo.Na November 30, 2019 20:29 CET
Thanks for your comment.
I have CHKUSER_DB_CLEANUP defined as well, but I've never seen such an error. How can I reproduce it?
chkuser
ChangHo.Na Roberto Puzzanghera December 2, 2019 01:38 CET
chkuser.h
#ifdef TLS_H
#undef _exit
#define _exit(value) { if (ssl) ssl_free(ssl); chkuser_cleanup(value); }
#else
#define _exit(value) chkuser_cleanup(value) /* can't override _exit() function */
#endif
------------------
My Test
chkuser.c
add: #include
void chkuser_cleanup (int exit_value) {
syslog(LOG_NOTICE, "[NOTICE: %s][__LINE__ : %d] %s", __FILE__, __LINE__, __FUNCTION__);
...
}
check: /var/log/message
result: nothing
---------------------
Below is executed correctly.
int chkuser_realrcpt (stralloc *sender, stralloc *rcpt) {
...
retstat = realrcpt (sender, rcpt);
#if defined CHKUSER_DB_CLEANUP
syslog(LOG_NOTICE, "[NOTICE: %s][__LINE__ : %d] %s", __FILE__, __LINE__, __FUNCTION__);
vclose();
#endif
switch (retstat) {
...
Did I test it?
Thank you.
chkuser
Roberto Puzzanghera ChangHo.Na December 3, 2019 12:18 CET
while compiling I get
chkuser.c:1049:9: error: 'LOG_NOTICE' undeclared (first use in this function)
syslog(LOG_NOTICE, "[NOTICE: %s][__LINE__ : %d] %s", __FILE__, __LINE__, __FUNCTION__);
chkuser
Roberto Puzzanghera ChangHo.Na December 3, 2019 18:51 CET
I can confirm that the code inside the chkuser_cleanup function is not executed. But I don't get any mariadb error
chkuser
ChangHo.Na Roberto Puzzanghera December 7, 2019 22:10 CET
Hi.
I found the cause of the problem.
tls.h
#define _exit ss_exit
chkuser.h
/* Called before tls.h is called. */
#ifdef TLS_H
#undef _exit
...
#endif
Solutions:
qmail-smtpd.c line 77 #ifdef block:
#ifdef TLS
...
#endif
move to before this line.
#include "chkuser.h"
Now works correctly.
Thank you.
chkuser
ChangHo.Na Roberto Puzzanghera December 4, 2019 00:34 CET
MariaDB 10.x version: log warning messages.
MariaDB version 5.X : warning messages are not logged.
Anyway, I think vclose() function should be executed
Thank You.
chkuser
ChangHo.Na Roberto Puzzanghera December 1, 2019 14:43 CET
Sorry ^^
Maybe it's a different matter.
I will write again if I find the cause.
Thank you.
qlogenvelope: reason=authnotmailfrom
nic November 20, 2019 03:31 CET
Hi Roberto,
Can you tell me what qlogenvelope: result=rejected code=503 reason=authnotmailfrom detail means?
qlogenvelope: reason=authnotmailfrom
Roberto Puzzanghera nic November 20, 2019 14:48 CET
It means that the user who did the authentication is different from the one in the mailfrom field. This is because you have
export FORCEAUTHMAILFROM=1
in your run file
qlogenvelope: reason=authnotmailfrom
Anonymous Roberto Puzzanghera November 20, 2019 15:14 CET
Thank you, Roberto
Bug with Received: line
Gabriel Torres July 6, 2019 06:33 CET
Hi Roberto,
I found a bug caused by your patch. The header from received emails are, for some reason, filling with '0' where there should be the server name. Let me explain.
In the header of receiving emails, I see:
Received: from unknown (HELO somedomain.com) (a.b.c.d)
by 0 with SMTP; 5 Jul 2019 19:08:08 -0300
Note the "by 0" part. It should read:
Received: from unknown (HELO somedomain.com) (a.b.c.d)
by mail.ourdomain.com with SMTP; 5 Jul 2019 19:08:08 -0300
Digging this further, the function that fills that part is received() found in received.c. The variable called "local" (which is a copy of the TCPLOCALHOST variable) is somehow being deleted or misconfigured somewhere.
I made a temporary fix by hardcoding our FQDN there, but obviously we need to investigate this further to find out where exactly this variable is being transformed into a zero.
I hope you can investigate this. I will try to take a look at this myself later, even though I am not too familiar with the C language.
Thank you in advance.
Cheers,
Gabriel.
Bug with Received: line
Roberto Puzzanghera Gabriel Torres July 7, 2019 16:01 CET
got it! 0 was the value of TCPLOCALHOST (in this case, set using the -l option to tcpserver). For example:
/usr/local/bin/tcpserver -v -H -R -l "yourdomain.tld"
Bug with Received: line
Roberto Puzzanghera Roberto Puzzanghera July 7, 2019 18:31 CET
it's worth to mention that djb's tcpserver documentation suggests to use "-l 0" as a choice
-l localname: Do not look up the local host name in DNS; use localname for the environment variable $TCPLOCALHOST. A common choice for localname is 0. To avoid loops, you must use this option for servers on TCP port 53.
Btw, I modified my documentation passing the content of control/me as suggested by life with qmail
Bug with Received: line
Gabriel Torres Roberto Puzzanghera July 10, 2019 20:35 CET
Perfect. This makes much more sense than using using 0. By using 0, SpamCop isn't able to parse the email headers, so reporting spam to SpamCop with spamassassin -r doesn't work. Please take a look here to fully understand how I found out that this Received: line was malformed: http://forum.spamcop.net/topic/39031-resolvednbspmailhost-configuration-problem-identified-internal-ip-as-source/
Bug with Received: line
kittonian Gabriel Torres June 16, 2020 18:48 CET
I had this exact same issue and apparently it has to do directly with the -H option in the tcpserver line. That is what prevents reverse DNS lookups. I took out -H and all is well (at least I think so, lol).
Bug with Received: line
Roberto Puzzanghera kittonian June 17, 2020 17:33 CET
Thanks for the hint. I modified my configuration accordingly
Bug with Received: line
Gabriel Torres kittonian June 16, 2020 22:41 CET
Many thanks, this tip of removing the -H was really helpful!
Before:
Received: from unknown (HELO mail-lj1-f179.google.com) (209.85.208.179)
After:
Received: from mail-lj1-f174.google.com (209.85.208.174)
Bug with Received: line
Roberto Puzzanghera Gabriel Torres July 6, 2019 09:48 CET
I think this is because the server IP is hidden by this patch (as you know 0 stands for localhost) https://notes.sagredo.eu/files/qmail/patches/qmail-hide-ip-headers.patch
Actually we can get rid of this patch as explained here https://lists.gt.net/qmail/users/126552
Try to revert it and please let me know.
PS did you have the time to play with my new testing patch with the qmail-channels? look here
Bug with Received: line
Roberto Puzzanghera Roberto Puzzanghera July 6, 2019 13:07 CET
sorry, that patch has nothing to do with it... I'll do some checks and let you know
Bug with Received: line
Gabriel Torres Roberto Puzzanghera July 6, 2019 15:53 CET
Hi,
Forgot to mention that the same issue happens in the SPF line as follows. I also had to manually edit and hardcode our server name in spf.c
It is showing:
Received-SPF: none (0: domain at email.invisionpower.com does not designate permitted sender hosts)
Whereas it should be:
Received-SPF: none (mail.ourdomain.com: domain at email.invisionpower.com does not designate permitted sender hosts)
Regarding the other patch, I need some time when our server isn't sending our newsletters to try it out... :) I will probably have the time to do so during this coming week! I will let you know and appreciate your effort!
Gabriel.
Pay attention to permissions for DKIM signing
Gabriel Torres June 24, 2019 18:51 CET
If your outgoing emails aren't being DKIM-signed, please check permissions of the folder /usr/local/etc/domainkeys/ and below. With me, I had to change ownership manually to qmailr.
"When you create a key for a domain.net it will be stored in the /usr/local/etc/domainkeys/domain.net folder. The folder will be owned by qmailr (the user running qmail-remote) if you sign at qmail-remote level or vpopmail, which is the user who runs qmail-smtpd, if you decide to sign at qmail-smtpd level. My script changes the owner to qmailr by default"
softlimit error message
Gabriel Torres June 19, 2019 04:38 CET
If you get the following error at /var/log/qmail/smtpd/current
/var/qmail/bin/qmail-smtpd: error while loading shared libraries: libdl.so.2: failed to map segment from shared object
Simply increase the value present in /var/qmail/control/softlimit
Here I added 64000000 and is working fine
qmail-channels
Gabriel Torres June 18, 2019 17:10 CET
Hi Roberto,
Try adding this patch: http://www.thesmbexchange.com/eng/qmail-channels_patch.html
This is something we need to slow down delivery to certain ISPs, so emails will be correctly delivered. (We run a weekly newsletter.)
Cheers.
qmail-channels
Roberto Puzzanghera Gabriel Torres June 18, 2019 19:44 CET
nice patch, but... I don't have the time to accomplish personal requests...
qmail-channels
Gabriel Torres Roberto Puzzanghera June 18, 2019 23:13 CET
Hi Roberto,
Maybe this will help other people as well? Anyway, I made a donation to you earlier today via Paypal. Keep up the nice job of keeping this website up-to-date.
Cheers,
Gabe.
qmail-channels
Roberto Puzzanghera Gabriel Torres June 19, 2019 08:13 CET
Thank you very much for your donation and contributions. I'll take a deeper look at this patch, but it seems to me that it's too much invasive, as it completely changes the logic of the qmail queue...
qmail-channels
Gabriel Torres Roberto Puzzanghera June 25, 2019 20:19 CET
The thing is, we run a newsletter with 400,000 subscribers, and some email providers complain that we are sending too many emails at the same time. For example:
2019-06-24 19:33:47.462279500 delivery 34301: deferral: 200.147.36.13_does_not_like_recipient./Remote_host_said:_450_4.7.1_<xxxxxxxxxx@bol.com.br>:_Recipient_address_rejected:_MX-AFL-02_-_Too_many_messages,_try_again_later./Giving_up_on_200.147.36.13./
So it would be great to have a way to limit the number of emails sent out based on the destination domain.
It doesn't need to be this specific patch, just something to think about.
Thanks!
qmail-channels
Roberto Puzzanghera Gabriel Torres June 26, 2019 18:29 CET
you have a testing patch embedding qmail-channels here. Can you test the channels functionality please?
I configured it not to create additional channels, so you have to edit conf-channels and increase the number of qmail-rspawn processes to be created (it was 22 before my adjustment)
PS thanks for helping me improve this guide
qmail-channels
Gabriel Torres Roberto Puzzanghera July 10, 2019 21:10 CET
Hi Roberto,
I finally had the time to install this patch and configure qmail-channels. Now I need to wait until we send out our next newsletter to see if qmail is separating emails in separate queues based on the destination domain. I should have a detailed analysis for us within the next couple of days. Stay tuned!
Many thanks for integrating this patch for me! :)
After my original message, Yahoo is now also refusing our newsletters because we are sending too many emails at the same time:
@400000005d24ae9631f30a6c delivery 417355: deferral: Connected_to_67.195.228.94_but_sender_was_rejected./Remote_host_said:_421_4.7.0_[TSS04]_Messages_from_XXXXXXXX_temporarily_deferred_due_to_user_complaints_-_4.16.55.1;_see_https://help.yahoo.com/kb/postmaster/SLN3434.html/
So I have high hopes that this patch will fix this issue.
Cheers,
Gabriel.
qmail-channels
miz Gabriel Torres July 11, 2019 14:22 CET
Hello Gabriel,
delivering mails to yahoo has always been difficult. I'm not familiiar with the qmail channel patch, but you have to limit the number of mails per second in order to avoid the block.
In postfix this can be achieved in the following way: https://serverfault.com/questions/56719/postfix-stagger-rate-limit-outbound-mail
Hope this might help !
qmail-channels
Roberto Puzzanghera miz July 11, 2019 15:21 CET
It seems that yahoo accepts a maximum of 20 msg per connection, so this patch should do the trick... look here https://help.yahoo.com/kb/SLN3433.html
qmail-channels
Gabriel Torres Roberto Puzzanghera July 12, 2019 15:33 CET
Hi Roberto,
The qmail-channels patch you integrated in your patch worked like a charm to fix the yahoo issue described above. We could use the postfix solution you linked above, but it would only work in our webserver (where postfix is used to accept and send emails to our email server, which is running qmail), whereas with qmail-channels we have the solution valid for all emails sources in our setup, which is best.
The configuration of qmail-channels is quite simple. After applying the patch, and before compiling qmail, we need to edit conf-channels and add the total number of queues we want. The default is 2, meaning local and remote. As I wanted two additional queues (two group of domains we wanted to limit the delivery rate), I changed that to 4 and compiled qmail.
Then, we need to add the configuration files at /var/qmail/control:
suppls0 - the list of domains for this group. In my case:
bol.com.br
zipmail.com.br
suppls1 - the list of domains for this group. In my case:
yahoo.com
ymail.com
yahoo.co.uk
yahoo.com.br
yahoo.fr
yahoo.de
yahoo.es
yahoo.cn
yahoo.it
yahoo.co.jp
yahoo.com.au
yahoo.in
yahoo.com.ar
yahoo.com.mx
yahoo.no
yahoo.ie
yahoo.com.es
yahoo.ca
yahoo.co.nz
yahoo.gr
yahoo.com.vn
yahoogrupos.com.br
yahoo.se
yahoo.dk
yahoo.ro
yahoo.co.in
yahoomail.com
yahoo.co.id
yahoo.com.sg
yahoo.com.ph
concurrencysuppl0 - with the number of simultaneous outgoing emails for the domain group "0"
concurrencysuppl1 - with the number of simultaneous outgoing emails for the domain group "1"
Restarted qmail and voilá!
Thank you for all your help. Our qmail server is now "perfect".
Cheers.
qmail-channels
Roberto Puzzanghera Gabriel Torres July 12, 2019 15:58 CET
Great! Can you share your control/concurrencysuppl* files please? Suitable concurrency values could be useful to someone else...
qmail-channels
Gabriel Torres Roberto Puzzanghera July 13, 2019 14:59 CET
Hi Roberto,
I am still testing the numbers. I have concurrencysuppl0 with 1 and concurrencysuppl1 with 10 right now. According to what the other user posted above, we could increase the Yahoo queue up to 20.
Another note: I had to increase the softlimit configuration. Otherwise I would get the infamous "qq temporary problem" at /var/log/qmail/smtpd/current
Cheers
qmail-channels
Jacky Gabriel Torres February 26, 2026 12:03 CET
Hi roberto puzzanghera
I added 3 more channels but in qmail-send's log only output for 2 more channels.
So this qmail-channels is only support 2 more channels?
status: local 0/150 remote 0/60 suppl0 0/10 suppl1 0/20
qmail-channels
Roberto Puzzanghera Jacky February 26, 2026 13:14 CET
Sorry, I've no idea. It's working here
qmail-channels
Jacky Roberto Puzzanghera February 26, 2026 13:56 CET
Hi roberto puzzanghera
Thank you for your confirmation.
I will check my qmail's config again.
qmail-channels
Gabriel Torres Jacky February 26, 2026 19:18 CET
I have 6 different channels configured here, working like a charm.
You need to edit the file conf-channels before compiling qmail with make setup check.
Also, make sure qmail is stopped (qmailctl stop) before compiling it.
Cheers.
ChangHo.Na April 25, 2019 06:09 CET
Hi,
Latest stable combined patch for netqmail-1.06 v. 2019.04.09
My OpenSSL Version: 1.0.2k
Error send mail.
Modify file: qmail-smtpd.c
before:
2331 #if OPENSSL_VERSION_NUMBER >= 0x10100000L
2332 /* support ECDH */
2333 SSL_CTX_set_ecdh_auto(ctx,1);
2334 #endif
after:
OPENSSL_VERSION_NUMBER >= 0x10002000L
Please check!
hardcoded llinks to /home/vpopmail
GoofY April 10, 2019 02:56 CET
I've installled vpopmail to a different folder (in my case /var/vpopmail).
While running make in the netqmail dir I encountered an error in chkuser.c, it couldn't find the vpopmail.h file, I edited this to /var/vpopmail/include, which worked for that part.
But after continueing I got more errors:
./load qmail-smtpd chkuser.o dns.o rcpthosts.o commands.o timeoutread.o \
strerr.a wildmat.o qregex.o \
timeoutwrite.o ip.o ipme.o ipalloc.o strsalloc.o control.o \
tls.o ssl_timeoutio.o ndelay.a -L/usr/local/ssl/lib -lssl -lcrypto \
constmap.o received.o date822fmt.o now.o qmail.o spf.o cdb.a \
fd.a wait.a datetime.a getln.a open.a sig.a case.a env.a stralloc.a \
alloc.a substdio.a error.a strerr.a str.a fs.a auto_qmail.o base64.o policy.o \
`head -1 /home/vpopmail/etc/lib_deps` `cat dns.lib` \
`cat socket.lib`
head: cannot open '/home/vpopmail/etc/lib_deps' for reading: No such file or directory
chkuser.o: In function `realrcpt':
/usr/local/src/netqmail-1.06/chkuser.c:746: undefined reference to `vget_assign'
/usr/local/src/netqmail-1.06/chkuser.c:875: undefined reference to `vauth_getpw'
/usr/local/src/netqmail-1.06/chkuser.c:906: undefined reference to `format_maildirquota'
/usr/local/src/netqmail-1.06/chkuser.c:906: undefined reference to `vmaildir_readquota'
chkuser.o: In function `chkuser_cleanup':
/usr/local/src/netqmail-1.06/chkuser.c:462: undefined reference to `vclose'
collect2: error: ld returned 1 exit status
Makefile:1757: recipe for target 'qmail-smtpd' failed
make: *** [qmail-smtpd] Error 1
So I ended up creating a symlink (ln -s /var/vpopmail /home) , after that 'make' succeeded.
PS THNX for ur effort with this tutorial/toaster.
hardcoded llinks to /home/vpopmail
Roberto Puzzanghera GoofY April 10, 2019 07:36 CET
Have you tried to modify this line on top of the Makefile?
VPOPMAIL_HOME=/home/vpopmail
Still require libdomainkeys-0.69.diff
Tony Fung April 8, 2019 09:10 CET
Hi,
I just compile libdomainkeys with patch "libdomainkeys-openssl-1.1.patch" but result with underneath error when running make:
./libdomainkeys.a(dns_txt.o): In function `dns_text':
dns_txt.c:(.text+0x25): undefined reference to `__res_query'
dns_txt.c:(.text+0xa1): undefined reference to `__dn_expand'
dns_txt.c:(.text+0xfc): undefined reference to `__dn_expand'
collect2: error: ld returned 1 exit status
make: *** [dktest] Error 1
When apply the missing patch "libdomainkeys-0.69.diff" and compile again, it did success.
Is the patch "libdomainkeys-openssl-1.1.patch" not completed or mistake to remove the patch "libdomainkeys-0.69.diff" from download and step?
Still require libdomainkeys-0.69.diff
Roberto Puzzanghera Tony Fung April 8, 2019 12:46 CET
Yes, we have to apply that patch as well. Thanks for letting me know
Cant compile libdomainkeys
Madzel February 19, 2019 08:45 CET
gcc-6.1 -DBIND_8_COMPAT -O2 -o makeheader makeheader.c
./makeheader domainkeys.h
gcc-6.1 -DBIND_8_COMPAT -O2 -c dktest.c -I.
gcc-6.1 -DBIND_8_COMPAT -O2 -c domainkeys.c -I.
domainkeys.c:123:14: Fehler: Feld »mdctx« hat unvollständigen Typen
EVP_MD_CTX mdctx; /* the hash */
^~~~~
domainkeys.c: In Funktion »dkheaders«:
domainkeys.c:1285:5: Warnung: Typkonvertierung in Zeiger von Ganzzahl anderer Breite [-Wint-to-pointer-cast]
(void *)dk_headers(dk, dk->headers);
^
domainkeys.c: In Funktion »dk_free«:
domainkeys.c:2155:3: Warnung: Implizite Deklaration der Funktion »EVP_MD_CTX_cleanup« [-Wimplicit-function-declaration]
EVP_MD_CTX_cleanup(&dk->mdctx);
^~~~~~~~~~~~~~~~~~
domainkeys.c:2162:6: Warnung: »ERR_remove_state« ist veraltet [-Wdeprecated-declarations]
ERR_remove_state(0);
^~~~~~~~~~~~~~~~
In file included from /usr/include/openssl/evp.h:13:0,
from domainkeys.c:27:
/usr/include/openssl/err.h:260:1: Anmerkung: hier deklariert
DEPRECATEDIN_1_0_0(void ERR_remove_state(unsigned long pid))
^
Makefile:23: recipe for target 'domainkeys.o' failed
make: *** [domainkeys.o] Error 1
Any idea?
Cant compile libdomainkeys
Roberto Puzzanghera Madzel February 19, 2019 08:55 CET
Try to apply the patch linked on top of this page. Let me know if it solves.
Cant compile libdomainkeys
Madzel Roberto Puzzanghera February 19, 2019 10:23 CET
The patch was applied already.
Cant compile libdomainkeys
Roberto Puzzanghera Madzel February 19, 2019 18:47 CET
sorry if I ask... but this is an error which comes when you don't apply this patch https://notes.sagredo.eu/files/qmail/patches//libdomainkeys-openssl-11.patch. Can you confirm that this is the patch you applied?
Cant compile libdomainkeys
Madzel Roberto Puzzanghera February 20, 2019 07:24 CET
Yes, i used the linked openssl patch. I have all downloaded data deletetd and repeated the whole procedure again:
root@threepwood:~/libdomainkeys# wget https://notes.sagredo.eu/files/qmail/patches/libdomainkeys-openssl-11.patch
--2019-02-20 08:18:47-- https://notes.sagredo.eu/files/qmail/patches/libdomainkeys-openssl-11.patch
Auflösen des Hostnamen »notes.sagredo.eu (notes.sagredo.eu)«... 91.121.144.116
Verbindungsaufbau zu notes.sagredo.eu (notes.sagredo.eu)|91.121.144.116|:443... verbunden.
HTTP-Anforderung gesendet, warte auf Antwort... 200 OK
Länge: 1091 (1,1K) [text/plain]
In »»libdomainkeys-openssl-11.patch«« speichern.
libdomainkeys-openssl-11.patch 100%[==========================================================================================================================================>] 1,07K --.-KB/s in 0s
2019-02-20 08:18:47 (11,8 MB/s) - »»libdomainkeys-openssl-11.patch«« gespeichert [1091/1091]
root@threepwood:~/libdomainkeys# patch < libdomainkeys-openssl-11.patch
patching file domainkeys.c
root@threepwood:~/libdomainkeys# vi Makefile
root@threepwood:~/libdomainkeys# make
gcc-6.1 -DBIND_8_COMPAT -O2 -o makeheader makeheader.c
./makeheader domainkeys.h
gcc-6.1 -DBIND_8_COMPAT -O2 -c dktest.c -I.
gcc-6.1 -DBIND_8_COMPAT -O2 -c domainkeys.c -I.
In file included from domainkeys.c:27:0:
domainkeys.c: In Funktion »dk_sign«:
domainkeys.c:510:16: Warnung: Übergabe des Arguments 1 von »EVP_DigestInit« von inkompatiblem Zeigertyp [-Wincompatible-pointer-types]
EVP_SignInit(&dk->mdctx, dklib->md);
^
/usr/local/include/openssl/evp.h:555:12: Anmerkung: »EVP_MD_CTX * {aka struct evp_md_ctx_st *}« erwartet, aber Argument hat Typ »EVP_MD_CTX ** {aka struct evp_md_ctx_st **}«
__owur int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type);
^~~~~~~~~~~~~~
domainkeys.c: In Funktion »dk_verify«:
domainkeys.c:548:18: Warnung: Übergabe des Arguments 1 von »EVP_DigestInit« von inkompatiblem Zeigertyp [-Wincompatible-pointer-types]
EVP_VerifyInit(&dk->mdctx, dklib->md);
^
/usr/local/include/openssl/evp.h:555:12: Anmerkung: »EVP_MD_CTX * {aka struct evp_md_ctx_st *}« erwartet, aber Argument hat Typ »EVP_MD_CTX ** {aka struct evp_md_ctx_st **}«
__owur int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type);
^~~~~~~~~~~~~~
domainkeys.c: In Funktion »dkhash«:
domainkeys.c:942:26: Warnung: Übergabe des Arguments 1 von »EVP_DigestUpdate« von inkompatiblem Zeigertyp [-Wincompatible-pointer-types]
EVP_DigestUpdate(&dk->mdctx, dk->hash_buff, dk->hash_buff_len);
^
In file included from domainkeys.c:27:0:
/usr/local/include/openssl/evp.h:546:12: Anmerkung: »EVP_MD_CTX * {aka struct evp_md_ctx_st *}« erwartet, aber Argument hat Typ »EVP_MD_CTX ** {aka struct evp_md_ctx_st **}«
__owur int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d,
^~~~~~~~~~~~~~~~
domainkeys.c:968:28: Warnung: Übergabe des Arguments 1 von »EVP_DigestUpdate« von inkompatiblem Zeigertyp [-Wincompatible-pointer-types]
EVP_DigestUpdate(&dk->mdctx, dk->hash_buff, dk->hash_buff_len);
^
In file included from domainkeys.c:27:0:
/usr/local/include/openssl/evp.h:546:12: Anmerkung: »EVP_MD_CTX * {aka struct evp_md_ctx_st *}« erwartet, aber Argument hat Typ »EVP_MD_CTX ** {aka struct evp_md_ctx_st **}«
__owur int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d,
^~~~~~~~~~~~~~~~
domainkeys.c:990:24: Warnung: Übergabe des Arguments 1 von »EVP_DigestUpdate« von inkompatiblem Zeigertyp [-Wincompatible-pointer-types]
EVP_DigestUpdate(&dk->mdctx, dk->hash_buff, dk->hash_buff_len);
^
In file included from domainkeys.c:27:0:
/usr/local/include/openssl/evp.h:546:12: Anmerkung: »EVP_MD_CTX * {aka struct evp_md_ctx_st *}« erwartet, aber Argument hat Typ »EVP_MD_CTX ** {aka struct evp_md_ctx_st **}«
__owur int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d,
^~~~~~~~~~~~~~~~
domainkeys.c: In Funktion »dkheaders«:
domainkeys.c:1289:5: Warnung: Typkonvertierung in Zeiger von Ganzzahl anderer Breite [-Wint-to-pointer-cast]
(void *)dk_headers(dk, dk->headers);
^
domainkeys.c: In Funktion »dk_end«:
domainkeys.c:1753:22: Warnung: Übergabe des Arguments 1 von »EVP_DigestUpdate« von inkompatiblem Zeigertyp [-Wincompatible-pointer-types]
EVP_DigestUpdate(&dk->mdctx, dk->hash_buff, dk->hash_buff_len);
^
In file included from domainkeys.c:27:0:
/usr/local/include/openssl/evp.h:546:12: Anmerkung: »EVP_MD_CTX * {aka struct evp_md_ctx_st *}« erwartet, aber Argument hat Typ »EVP_MD_CTX ** {aka struct evp_md_ctx_st **}«
__owur int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d,
^~~~~~~~~~~~~~~~
domainkeys.c:1956:27: Warnung: Übergabe des Arguments 1 von »EVP_VerifyFinal« von inkompatiblem Zeigertyp [-Wincompatible-pointer-types]
i = EVP_VerifyFinal(&dk->mdctx, md_value, md_len, publickey);
^
In file included from domainkeys.c:27:0:
/usr/local/include/openssl/evp.h:623:12: Anmerkung: »EVP_MD_CTX * {aka struct evp_md_ctx_st *}« erwartet, aber Argument hat Typ »EVP_MD_CTX ** {aka struct evp_md_ctx_st **}«
__owur int EVP_VerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sigbuf,
^~~~~~~~~~~~~~~
domainkeys.c: In Funktion »dk_getsig«:
domainkeys.c:2065:21: Warnung: Übergabe des Arguments 1 von »EVP_SignFinal« von inkompatiblem Zeigertyp [-Wincompatible-pointer-types]
EVP_SignFinal(&dk->mdctx, sig, &siglen, pkey);
^
In file included from domainkeys.c:27:0:
/usr/local/include/openssl/evp.h:616:12: Anmerkung: »EVP_MD_CTX * {aka struct evp_md_ctx_st *}« erwartet, aber Argument hat Typ »EVP_MD_CTX ** {aka struct evp_md_ctx_st **}«
__owur int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s,
^~~~~~~~~~~~~
domainkeys.c: In Funktion »dk_free«:
domainkeys.c:2162:19: Warnung: Übergabe des Arguments 1 von »EVP_MD_CTX_free« von inkompatiblem Zeigertyp [-Wincompatible-pointer-types]
EVP_MD_CTX_free(&dk->mdctx);
^
In file included from domainkeys.c:27:0:
/usr/local/include/openssl/evp.h:536:6: Anmerkung: »EVP_MD_CTX * {aka struct evp_md_ctx_st *}« erwartet, aber Argument hat Typ »EVP_MD_CTX ** {aka struct evp_md_ctx_st **}«
void EVP_MD_CTX_free(EVP_MD_CTX *ctx);
^~~~~~~~~~~~~~~
domainkeys.c:2170:6: Warnung: »ERR_remove_state« ist veraltet [-Wdeprecated-declarations]
ERR_remove_state(0);
^~~~~~~~~~~~~~~~
In file included from /usr/local/include/openssl/evp.h:13:0,
from domainkeys.c:27:
/usr/local/include/openssl/err.h:260:1: Anmerkung: hier deklariert
DEPRECATEDIN_1_0_0(void ERR_remove_state(unsigned long pid))
^
gcc-6.1 -DBIND_8_COMPAT -O2 -c dns_txt.c
gcc-6.1 -DBIND_8_COMPAT -O2 -c -o dktrace.o dktrace.c
rm -f libdomainkeys.a
ar cr libdomainkeys.a domainkeys.o dns_txt.o dktrace.o
ranlib libdomainkeys.a
(if make dnstest >/dev/null 2>&1; then echo -lresolv; else echo ""; fi) >dns.lib
rm -f dnstest
(if make socktest >/dev/null 2>&1; then echo -lsocket -lnsl; else echo ""; fi) >socket.lib
rm -f socktest
gcc-6.1 -DBIND_8_COMPAT -O2 -o dktest dktest.o -L. -ldomainkeys -lcrypto `cat dns.lib` `cat socket.lib`
./libdomainkeys.a(dns_txt.o): In function `dns_text':
dns_txt.c:(.text+0x25): undefined reference to `__res_query'
dns_txt.c:(.text+0xae): undefined reference to `__dn_expand'
dns_txt.c:(.text+0x151): undefined reference to `__dn_expand'
collect2: Fehler: ld gab 1 als Ende-Status zurück
Makefile:10: recipe for target 'dktest' failed
make: *** [dktest] Error 1
Cant compile libdomainkeys
Roberto Puzzanghera Madzel February 27, 2019 08:46 CET
Are you using openssl or libressl?
Cant compile libdomainkeys
Roberto Puzzanghera Madzel February 20, 2019 19:45 CET
I suspect that your compiler is not recognizing your openssl version.
Try to apply this patch, which is specific for openssl-1.1 without any version recognizer https://notes.sagredo.eu/en/qmail-notes-185/patching-qmail-82.html#comment1207
So sad and disapointing :-(
Stumpi February 11, 2019 18:56 CET
It will not compile with OpenSSL 1.0.2 and above, so Qmail will ever get TLS1.3 support. After more than 12 years of using Qmail it is now time to change to Exim or PostFix, i guess. Sad and disapointing...
So sad and disapointing :-(
Roberto Puzzanghera Stumpi February 19, 2019 20:02 CET
try to compile using the test patches linked on the top of this page, which should solve all the compilation breaks against openssl-1.1
So sad and disapointing :-(
Roberto Puzzanghera Stumpi February 11, 2019 23:02 CET
It compiles with v. 1.0.2 here. I would not say that it will **ever** get tls 1.3 support. I'm confident that someone will solve this at some point.
Other qmail distributions as s/qmail and indimail are already openssl-1.1 compliant, because they are mainteined by senior C programmers, so I would suggest to give them a chance before deciding to leave qmail
Patch netqmail1.06
Charles January 24, 2019 09:39 CET
Hello,
I have installed netqmail-1.06 and I found the patch qmail on your website, and interest to try but have error like this:
./load qmail-qmtpd rcpthosts.o control.o constmap.o \
received.o date822fmt.o now.o qmail.o cdb.a fd.a wait.a \
datetime.a open.a getln.a sig.a case.a env.a stralloc.a \
alloc.a substdio.a error.a str.a fs.a auto_qmail.o
./compile qmail-smtpd.c
qmail-smtpd.c: In function ‘setup’:
qmail-smtpd.c:239: error: ‘maxrcpt’ undeclared (first use in this function)
qmail-smtpd.c:239: error: (Each undeclared identifier is reported only once
qmail-smtpd.c:239: error: for each function it appears in.)
qmail-smtpd.c:303: error: ‘rejectrelaytest’ undeclared (first use in this functi on)
qmail-smtpd.c:307: error: ‘rejnsmf’ undeclared (first use in this function)
qmail-smtpd.c:316: error: ‘greetdelay’ undeclared (first use in this function)
qmail-smtpd.c:318: error: ‘drop_pre_greet’ undeclared (first use in this functio n)
qmail-smtpd.c:320: error: ‘protocol’ undeclared (first use in this function)
qmail-smtpd.c:322: error: ‘spfbehavior’ undeclared (first use in this function)
qmail-smtpd.c:327: error: ‘spflocal’ undeclared (first use in this function)
qmail-smtpd.c:329: error: ‘spfguess’ undeclared (first use in this function)
qmail-smtpd.c:331: error: ‘spfexp’ undeclared (first use in this function)
qmail-smtpd.c:331: error: ‘SPF_DEFEXP’ undeclared (first use in this function)
qmail-smtpd.c:336: error: ‘remoteip4’ undeclared (first use in this function)
qmail-smtpd.c:404: error: ‘forcetls’ undeclared (first use in this function)
qmail-smtpd.c:405: error: ‘smtps’ undeclared (first use in this function)
qmail-smtpd.c: In function ‘smtp_helo’:
qmail-smtpd.c:504: error: ‘seenmail’ undeclared (first use in this function)
qmail-smtpd.c: In function ‘smtp_ehlo’:
qmail-smtpd.c:517: error: ‘seenmail’ undeclared (first use in this function)
qmail-smtpd.c: In function ‘smtp_rset’:
qmail-smtpd.c:521: error: ‘seenmail’ undeclared (first use in this function)
qmail-smtpd.c: In function ‘smtp_mail’:
qmail-smtpd.c:527: error: ‘flagbarf’ undeclared (first use in this function)
qmail-smtpd.c:528: error: ‘seenmail’ undeclared (first use in this function)
qmail-smtpd.c: In function ‘smtp_rcpt’:
qmail-smtpd.c:535: error: ‘seenmail’ undeclared (first use in this function)
qmail-smtpd.c:537: error: ‘flagbarf’ undeclared (first use in this function)
qmail-smtpd.c: In function ‘spfreceived’:
qmail-smtpd.c:645: error: ‘spfbehavior’ undeclared (first use in this function)
qmail-smtpd.c: In function ‘acceptmessage’:
qmail-smtpd.c:706: error: ‘strnum’ undeclared (first use in this function)
qmail-smtpd.c:715: error: ‘sslog’ undeclared (first use in this function)
qmail-smtpd.c: In function ‘smtp_data’:
qmail-smtpd.c:729: error: ‘seenmail’ undeclared (first use in this function)
qmail-smtpd.c:731: error: ‘envelopepos’ undeclared (first use in this function)
qmail-smtpd.c:739: error: ‘protocol’ undeclared (first use in this function)
qmail-smtpd.c: At top level:
qmail-smtpd.c:758: error: redefinition of ‘authin’
qmail-smtpd.c:111: note: previous definition of ‘authin’ was here
qmail-smtpd.c:759: error: redefinition of ‘user’
qmail-smtpd.c:112: note: previous definition of ‘user’ was here
qmail-smtpd.c:760: error: redefinition of ‘pass’
qmail-smtpd.c:113: note: previous definition of ‘pass’ was here
qmail-smtpd.c:761: error: redefinition of ‘resp’
qmail-smtpd.c:114: note: previous definition of ‘resp’ was here
qmail-smtpd.c:762: error: redefinition of ‘slop’
qmail-smtpd.c:116: note: previous definition of ‘slop’ was here
qmail-smtpd.c: In function ‘smtp_auth’:
qmail-smtpd.c:943: error: ‘seenmail’ undeclared (first use in this function)
make: *** [qmail-smtpd.o] Error 1
any idea?
thanks for the help
Patch netqmail1.06
Roberto Puzzanghera Charles January 25, 2019 15:03 CET
It seems like the patching process went wrong...
TLS 1.3
Wouter de Geus December 19, 2018 09:23 CET
Hi Robert!
Thanks a lot for your continued effort to patch up QMail!
In the past I've been very happy with John Simpson's combined patch (https://qmail.jms1.net/patches/combined-details.shtml), but that hasn't been updated for years now.
Right now I'm trying to upgrade my legacy qmail server to a new incarnation based on Docker, going with your patch this time :)
That said, I tried to compile against the latest OpenSSL and quickly ran into trouble, so I was wondering if you (or anyone else that you know of) have plans to support the new OpenSSL and with that the TLS 1.3 protocol.
I figure it's a matter of time before this becomes a necessity, alreaady I see older TLS versions being dropped on various mailservers.
Anyway, keep up the good work!
TLS 1.3
Roberto Puzzanghera Wouter de Geus December 19, 2018 10:39 CET
Honestly, accomplishing this task would be far over my skills but I'm confident that an upgrade to the qmail-tls patch by f.vermulen will come at a certain point
error after update with the new patch
Bernardo Correia September 20, 2018 17:27 CET
Hi Roberto!
I have a centos 7 working with your qmail how to. But when i try to update to the latest patch i start getting this errors on smtp log
qlogreceived: result=rejected code=451 reason=queuedelay detail=qq_temporary_problem_(#4.3.0)
Do you have any idea what can be?
Thanks,
Bernardo Correia
error after update with the new patch
miz Bernardo Correia July 24, 2019 11:47 CET
Hi everybody,
same old story here :-)
- brand new centos 7 64bit server
- installation and compilation went perfectly fine
- everything seems to be working, exept for:
Jul 24 12:31:27 2019 qmail-smtpd: message delayed (unable to exec qq (#4.3.0)):xxx@domain.it from x.x.x.x to Jul 24 12:31:59
I'm still unable to solve the problem, already tried to increased soft limit with no luck, double checked all perms on queues and qmail directory, checked all the run files, nothing.
- there is no antivirus (no clamd, simscan, anything) installed, no qmail-scanner and no spamassassin.
- local delivery is working fine:
/var/qmail/bin/qmail-inject xxx@domain.it < /tmp/test.txt
Any hint about ways to debug this ?
Thank you !
error after update with the new patch
Roberto Puzzanghera miz July 24, 2019 12:36 CET
are you using my combined patch? if yes, can you post your run file and your tcp.smtp?
error after update with the new patch
Roberto Puzzanghera Bernardo Correia September 20, 2018 18:05 CET
check also your clamav and spamassassin logs, because something is breaking your delivery
error after update with the new patch
Roberto Puzzanghera Bernardo Correia September 20, 2018 18:01 CET
Did you try to increase your softlimit already?
Bug in logit and logit2 functions
Mirko Buffoni August 20, 2018 16:44 CET
I found a bug in logit and logit2 functions which comes from https://notes.sagredo.eu/files/qmail/patches/logging-4.patch
It was hard to track. But I was lucky to isolate the problem with a mail client who was issuing a RSET command and closed the connection brutally after this.
To replicate the problem I did:
$ telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 Welcome to BLABLABLA
mail from: <sender@domain.tld>
250 ok
rcpt to: <recipient@domain.tld>
250 ok
data
354 go ahead
Date: Mon, 20 Aug 2018 15:24:01 +0200
From: sender@domain.tld
To: recipient@domain.tld
Subject: test
test
.
250 ok 1534778879 qp 11906
rset
250 flushed
^]
telnet> quit
Connection closed.
At this point a segfault at 9220000 ip 0805d309 sp bfc5e4ac error 6 in qmail-smtpd[8048000+34000] is generated
After a RSET command, the mailfrom.len is set to 0, but mailfrom.s is still allocated.
In logit/logit2 functions, a check is done on mailfrom.s and then a
stralloc_catb(&log_buf, mailfrom.s, mailfrom.len-1)) die_nomem();
is done, but mailform.len is zero and this will cause a memory allocation fault when using softlimit.
The following is a patch to cure this issue.
--- qmail-smtpd.c.orig 2018-08-20 16:34:55.000000000 +0200
+++ qmail-smtpd.c 2018-08-20 17:23:49.000000000 +0200
@@ -1096,19 +1096,19 @@
if (!stralloc_copys(&log_buf, "qmail-smtpd: ")) die_nomem();
if (!stralloc_cats(&log_buf, message)) die_nomem();
if (!stralloc_catb(&log_buf, ": ", 2)) die_nomem();
- if (mailfrom.s) {
+ if (mailfrom.s && mailfrom.len) {
if (!stralloc_catb(&log_buf, mailfrom.s, mailfrom.len-1)) die_nomem();
} else
if (!stralloc_catb(&log_buf, "(null)", 6)) die_nomem();
if (!stralloc_catb(&log_buf, " from ", 6)) die_nomem();
if (!stralloc_cats(&log_buf, remoteip)) die_nomem();
if (!stralloc_catb(&log_buf, " to ", 4)) die_nomem();
- if (addr.s) {
+ if (addr.s && addr.len) {
if (!stralloc_catb(&log_buf, addr.s, addr.len-1)) die_nomem();
} else
if (!stralloc_catb(&log_buf, "(null)", 6)) die_nomem();
if (!stralloc_catb(&log_buf, " helo ", 6)) die_nomem();
- if (helohost.s) {
+ if (helohost.s && helohost.len) {
if (!stralloc_catb(&log_buf, helohost.s, helohost.len-1)) die_nomem();
} else
if (!stralloc_catb(&log_buf, "(null)", 6)) die_nomem();
@@ -1125,19 +1125,19 @@
if (!stralloc_cats(&log_buf, " (")) die_nomem();
if (!stralloc_cats(&log_buf, reason)) die_nomem();
if (!stralloc_cats(&log_buf, "): ")) die_nomem();
- if (mailfrom.s) {
+ if (mailfrom.s && mailfrom.len) {
if (!stralloc_catb(&log_buf, mailfrom.s, mailfrom.len-1)) die_nomem();
} else
if (!stralloc_catb(&log_buf, "(null)", 6)) die_nomem();
if (!stralloc_cats(&log_buf," from ")) die_nomem();
if (!stralloc_cats(&log_buf, remoteip)) die_nomem();
if (!stralloc_cats(&log_buf, " to ")) die_nomem();
- if (addr.s) {
+ if (addr.s && addr.len) {
if (!stralloc_catb(&log_buf, addr.s, addr.len-1)) die_nomem();
} else
if (!stralloc_catb(&log_buf, "(null)", 6)) die_nomem();
if (!stralloc_cats(&log_buf, " helo ")) die_nomem();
- if (helohost.s) {
+ if (helohost.s && helohost.len) {
if (!stralloc_catb(&log_buf, helohost.s, helohost.len-1)) die_nomem();
} else
if (!stralloc_catb(&log_buf, "(null)", 6)) die_nomem();
Bug in logit and logit2 functions
Roberto Puzzanghera Mirko Buffoni August 23, 2018 11:21 CET
Thanks to Mirko this bug was fixed in the v.5 of the logging patch, which I have just included in my package
Mess822 bug
Mirko Buffoni August 17, 2018 15:36 CET
I found a bug in mess822-0.58 package.
You do not have a section for it, so I'm posting a patch under qmail.
You can use a tool like 822field to extract a field from headers in a mail.
However, it compares the header with string without considering that the string may be longer, after the match. So a
cat email | 822field Subjectttttt
will give back the Subject field in any case, which is wrong.
The proposed patch will fix this, allowing, as an extreme case, to specify a colon as last character in searched header string. So a | 822field Subject: will work too giving back the searched Subject, while | 822field Subjectt won't.
--- mess822_line.c.old 2018-08-17 16:03:24.000000000 +0200
+++ mess822_line.c 2018-08-17 16:02:26.000000000 +0200
@@ -41,7 +41,7 @@
}
for (a = h->action;a->name;++a)
- if (!case_diffb(h->inprogress.s,pos,a->name))
+ if (!case_diffb(h->inprogress.s,pos,a->name) && (a->name[pos] == 0 || a->name[pos] == ':'))
break;
for (;pos < h->inprogress.len;++pos) {
Mess822 bug
Roberto Puzzanghera Mirko Buffoni August 17, 2018 15:58 CET
Thank you, I'll check it out when I'll be back home
combined patches
Vahid Baboli July 5, 2018 23:08 CET
Hi,
Great job collecting and putting together this site.
We have 50+ qmail servers mainly to send out e-mail and not receiving any.
I am wondering, what patches do i really need to have a stable sending qmail servers.
I currently have DNS and TLS patch only.
Thanks very much if you reply.
Vahid.
combined patches
Roberto Puzzanghera Vahid Baboli July 6, 2018 10:28 CET
Provided that you can choose to install the complete combined patch and then use just what you need of it, this could be a subset of patches that you need to build a send server. The most important (in my opinion) are in bold text
qmail-authentication
qmail-tls
force-tls
oversize DNS
reread concurrency
big concurrency
big concurrency fix
Better qmail-smtpd logging
SMTP HELO/EHLO Greeting delay
DKIM and SURBL
EXT-TODO
BIG-TODO
qmail-inject-null-sender
qmail-taps-extended
qmail-remote CRLF
outgoingip
qmail-smtpd pid, qp log patch
any-to-cname
qmail-rfc2821
smtpd-502-to-500
qmail-moreipme
qmail-hide-ip-headers
qmail-date-localtime
qmail-smtpd liberal-lf
qmail-empf
reject-relay-test
qlog
dnscname
rcptcheck
combined patches
Vahid Baboli Roberto Puzzanghera January 2, 2019 22:24 CET
why am I keep getting this error while compiling qmail with a few patches (please see my other question):
more undefined references to `logit' follow collect2: error: ld returned 1 exit status
combined patches
Roberto Puzzanghera Vahid Baboli January 3, 2019 14:12 CET
as you know, logit is a function which belongs to the logging patch... did you get any error while patching?
combined patches
Vahid Baboli Roberto Puzzanghera January 3, 2019 19:02 CET
started fresh and noticed that if I apply patches in this order:
logging-5.patch compiles OK
qmail-remote-CRLF.diff - OK
qmail-inject-null-sender.patch - OK
roberto-netqmail-1.06_auth_tls_force-tls.patch-latest - fails with this error:
qmail-smtpd.o: In function `err_nogateway':
qmail-smtpd.c:(.text+0x1b8): undefined reference to `tls_nogateway'
qmail-smtpd.o: In function `setup':
qmail-smtpd.c:(.text+0x1030): undefined reference to `tls_init'
If I only apply roberto-netqmail-1.06.patch-latest patch, then I get
chkuser.c:38:22: fatal error: vpopmail.h: No such file or directory
These servers are only sending mail out so I only need any-to-cname and TLS patch.
which one do you recommend?
thanks again.
combined patches
Roberto Puzzanghera Vahid Baboli January 3, 2019 19:25 CET
First of all, I would recommend to apply the auth/tls/forcetls patch, which is the biggest one and the most difficult to fix if the patching went wrong, and then the others.
If your server is just sending, the logging patch is of little use, because it logs qmail-smtpd.
"any to cname" is not so important for me, while qmail-remote-CRLF and qmail-inject-null-sender are both a good choice because they fix bugs.
You can always decide to use my big patch (roberto-netqmail-1.06.patch-latest) but you have to install vpopmail, libdomainkeys and libsrs2 libraries, but it's very easy to do, otherwise you'll get compilation breaks like the one you showed above (it's complaining about the lack of vpopmail)
And I would like to return the wishes for a happy 2019 :-)
combined patches
Vahid Baboli Roberto Puzzanghera January 3, 2019 19:43 CET
Sorry, didnt see this post.
so, trying fresh tarball, applying the following patches in this order:
roberto-netqmail-1.06_auth_tls_force-tls.patch-latest - OK
any-to-cname.patch - OK (I need this patch since we get so much large DNS realted issues)
qmail-remote-CRLF.diff - OK
qmail-inject-null-sender.patch - OK
so i should be good for prod i guess?
We are getting lots of complains and rejections due to use of TLS 1.0 and no also no TLS so I have to upgrade.
in the current built, I used netqmail-1.05-tls-20060104.patch.
combined patches
Roberto Puzzanghera Vahid Baboli January 3, 2019 19:46 CET
I would suggest to do all tests before switching to production...
combined patches
Vahid Baboli Roberto Puzzanghera January 3, 2019 20:28 CET
ah yeah, lots of tests...
daemontools needs to be recompiled and giving me hard time but i will figure out. thanks for your help.
combined patches
Vahid Baboli Roberto Puzzanghera January 2, 2019 20:21 CET
Happy New Year Roberto,
I have many qmail server to install/upgrade to include the new TLS 1.2 patch (other domains started denying TLS 1.0).
I am wondering is there is a way to make qmail-remote (we are only sending) binary static so I just package the binaries and deploy to servers rather that compile on each server. I am not sure all servers have the latest libraries.
i am installing the following patches to netqmail-1.06:
roberto-netqmail-1.06_auth_tls_force-tls.patch-latest
logging-5.patch
qmail-inject-null-sender.patch
any-to-cname.patch
qmail-remote-CRLF.diff
Thanks,
combined patches
Roberto Puzzanghera Vahid Baboli January 3, 2019 19:29 CET
I would also consider building a qmail package for your linux distribution, just to save the compilation time, but you must be sure that all the libraries are the same in all your servers, of course
combined patches
Roberto Puzzanghera Vahid Baboli January 3, 2019 14:06 CET
Perhaps this could be possible, but I think it would be more time expensive **and not secure** than compiling the entire qmail in each server, especially if they don't share the same libraries...
FreeBSD
Kris von Mach November 14, 2017 10:38 CET
When compiling this patch on FreeBSD I get the following error:
qmail-smtpd.c:2398:41: error: function definition is not allowed here
void outqlog(char *s, unsigned int n) {
^
qmail-smtpd.c:2405:17: error: a parameter list without types is only allowed in a function definition
void outsqlog(s) char *s; { outqlog(s,str_len(s)); }
^
qmail-smtpd.c:2405:19: error: expected ';' at end of declaration
void outsqlog(s) char *s; { outqlog(s,str_len(s)); }
^
Any idea on how to fix that?
Libdomainkeys compilation error
Tocy November 8, 2017 14:42 CET
Hello,
Libdomainkeys gives a compilation error on debian 9 as follows:
make
gcc -DBIND_8_COMPAT -O2 -o makeheader makeheader.c
./makeheader domainkeys.h
gcc -DBIND_8_COMPAT -O2 -c dktest.c -I.
gcc -DBIND_8_COMPAT -O2 -c domainkeys.c -I.
domainkeys.c:123:14: error: field ‘mdctx’ has incomplete type
EVP_MD_CTX mdctx; /* the hash */
^~~~~
domainkeys.c: In function ‘dkheaders’:
domainkeys.c:1285:5: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
(void *)dk_headers(dk, dk->headers);
^
domainkeys.c: In function ‘dk_free’:
domainkeys.c:2155:3: warning: implicit declaration of function ‘EVP_MD_CTX_cleanup’ [-Wimplicit-function-declaration]
EVP_MD_CTX_cleanup(&dk->mdctx);
^~~~~~~~~~~~~~~~~~
domainkeys.c:2162:6: warning: ‘ERR_remove_state’ is deprecated [-Wdeprecated-declarations]
ERR_remove_state(0);
^~~~~~~~~~~~~~~~
In file included from /usr/include/openssl/x509_vfy.h:20:0,
from /usr/include/openssl/x509.h:309,
from /usr/include/openssl/pem.h:17,
from domainkeys.c:28:
/usr/include/openssl/err.h:248:1: note: declared here
DEPRECATEDIN_1_0_0(void ERR_remove_state(unsigned long pid))
^
Makefile:23: recipe for target 'domainkeys.o' failed
make: *** [domainkeys.o] Error 1
Libdomainkeys compilation error
Roberto Puzzanghera Tocy November 8, 2017 14:52 CET
which version of gcc?
Libdomainkeys compilation error
Tocy Roberto Puzzanghera November 9, 2017 05:04 CET
Here are the gcc versions installed:
ii gcc 4:6.3.0-4 amd64 GNU C compiler
ii gcc-6 6.3.0-18 amd64 GNU C compiler
ii gcc-6-base:amd64 6.3.0-18 amd64 GCC, the GNU Compiler Collection (base package)
ii libgcc-6-dev:amd64 6.3.0-18 amd64 GCC support library (development files)
ii libgcc1:amd64 1:6.3.0-18 amd64 GCC support library
Libdomainkeys compilation error
Roberto Puzzanghera Tocy November 9, 2017 10:44 CET
I haven't tested with gcc-6.
tests would be much appreciated
Libdomainkeys compilation error
Tocy Roberto Puzzanghera November 9, 2017 13:22 CET
I will gladly test but I don't know how to fix the code for this library and the qmail-remote.c and all other files that may need fixing. Sorry but I am more of a system guy than a developer:)
Cheers,
Libdomainkeys compilation error
Tocy Tocy November 10, 2017 02:42 CET
The issue is linked to libssl-dev 1.1 with 1.0 all works.
Cheers,
Libdomainkeys compilation error
sa1phx Tocy November 6, 2018 10:21 CET
Hello, i also have this issue,
Fix it by changing this lines:
domainkeys.c:123 ->
From: EVP_MD_CTX mdctx; /* the hash */
To: EVP_MD_CTX *mdctx; /* the hash */
domainkeys.c:2156 ->
From: EVP_MD_CTX_cleanup(&dk->mdctx);
To: EVP_MD_CTX_free(&dk->mdctx);
After editing source file, compilation is successfull
Libdomainkeys compilation error
Roberto Puzzanghera sa1phx November 6, 2018 13:16 CET
and are you using libssl-dev 1.1?
Libdomainkeys compilation error
Jim McNamara Roberto Puzzanghera January 25, 2019 14:36 CET
I can confirm the changes sa1phx posted for the "domainkeys.c:123:14: error: field ‘mdctx’ has incomplete type" problem on Debian 9 with openssl-1.1. Here are my details -
ii gcc 4:6.3.0-4 amd64 GNU C compiler
ii gcc-6 6.3.0-18+deb9u1 amd64 GNU C compiler
ii gcc-6-base:amd64 6.3.0-18+deb9u1 amd64 GCC, the GNU Compiler Collection (base package)
ii libgcc-6-dev:amd64 6.3.0-18+deb9u1 amd64 GCC support library (development files)
ii libgcc1:amd64 1:6.3.0-18+deb9u1 amd64 GCC support library
ii libssl-dev:amd64 1.1.0j-1~deb9u1 amd64 Secure Sockets Layer toolkit - development files
ii libssl-doc 1.1.0j-1~deb9u1 all Secure Sockets Layer toolkit - development documentation
ii libssl1.0.2:amd64 1.0.2q-1~deb9u1 amd64 Secure Sockets Layer toolkit - shared libraries
ii libssl1.1:amd64 1.1.0j-1~deb9u1 amd64 Secure Sockets Layer toolkit - shared libraries
Here is the resulting diff between the source with the libdomainkeys-0.69.diff applied and then the changes suggested by sa1phx. I confirm that after applying their changes, make succeeds and libdomainkeys.a is produced. I cannot yet confirm that the libdomainkeys.a file functions.
diff -u for-diff/domainkeys.c libdomainkeys/domainkeys.c
--- for-diff/domainkeys.c 2008-03-31 18:50:39.000000000 -0400
+++ libdomainkeys/domainkeys.c 2019-01-25 09:12:11.184191244 -0500
@@ -120,7 +120,7 @@
{
/* STARTPRIV */
int dkmarker; /* in case somebody casts in */
- EVP_MD_CTX mdctx; /* the hash */
+ EVP_MD_CTX *mdctx; /* the hash */
int signing; /* our current signing/verifying state */
int in_headers; /* true if we're still processing headers */
char *header; /* points to a malloc'ed block for header. */
@@ -2152,7 +2152,7 @@
#ifdef DK_HASH_BUFF
DK_MFREE(dk->hash_buff);
#endif
- EVP_MD_CTX_cleanup(&dk->mdctx);
+ EVP_MD_CTX_free(&dk->mdctx);
DK_MFREE(dk->header); /* alloc'ing dk->header is not optional. */
dk->dkmarker = ~DKMARK;
DK_MFREE(dk);
Libdomainkeys compilation error
Roberto Puzzanghera Jim McNamara January 25, 2019 15:40 CET
Thank you. And how are you patching qmail-remote.c?
I'm still unable to compile with openssl-1.1 and gcc-8.2, as I get this error
./compile qmail-remote.c
qmail-remote.c: In function ‘tls_init’:
qmail-remote.c:522:60: error: dereferencing pointer to incomplete type ‘X509_NAME_ENTRY’ {aka ‘struct X509_name_entry_st’}
const ASN1_STRING *s = X509_NAME_get_entry(subj, i)->value;
I'm using this patch to solve other compilation breaks
--- qmail-remote.c.orig 2017-05-14 13:50:09 UTC
+++ qmail-remote.c
@@ -266,7 +266,7 @@ char *append;
{
#ifdef TLS
/* shouldn't talk to the client unless in an appropriate state */
- int state = ssl ? ssl->state : SSL_ST_BEFORE;
- if (state & SSL_ST_OK || (!smtps && state & SSL_ST_BEFORE))
+ int state = SSL_get_state(ssl);
+ if (state & TLS_ST_OK || (!smtps && state & TLS_ST_BEFORE))
#endif
substdio_putsflush(&smtpto,"QUIT\r\n");
--- ssl_timeoutio.c.orig 2017-05-14 13:50:09 UTC
+++ ssl_timeoutio.c
@@ -74,10 +74,10 @@ int ssl_timeoutrehandshake(int t, int rf
SSL_renegotiate(ssl);
r = ssl_timeoutio(SSL_do_handshake, t, rfd, wfd, ssl, NULL, 0);
- if (r <= 0 || ssl->type == SSL_ST_CONNECT) return r;
+ if (r <= 0 || SSL_get_state(ssl) == SSL_ST_CONNECT) return r;
/* this is for the server only */
- ssl->state = SSL_ST_ACCEPT;
+ SSL_set_connect_state(ssl);
return ssl_timeoutio(SSL_do_handshake, t, rfd, wfd, ssl, NULL, 0);
}
Some help would be really appreciated in order to make my patch openssl-1.1 compliant.
Libdomainkeys compilation error
Jim McNamara Roberto Puzzanghera January 28, 2019 15:32 CET
Unfortunately, qmail-remote.c won 't compile for me in any way, even when I install and use the current openssl-1.0.2.q from source. I applied the patch you showed for qmail-remote.c and ssl_timeoutio.c, that moved things along but still make ultimately ends with error 1.
When I try to make with the openssl-1.1.0 package from Debian I use this conf-cc file, the .h files are in /usr/include/openssl:
cc -O2 -g -DEXTERNAL_TODO -DTLS=20160918 -I/usr/include/openssl -I/home/vpopmail/include
This will be used to compile .c files.
./compile qmail-remote.c
In file included from qmail-remote.c:7:0:
substdio.h:12:64: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
#define SUBSTDIO_FDBUF(op,fd,buf,len) { (buf), 0, (len), (fd), (op) }
^
qmail-remote.c:172:17: note: in expansion of macro ‘SUBSTDIO_FDBUF’
substdio ssin = SUBSTDIO_FDBUF(read,0,inbuf,sizeof inbuf);
^~~~~~~~~~~~~~
substdio.h:12:64: note: (near initialization for ‘ssin.op’)
#define SUBSTDIO_FDBUF(op,fd,buf,len) { (buf), 0, (len), (fd), (op) }
^
qmail-remote.c:172:17: note: in expansion of macro ‘SUBSTDIO_FDBUF’
substdio ssin = SUBSTDIO_FDBUF(read,0,inbuf,sizeof inbuf);
^~~~~~~~~~~~~~
qmail-remote.c: In function ‘tls_init’:
qmail-remote.c:535:60: error: dereferencing pointer to incomplete type ‘X509_NAME_ENTRY {aka struct X509_name_entry_st}’
const ASN1_STRING *s = X509_NAME_get_entry(subj, i)->value;
^~
qmail-remote.c: In function ‘mailfrom_cram’:
qmail-remote.c:670:3: warning: implicit declaration of function ‘hmac_md5’ [-Wimplicit-function-declaration]
hmac_md5(chal.s,chal.len,pass.s,pass.len,digest);
^~~~~~~~
Makefile:1675: recipe for target 'qmail-remote.o' failed
make: *** [qmail-remote.o] Error 1
I didn't want to use openssl 1.0.2, but I saw that officially version 1.0.2 would be supported through December of 2019. I created /usr/local/special and passed, "./config --prefix=/usr/local/special --openssldir=/usr/local/special/openssl" to config, that way it would not end up in any $PATH down the road. I edit netqmail's conf-cc to read:
cc -O2 -g -DEXTERNAL_TODO -DTLS=20160918 -I/usr/local/special/include/openssl -I/home/vpopmail/include
This will be used to compile .c files.
Then I make clean, and try to make again now using the older openssl-1.0.2 and it still errors out in the end again on qmail-remote.c:
./compile qmail-remote.c
In file included from qmail-remote.c:7:0:
substdio.h:12:64: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
#define SUBSTDIO_FDBUF(op,fd,buf,len) { (buf), 0, (len), (fd), (op) }
^
qmail-remote.c:172:17: note: in expansion of macro ‘SUBSTDIO_FDBUF’
substdio ssin = SUBSTDIO_FDBUF(read,0,inbuf,sizeof inbuf);
^~~~~~~~~~~~~~
substdio.h:12:64: note: (near initialization for ‘ssin.op’)
#define SUBSTDIO_FDBUF(op,fd,buf,len) { (buf), 0, (len), (fd), (op) }
^
qmail-remote.c:172:17: note: in expansion of macro ‘SUBSTDIO_FDBUF’
substdio ssin = SUBSTDIO_FDBUF(read,0,inbuf,sizeof inbuf);
^~~~~~~~~~~~~~
qmail-remote.c: In function ‘tls_init’:
qmail-remote.c:535:60: error: dereferencing pointer to incomplete type ‘X509_NAME_ENTRY {aka struct X509_name_entry_st}’
const ASN1_STRING *s = X509_NAME_get_entry(subj, i)->value;
^~
qmail-remote.c: In function ‘mailfrom_cram’:
qmail-remote.c:670:3: warning: implicit declaration of function ‘hmac_md5’ [-Wimplicit-function-declaration]
hmac_md5(chal.s,chal.len,pass.s,pass.len,digest);
^~~~~~~~
Makefile:1675: recipe for target 'qmail-remote.o' failed
make: *** [qmail-remote.o] Error 1
I have even less C than you do, but am more than willing to continue testing & troubleshooting. There's apparently some deep issue with const ASN1_STRING *s = X509_NAME_get_entry(subj, i)->value; as we're both getting the same error on make, yours presumably on Slackware and mine on Debian, mine with both openssl-1.0.2 and openssl-1.1.0.
Libdomainkeys compilation error
Eric Jim McNamara February 13, 2019 21:18 CET
const ASN1_STRING *s = X509_NAME_ENTRY_get_data(X509_NAME_get_entry(subj, i));
instead of
const ASN1_STRING *s = X509_NAME_get_entry(subj, i)->value;
Libdomainkeys compilation error
Roberto Puzzanghera Eric February 13, 2019 21:30 CET
Thank you, Eric. It compiles now. qmail-smtpd.c must be modified as well
Libdomainkeys compilation error
Roberto Puzzanghera Roberto Puzzanghera February 13, 2019 22:48 CET
New testing patch released. Look at the top of this page. There's a patch for libdomainkeys as well. They can be used both on v. 1.0 and 1.1 of openssl
Please give me some feedback, so that I can release it as stable soon..
Libdomainkeys compilation error
Anonymous Roberto Puzzanghera March 28, 2019 12:42 CET
Debian 9 openssl and libssl 1.1.0j
dktest not work
log send
delivery 154: deferral: /var/qmail/bin/dk-filter:_(spawn-filter)_exit_code:_139:_/var/qmail/bin/dk-filter:_line_271:_62249_Segmentation_fault______/var/qmail/bin/dktest_-s_/var/qmail/control/domainkeys/hidden_domain/default/._(#4.3.0)spawn-filter_said:_Message_deferred
syslog
... dktest[62249]: segfault at 1 ip 00007fd82e3b7b36 sp 00007ffce29d2bc0 error 4 in libcrypto.so.1.1
Libdomainkeys compilation error
Roberto Puzzanghera Anonymous March 31, 2019 20:47 CET
Please try the following libdomainkeys patched by Manvendra Banghui. If this will not solve feel free to write me in private so that I can provide a direct contact with him.
Libdomainkeys compilation error
Hamersky Roberto Puzzanghera April 1, 2019 08:53 CET
Thanks Roberto and Manvendra with libdomainkeys patched by Manvendra Banghui working :)
Libdomainkeys compilation error
Manvendra Bhangui Anonymous March 28, 2019 16:34 CET
Just got notified of dktest segmentation fault. I will take a look at it. It might take me some time to replicate the same openssl version on my laptop and test it out. If it helps, you can temporarily disable domainkeys and just have DKIM.
FORCEAUTHMAILFROM not check
MARCIO RUBENS November 6, 2017 20:17 CET
Hello.
I performed the patch installation but the mailfrom check function is not being performed.
I ran tests by thunderbird by changing from: and sending successfully.
In the smtp run I configured with export FORCEAUTHMAILFROM = 1
Any tip?
thanks
FORCEAUTHMAILFROM not check
Roberto Puzzanghera MARCIO RUBENS November 6, 2017 20:36 CET
Hi, I have no idea.. my tests are ok... please double check everything
FORCEAUTHMAILFROM not check
Marcio R Roberto Puzzanghera November 7, 2017 10:28 CET
I did the installation again and I did not succeed.
Does this patch block the email with the from field changed?
Log of test performed:
2017-11-07 07: 50: 25.679940500 policy_check: local marciorubens@dialhost.com.br -> remote marciorubenscardoso@gmail.com (AUTHENTICATED SENDER)
2017-11-07 07: 50: 25.830499500 simscan: [8424]: CLEAN (-1.00 / 15.00 / 15.00): 0.1197s: dddd: 177.69.128.1: marciorubens@dialhost.com.br: marciorubenscardoso@gmail.com
2017-11-07 07: 50: 25.976899500 mail recv: pid 8424 from <marciorubens@dialhost.com.br> qp 8429
2017-11-07 07: 50: 25.976901500 qmail-smtpd: message accepted: marciorubens@dialhost.com.br from 177.69.128.1 to marciorubenscardoso@gmail.com helo [10.1.1.53]
Log Gmail:
Delivered-To: marciorubenscardoso@gmail.com
Received: by 10.176.87.18 with SMTP id s18csp4018920uaa;
Tue, 7 Nov 2017 01:50:27 -0800 (PST)
X-Google-Smtp-Source: ABhQp + SMg7Vnmj4Ss9PNWvQpdkXHZ + Jd0MlFbzJrQVTHP + PtCDNom2DrakgBTAxwjkl7DwSkCaCR
X-Received: by 10.159.59.71 with SMTP id j7mr14577994uah.135.1510048227462;
Tue, 07 Nov 2017 01:50:27 -0800 (PST)
ARC-Seal: i = 1; a = rsa-sha256; t = 1510048227; cv = none;
d = google.com; s = arc-20160816;
b = rcWVEW8 / w0hpFVZlQogAAqwV66o5rIH0yOkHWjjqw6lh6YjAaMF5gNlH0x0o61Ow0Y
vddzV + 6l1NVvl6M4yd9eug1aPIhF7ndfX6ZitkE + Gl3xq2iPQ5AtcX + CHZFEpV2F + MVX
a ++ FFpoGP5qmjlmyL974c6aLNZTP + dzkKE93IUF5XQtab9C4iney2OHVV2kkjfVIHfA7
10
nz
giLw ==
ARC-Message-Signature: i = 1; a = rsa-sha256; c = relaxed / relaxed; d = google.com; s = arc-20160816;
h = content-language: content-transfer-encoding: mime-version: user-agent
: date: message-id: subject: from: to: / m: arc-authentication-results;
bh = SzVMU + mFZiUdyQvZrHmIh1w9KIokwNhHQSVvk1pnTOU =;
b = guPdLgygMuZNwQyJG3bapZzOPerg / R4pxt / aGWh9rG / JHidRBl / Rqrl6J8K8H1U47j
IGkOaPRDZkCVwX57fh5Cgfdb3Uwkht3X2WZt + 0Oot1vurYcj9iPnKX5NYuwr0DoKVJw7
WGFI9LuEoBhF3CI9ca3rHZgBwRU / Da9grff3NEWHRLYDFV0xvwxIw7qx9CupL3r2ScFV
uhjxPVoVM5uE9i0XLSG2AkWgCcsgssEl8CLw6 / twyoLjqzKG6M9D8G1C4WYNZolPrd5D
aHpOfTBxvX6M6RXQbabP4Ts1nXa6FBmhFysCJPPled15cMx9wsE689 + UaKShPSlYkfHr
e9iw ==
ARC-Authentication-Results: i = 1; mx.google.com;
spf = pass (google.com: domain of marciorubens@dialhost.com.br designates 138.118.172.67 as permitted sender) smtp.mailfrom=marciorubens@dialhost.com.br;
dmarc = pass (p = NONE sp = NONE dis = NONE) header.from = dialhost.com.br
Return-Path: <marciorubens@dialhost.com.br>
Received: from mailf67-br118.dialhost.com.br (mailf67-br118.dialhost.com.br. [138.118.172.67])
by mx.google.com with ESMTPS id s6si210550vka.356.2017.11.07.01.50.27
for <marciorubenscardoso@gmail.com>
(version = TLS1_2 cipher = AES128-SHA bits = 128/128);
Tue, 07 Nov 2017 01:50:27 -0800 (PST)
Received-SPF: pass (google.com: domain of marciorubens@dialhost.com.br designates 138.118.172.67 as permitted sender) client-ip = 138.118.172.67;
Authentication-Results: mx.google.com;
spf = pass (google.com: domain of marciorubens@dialhost.com.br designates 138.118.172.67 as permitted sender) smtp.mailfrom=marciorubens@dialhost.com.br;
dmarc = pass (p = NONE sp = NONE dis = NONE) header.from = dialhost.com.br
Received: (qmail 8433 invoked by uid 89); 7 Nov 2017 07:50:25 -0200
Received: (simscan 1.4.0 ppid 8424 pid 8429 t 0.1287s) (scanners:
attach: 1.4.0 clamav: 0.99.2
/ m: 58 / d: 23753); 07 Nov 0117 09:50:25 -0000
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on br118.dialhost.com
X-Spam-Level:
X-Spam-Status: No, score = -1.0 required = 15.0 tests = ALL_TRUSTED, HK_RANDOM_FROM autolearn = ham autolearn_force = no version = 3.4.1
Received: from unknown (HELO? 10.1.1.53?) (Marciorubens@dialhost.com.br)
by 0 with ESMTPA; 7 Nov 2017 07:50:25 -0200
To: marciorubenscardoso@gmail.com
From: marciorubenswwww@dialhost.com.br
Subject: dddd
Message-ID: <241fe7b7-db09-f65c-f77d-58405c9b6553@dialhost.com.br>
Date: Tue, 7 Nov 2017 07:50:25 -0200
User-Agent: Mozilla / 5.0 (Windows NT 10.0; WOW64; rv: 52.0) Gecko / 20100101 Thunderbird / 52.4.0
MIME-Version: 1.0
Content-Type: text / plain; charset = utf-8; format = flowed
Content-Transfer-Encoding: 7bit
Content-Language: en
FORCEAUTHMAILFROM not check
Roberto Puzzanghera Marcio R November 7, 2017 13:45 CET
yes, it should block emails with a from field different from the auth-user.
can you please post a telnet session and the run file of your qmail-submission service (I suppose you use this service to authenticate)?
FORCEAUTHMAILFROM not check
Marcio R Roberto Puzzanghera November 7, 2017 16:00 CET
telnet br118.dialhost.com.br 587
Trying 138.118.172.244...
Connected to br118.dialhost.com.br.
Escape character is '^]'.
220 mailf72-br118.dialhost.com.br ESMTP
EHLO dial.teste@dialhost.com.br
250-mailf72-br118.dialhost.com.br
250-STARTTLS
250-PIPELINING
250-8BITMIME
250-AUTH LOGIN PLAIN
250 SIZE 52428800
AUTH LOGIN
334 VXNlcm5hbWU6
ZGlhbC50ZXN0ZUBkaWFsaG9zdC5jb20uYnI=
334 UGFzc3dvcmQ6
NzBRVVFSSE1ldVZ5UU9taVFyOXM=
235 ok, go ahead (#2.0.0)
MAIL FROM:dial.teste2222@dialhost.com.br
250 ok
RCPT TO:marciorubenscardoso@gmail.com
250 ok
DATA
354 go ahead
tESTE
.
250 ok 1510067699 qp 22428
quit
221 mailf72-br118.dialhost.com.br
#!/bin/sh
QMAILDUID=`id -u vpopmail`
NOFILESGID=`id -g vpopmail`
MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`
SOFTLIMIT=`cat /var/qmail/control/softlimit`
# You MUST export this, otherwise you'd get a 30 sec timeout
# "!" if you want the submission feature (auth required)
export QMAILQUEUE=/var/qmail/bin/qmail-dkim
export DKIMQUEUE=/var/qmail/bin/simscan
export DKIMVERIFY="FGHKLMNOQRTVWjpu"
export DKIMKEY=/var/qmail/control/domainkeys/%/default
export SMTPAUTH="!"
export FORCETLS=0
export FORCEAUTHMAILFROM=1
export RELAYCLIENT_NODKIMVERIFY=1
# This enables greetdelay for qmail-smtpd.
# comment out if using fail2ban on port 587
#export SMTPD_GREETDELAY=5
#export DROP_PRE_GREET=1
# This enables chkuser
export CHKUSER_START=ALWAYS
# This enables simscan debug
#export SIMSCAN_DEBUG=2
exec /usr/local/bin/softlimit -m "$SOFTLIMIT" \
/usr/local/bin/tcpserver -v -H -R -l 0 \
-x /home/vpopmail/etc/tcp.submission.cdb -c "$MAXSMTPD" \
-u "$QMAILDUID" -g "$NOFILESGID" 0 587 \
/var/qmail/bin/qmail-smtpd \
/home/vpopmail/bin/vchkpw /bin/true 2>&1
FORCEAUTHMAILFROM not check
miz Marcio R November 7, 2017 17:22 CET
Hi,
I might me completely wrong, but did you try adding this:
AUTH=1
REQUIRE_AUTH=1
ALLOW_INSECURE_AUTH=0
FORCE_TLS=1
(i have these settings in my submission service file on smtp 587)
FORCEAUTHMAILFROM not check
Roberto Puzzanghera miz November 7, 2017 17:26 CET
but these variables have nothing to do with my patch...
FORCEAUTHMAILFROM not check
miz Roberto Puzzanghera November 8, 2017 09:51 CET
Yes Roberto, of course you are right, but I found a strange behaviour when I installed the run service and I had to set those variable in order to have the submission service (TLS on 587 with AUTH and CHKUSER) work correctly.
I was just wondering if using AUTH only on TLS (disabling the PLAIN AUTH) would show the same behaviour / error.
FORCEAUTHMAILFROM not check
Roberto Puzzanghera miz November 8, 2017 12:47 CET
if you "grep -r" those variables in the netqmail source code patched with my combined patch you will not find any match, so this can't be an explaination...
FORCEAUTHMAILFROM not check
Roberto Puzzanghera Marcio R November 7, 2017 16:42 CET
Your config seems to be correct and I have almost the same run file in my 2 servers... I've no idea at the moment, if you find a solution let me know please
compile error qmail-remote.c
Ed Vrijmoet October 24, 2017 23:33 CET
I am trying to setup qmail on a fresh install of Debian 9 (stretch) with openssl-1.1.0f
I followed your installation and ran in to trouble at compiling netqmail-1.06 including the roberto patches
see my error list:
./compile qmail-remote.c
In file included from qmail-remote.c:7:0:
substdio.h:12:64: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
#define SUBSTDIO_FDBUF(op,fd,buf,len) { (buf), 0, (len), (fd), (op) }
^
qmail-remote.c:173:17: note: in expansion of macro ‘SUBSTDIO_FDBUF’
substdio ssin = SUBSTDIO_FDBUF(read,0,inbuf,sizeof inbuf);
^~~~~~~~~~~~~~
substdio.h:12:64: note: (near initialization for ‘ssin.op’)
#define SUBSTDIO_FDBUF(op,fd,buf,len) { (buf), 0, (len), (fd), (op) }
^
qmail-remote.c:173:17: note: in expansion of macro ‘SUBSTDIO_FDBUF’
substdio ssin = SUBSTDIO_FDBUF(read,0,inbuf,sizeof inbuf);
^~~~~~~~~~~~~~
qmail-remote.c: In function ‘quit’:
qmail-remote.c:290:24: error: dereferencing pointer to incomplete type ‘SSL {aka struct ssl_st}’
int state = ssl ? ssl->state : SSL_ST_BEFORE;
^~
qmail-remote.c:290:34: error: ‘SSL_ST_BEFORE’ undeclared (first use in this function)
int state = ssl ? ssl->state : SSL_ST_BEFORE;
^~~~~~~~~~~~~
qmail-remote.c:290:34: note: each undeclared identifier is reported only once for each function it appears in
qmail-remote.c:291:15: error: ‘SSL_ST_OK’ undeclared (first use in this function)
if (state & SSL_ST_OK || (!smtps && state & SSL_ST_BEFORE))
^~~~~~~~~
qmail-remote.c: In function ‘tls_init’:
qmail-remote.c:536:60: error: dereferencing pointer to incomplete type ‘X509_NAME_ENTRY {aka struct X509_name_entry_st}’
const ASN1_STRING *s = X509_NAME_get_entry(subj, i)->value;
^~
qmail-remote.c: In function ‘mailfrom_cram’:
qmail-remote.c:671:3: warning: implicit declaration of function ‘hmac_md5’ [-Wimplicit-function-declaration]
hmac_md5(chal.s,chal.len,pass.s,pass.len,digest);
^~~~~~~~
Makefile:1675: recept voor doel 'qmail-remote.o' is mislukt
make: *** [qmail-remote.o] Fout 1
Can you help me with this
greetings Ed
look here
Roberto Puzzanghera Ed Vrijmoet October 25, 2017 09:22 CET
try to look here https://github.com/DinoTools/dionaea/issues/90
compile error qmail-remote.c
Ed Vrijmoet Roberto Puzzanghera October 25, 2017 10:41 CET
I am sorry but because I am not a programmer I don't understand what is written so I think that something has changed in openssl-1.1.0
witch means that something has to change in the file qmail-remote.c the problem is that I don't know what
please help me understand what I have to change
Re:
Roberto Puzzanghera Ed Vrijmoet October 25, 2017 13:21 CET
Provided that I can't do the tests myself because I don't use Debian and I just have openssl-1.0.2k installed, if what reported in that is correct you miss some dependencies.
So try to install them looking below "STEPS TO REPRODUCE" and compile again
compile error netqmail
Ed Vrijmoet Roberto Puzzanghera October 26, 2017 23:11 CET
Finally i found out how to compile
I had to use libssl1.0.2 as in this link https://github.com/duosecurity/duo_unix/issues/90
thanks very much for your help
compile error netqmail
Ed Vrijmoet Roberto Puzzanghera October 25, 2017 23:28 CET
I have been trying to find out what the problem is with compiling netqmail and what i found is this, all packages related to openssl cannot be compiled with openssl-1.1.0 the syntax off most of the ssl calls is wrong because openssl has changed sinds version 0.9.
if you want to compile with openssl-1.1.0 then you have to rewrite all the .c and .h files with openssl calls in them.
qmail-remote.c ssl-timeoutio.c qmail-smtpd.c dkimsign.h dkimverify.h dkimfunc.cpp to name a few.
on debian 9 there is no old version of openssl and it is discouraged to use old versions.
so the only way to use qmail is to compile it on an old depracated linux system because all new versions will be with openssl-1.1 and higher.
thank you very much for your anwser.
Subdomains emails errors
Marcio August 9, 2017 18:53 CET
When sent an email to yyy@xx.domain.com the sending is performed as yyy@domain.com, returning error.
Any tips for correction?
Never seen this error
roberto puzzanghera Marcio August 9, 2017 20:14 CET
I've never seen this error. Are you using my combined patch?
test erro
Marcio roberto puzzanghera August 10, 2017 13:00 CET
Yes. I'm using it.
How do you make a submission test and see if it is occurring in your installation account?
Please send a test to gustavo.ribes@br.cobogroup.net
It appears that your server
roberto puzzanghera Marcio August 10, 2017 13:16 CET
It appears that your server is an exim MTA. I can't be of any help, sorry
not Exim
Marcio roberto puzzanghera August 10, 2017 13:26 CET
My server is a qmail and installed with your indicated patches
When I send emails to the email gustavo.ribes@br.cobogroup.net it removes br and returns errors informing that user gustavo.ribes@cobogroup.net does not exist.
Can you send a test email?
Sending a test mail
roberto puzzanghera Marcio August 10, 2017 14:55 CET
Sending a test mail returns an error message from mx1.cobospa.it which says that xxx@cobogroup.net does not exist.
What about that mx1.cobospa.it server? It appears to be a Sophos platform... maybe you have to check that all the MTAs that are routing your mails are configured to forward br.cobogroup.net to you
Patched and working
John Trolinger July 19, 2017 22:44 CET
We have the Latest stable combined patch for netqmail-1.06 v. 2017.05.14 and everything is looking good.
To compile I did have to manually kill some VPOPMAIL processes that were tying up qmail-smtp. The error was
install: fatal: unable to write .../bin/qmail-smtpd: text busy
Thank you Roberto!
Bug in TLS patch
Eugene September 17, 2016 08:30 CET
qmail-tls patch is buggy. qmail-remote server cert checking logic if configured through tlshosts/ is broken - it'll consider *any* valid cert even if none of the alt/common names matches.
Somthing like this should fix this:
diff --git a/qmail-remote.c b/qmail-remote.c
index 40dbd31..f6b13b2 100644
--- a/qmail-remote.c
+++ b/qmail-remote.c
@@ -494,6 +494,7 @@ int tls_init()
X509 *peercert;
STACK_OF(GENERAL_NAME) *gens;
int found_gen_dns = 0;
+ int matched = 0;
int r = SSL_get_verify_result(ssl);
if (r != X509_V_OK) {
@@ -517,7 +518,10 @@ int tls_init()
const GENERAL_NAME *gn = sk_GENERAL_NAME_value(gens, i);
if (gn->type == GEN_DNS){
found_gen_dns = 1;
- if (match_partner(gn->d.ia5->data, gn->d.ia5->length)) break;
+ if (match_partner(gn->d.ia5->data, gn->d.ia5->length)) {
+ matched = 1;
+ break;
+ }
}
}
sk_GENERAL_NAME_pop_free(gens, GENERAL_NAME_free);
@@ -540,6 +544,9 @@ int tls_init()
out("ZTLS unable to verify server "); out(partner_fqdn);
out(": received certificate for "); outsafe(&peer); TLS_QUIT;
}
+ } else if (!matched) {
+ out("ZTLS unable to verify server ");
+ tls_quit(partner_fqdn, "certificate contains no matching names");
}
X509_free(peercert);
Missing features.h on FreeBSD 10.2
bzero November 5, 2015 14:57 CET
Hi,
I applied latest patch for netqmail, then #make and receive error missing features.h, how could i solve this?
Also tried with older patch, and got the same error :(
i am using FreeBSD 10.2 64bit
Thank you.
still no luck with many
bzero bzero November 5, 2015 17:58 CET
still no luck with many attempts, google didn't return positive result on this matter :(
Someone in the past already
roberto puzzanghera bzero November 5, 2015 19:03 CET
Someone in the past already mentioned that my patch is not freebsd compliant. Unfortunately I don't have any freebsd machine to do tests.
i could prepare a server for
bzero roberto puzzanghera November 6, 2015 05:27 CET
i could prepare a server for you to test it.
I will send you an email include account shortly.
Thanks a lot.
Hi bzero
roberto puzzanghera bzero November 6, 2015 10:36 CET
Hi bzero, thank you but this is not that kind of thing that I can do for free..
Ciao Roberto and hi to all
miz November 3, 2015 14:09 CET
Ciao Roberto and hi to all the qmail users,
here I'm again with a STRANGE problem occurring. I recently upgrade to the latest patch here, and I think that this is causing a problem:
2014-11-15
-modified the QUEUE_EXTRA variable in extra.h to record the Message-ID in the qmail-send's log. Thanks to Simone for the hint.
I have an account on my domain named log@[domain].[net]. Every single mail get copied to this account since the upgrade !
I'm basically running into this configuration (http://cr.yp.to/qmail/faq/admin.html#copies)
----------------------------
How do I keep a copy of all incoming and outgoing mail messages?
Answer: Set QUEUE_EXTRA to "Tlog\0" and QUEUE_EXTRALEN to 5 in extra.h. Recompile qmail. Put ./msg-log into ~alias/.qmail-log.
You can also use QUEUE_EXTRA to, e.g., record the Message-ID of every message: run
| awk '/^$/ { exit } /^[mM][eE][sS][sS][aA][gG][eE]-/ { print }'
from ~alias/.qmail-log.
----------------------------
I tried to remove the /var/qmail/alias/.qmail-log but nothing happens.
Is there a way to disable/reconfigure this feature without recompiling ? If not, how can I remove that extra.h declaration in order to recopile without that feature ?
Thank you !
you have to reverse that patch
roberto puzzanghera miz November 4, 2015 21:42 CET
you have to reverse that patch. simply replace extra.h with the original file and recompile. also remove .qmail-log
Thank you Roberto. I was
miz roberto puzzanghera November 5, 2015 10:09 CET
Thank you Roberto. I was looking into a solution to keep the feature and disable it run-time; I will try with:
Set QUEUE_EXTRA to "Tlogother\0" and QUEUE_EXTRALEN to 8 in extra.h
to have the logging feature ready into the "logother@domain" alias. Otherwise I will just reverse the patch as you suggest and remove the feature.
Thank you !
extra.h
John miz July 7, 2016 00:19 CET
It is okay to enter the entire email address. Just change the length number to the number of characters minus 1.
#ifndef EXTRA_H #define EXTRA_H #define QUEUE_EXTRA "Tlog@co.ker.tx.us\0" #define QUEUE_EXTRALEN 18 #endif
Woops! Not idiot proof.
George Cooke October 1, 2015 20:51 CET
Thanks Roberto for your hard work and excellent guide on qmail.
I am installing qmail for the first time on Debian and I got to the 'finally install and start qmail' (make setup check, qmailctl start) part on this page, but qmailctl did run as it did not exist.
So I just spent an hour stressing out trying to work out why qmailctl and supervise scripts didn't exist, and got it working on my own from LWQ, then came back here to continue and realised that you provide exact instructions for qmailctl and the supervise stuff to get it running in the next page, the configuration section!! OMG!! I am such an idiot, I know I should have read the whole guide first perhaps but I think maybe you should could indicate something around the finally install & start part to stop idiots from me wasting hours thinking their installation is messed up.
Thanks so much!
Woops! Not idiot proof.
GoofY George Cooke April 10, 2019 02:43 CET
THNX was fighting the same thing, because the cmd qmailctl was mentioned in the guide...
Woops! Not idiot proof.
Roberto Puzzanghera GoofY April 10, 2019 07:48 CET
OK, I added a warning :-)
:-)))
roberto puzzanghera George Cooke October 1, 2015 20:52 CET
:-)))
George, you had to be very tired, not idiot, and I think that in a normal situation this should not happen to you.
BTW I think it's not a good idea to add such obvious instructions, someone would be offended.. In addition the "install page" is just in the 4th page of the guide and the readers should consider all the following pages, as you already pointed out.
smtproutes - smtp-auth
nic August 16, 2015 12:52 CET
Dear Roberto,
I have a box A which was sending spams as one of the email accounts was compromised because of a weak password.
The IP was blacklisted and to prevent more undelivered emails, i had decided to use box B to relay emails.
In box B, I had created an email account relay@boxb.com with password secret.
In box A, I had created the file smtproutes in /var/qmail/control/ and added an entry like this:-
domain1.com:smtp.boxb.com relay@boxb.com secret
Emails from domain1.com are now relaying fine. In box A, i have about 60 domains and being lazy i decided to change the extry of smtproutes (box A) from domain1.com:smtp.boxb.com relay@boxb.com secret to :smtp.boxb.com relay@boxb.com secret
But now i started to get the below error
<email@remotedomain.com>: Sorry, I couldn't find any host named smtp.boxb.com?relay@boxb.com?secret. (#5.1.2)
What is wrong with my smtproutes? And is this the best way workaround until i had removed box A's IP from the blacklists?
regards
nic
Nic, the man page says that
roberto puzzanghera nic August 16, 2015 18:04 CET
Nic, the man page says that the correct syntax should be
:smtp.boxb.com|relay@boxb.com|secret
smtproutes
nic roberto puzzanghera January 27, 2023 16:04 CET
Hi Roberto,
Is the below syntax still working?
domain1.com:smtp.boxa.com|relay@boxa.com|secret
domain2.com:smtp.boxb.com|relay@boxb.com|secret
Thanks
smtproutes
Roberto Puzzanghera nic January 27, 2023 19:25 CET
Hi, I think yes. I don't think it has been modified. I'm using it just without pwd. Is it not working?
smtproutes
nic Roberto Puzzanghera January 31, 2023 16:39 CET
Not sure why it is not working for me. No bounce message.
Is there a command whereby certain domains uses local delivery whereas others use mulitple relays? Maybe i can troubleshoot from here.
Eg.
domain1.com:local
domain2.com:smtp.boxa.com|relay@boxa.com|secret
domain3.com:smtp.boxb.com|relay@boxb.com|secret
Thanks
smtproutes
Roberto Puzzanghera nic February 1, 2023 10:11 CET
Nic,
domain1.com:
will route it to its own mx
Do you have Auth enabled on qmail-smtpd?
smtproutes
Roberto Puzzanghera nic January 31, 2023 16:45 CET
I don't know... I have to test it but I haven't got the time these days... sorry. Let me know if you solve
Thanks Roberto!It is
nic roberto puzzanghera August 16, 2015 18:33 CET
Thanks Roberto!
It is working good. Is this the best method for my case until i can get the IP delisted?
thanks again
nic
I think is good enough. But
roberto puzzanghera nic August 16, 2015 18:42 CET
I think is good enough. But in my opinion the most important thing is to recognize why that pwd was stolen.. was a simple multiple trial via imap or submission port? In that case use fail2ban. Or it was an sql exploit by means of a security hole in one of your hosted websites?
The user was using 1234 as
nic roberto puzzanghera August 16, 2015 18:45 CET
The user was using 1234 as the password. Sigh!
Many thanks again, Roberto!
I recently published a pwd
roberto puzzanghera nic August 16, 2015 18:51 CET
I recently published a pwd patch for qmailadmin, I think it can enforce the pwd complexity even though it is very rudimental. Are you using fail2ban as suggested?
I saw the patch. Applying it
nic roberto puzzanghera August 16, 2015 19:20 CET
I saw the patch. Applying it now.
Thanks
nic
Is the patch in this
nic roberto puzzanghera August 16, 2015 18:54 CET
Is the patch in this tutorial? Let me read through again and let me add this into my present build. And yes i am using fail2ban.
regards
nic
can not start up qmail-send
xia0sheng March 14, 2015 14:43 CET
dear roberto
I use centos7.0 to install the qmail,if i do not install the qmail patching netqmail-1.06, the qmail stat run properly,, but I can only sent mail to my own server and receive email from other mail server, can not sent mail to other mail server(i think it is the qmail auth problem).
But, when I installed the netqmail patch roberto-netqmail-1.06.patch-latest.gz(for qmail auth?), when i enter the commond qmailctl start , qmail-send can not up,and qmail-send PID are change(after each enter commond qmailctl stat), and if i enter the commond "top" ,i find a lot of qmail-todo process, the server becomes very slow, how can i do? Thank you.
A little summary
1, if i do not install roberto-netqmail-1.06.patch-latest.gz, i can send mail to my mail server and receive mail from other mail server(some@somemail.com to my@mymail.com),i can not send mail to other mail.
2, after the installation of roberto-netqmail-1.06.patch-latest.gz, qmail-send cannot open normally, have been varied number between 0 second and 1 second, the server CPU is very high.
Can you give me any suggestion on this matter? Thanks very much?
Hi xia0sheng, as mentioned
roberto puzzanghera xia0sheng March 14, 2015 14:57 CET
Hi xia0sheng,
as mentioned above, the TODO patch included in my package may require that the queue has to be rebuilt. So, if you are sure that there are no messages in your queue, because it's just a testing server, stop qmail and try to kill all your qmail-todo processes like this
qmailctl kill
if those processes are still alive kill them manually.
Then erase your queue
rm -rf /var/qmail/queue
Now you can recompile qmail and restart
Let me know if this solved your issue
a lot qmail-todo process problem is also resolve
xia0sheng roberto puzzanghera March 19, 2015 05:26 CET
ldconfig -p|grep libsrs2
the server is centos7.0, if I patching "roberto-netqmail-1.06.patch-latest.gz" the qmail-send can not up
the problem is libsrs2, after install libsrs2
enter the command:
ldconfig -p|grep libsrs2
there is no result
the resove is
1. vim /etc/ld.so.conf
2. add /usr/local/lib
3. save
4. ldconfig
5. ldconfig -p|grep libsrs2
the result will be correct.
I had built a new toaster on
nic xia0sheng July 20, 2015 05:34 CET
I had built a new toaster on a VPS and also got flooded by qmail-todo which Roberto had mentioned.
"Be sure that libsrs2 is actually linked, otherwise you are going to have a qmail-send infinite crash and finally an auto-DoS"
I tried xia0sheng method and it did not work, maybe this is a CentOS 6.
So i added a custom file in /etc/ld.so.conf.d/
vim /etc/ld.so.conf.d/custom.conf
add the location of the libsrs2 library and mine is in /usr/local/lib
save
ldconfig ldconfig -p|grep libsrs2
And the result
libsrs2.so.0 (libc6,x86-64) => /usr/local/lib/libsrs2.so.0 libsrs2.so (libc6,x86-64) => /usr/local/lib/libsrs2.so
My floodings stopped.
This might be a better because my library for libev is also in the folder /usr/local/lib
ldconfig -p|grep libev libev.so.4 (libc6,x86-64) => /usr/local/lib/libev.so.4 libev.so.4 (libc6,x86-64) => /usr/lib64/libev.so.4 libev.so (libc6,x86-64) => /usr/local/lib/libev.so
Just my $0.02
Thanks a lot. I found the same problem
Ruben Garcia nic December 8, 2018 13:10 CET
Thanks a lot.
Your solution worked for me.
Ruben
Many thanx, had the same
fasu xia0sheng March 26, 2015 14:57 CET
Many thanx, had the same qmail-todo problem
still not work
xia0sheng roberto puzzanghera March 15, 2015 05:28 CET
dear roberto
Thanks very much for your reply. I did as what you say, but the problem is still.
In fact , i remove the /var/qmail/queue of my installtion in my before install path.
I did as you say but when i enter the commond qmailctl stat , the qmail-send still can no up normal. and the log in /var/log/qmail/send/current has no any error log. where can i find the error log of qmail-send of the qmailctl stat?
i have another question, if i install the qmail before, but i want to delete it and rebuilt it . Is it ok just delete the /var/qmail and /usr/local/src/netqmal-1.06 folder? and then make and path /usr/local/src/netqmail-1.06? Is there anything file or folder i should delete if i want rebuilt qmail? or should i reinstall my linux server?
i think maybe it is the problem of my centos7.0 system .
i just learn qmail very little time, a lot of configure i do'not known .
can you give me some advice about what can i do?
wish you have a nice weekend!
dear xia0sheng, I suppose
roberto puzzanghera xia0sheng March 15, 2015 09:01 CET
dear xia0sheng, I suppose that you recompiled qmail after erasing your queue. This is very strange. If I understand well
- you stopped qmail, erased the queue and you have no more qmail-todo processes alive
- recompiled qmail
- started qmail
- you have /var/log/qmail/send/current is empty
is it right?
When you want to recompile just follow this steps. I suppose that you have a folder with a patched qmail
- qmailctl stop
- erease the queue if it is the first time you install my patch
- cd to the source dir
- make clean
- make setup check (this will overwrite everything and rebuild the queue)
- qmailctl start
use auth_tls_force-tls.patch-latest pathing is ok
xia0sheng roberto puzzanghera March 15, 2015 12:48 CET
Dear roberto:
I did as what you say, but the problem is still. So I change use the "roberto-netqmail-1.06_auth_tls_force-tls.patch-latest" and everything is ok.
But i still cannot send mail to other email accounts?i can send email to my server and recevie mail form other email account?
the error is "Please check the email , server reply: 553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)" If I write 163.com to the file /var/qmail/control/tcpthosts, I can sent email to my mail.163.com account.
I known it is maybe the qmail-auth problem? but i do'not konwn how to solve it.
can you give me some addvice?
Thuanks very much!
I can't be of much help if
roberto puzzanghera xia0sheng March 15, 2015 12:59 CET
I can't be of much help if you don't try to provide details of what is happening to your server. You forgot to reply to my previous questions...
Concerning your new problem, your localhost must have the RELAYCLIENT flag in your tcp.smtp and tcp.submission. You should read the "tcprules" page. I suggest you to read carefully everything once again and perform all tests in the "Testing" page; I can assure that it works :)
i'm sorry for previous question
xia0sheng roberto puzzanghera March 15, 2015 14:37 CET
1. you stopped qmail, erased the queue and you have no more qmail-todo processes alive
I stop qmail, erased the queue, but because of i don't known i to kill the many qmail-todo process?before you tell me use qmailctl kill?, i use reboot my server to kill the qmail-todo process. I don't known why every of my reboot , I should first enter commond svscanboot & (it's can not auto startup)and then the qmail can start.(of course i enter svscanboot & after the pathing the qmail )
2. recompiled qmail
yes
3. started qmail
yes
4. you have /var/log/qmail/send/current is empty
yes
is it right?(all of right except 1)
When you want to recompile just follow this steps. I suppose that you have a folder with a patched qmail
1. qmailctl stop
2. erease the queue if it is the first time you install my patch
3. cd to the source dir
4. make clean
5 .make setup check (this will overwrite everything and rebuild the queue)
6 .qmailctl start
then i did all of you said above, but it is still have the qmail-send problem(can not up)
after pathing your full pathing"roberto-netqmail-1.06.patch-latest.gz"
the later i do is :
7. svscanboot &
8. qmailctl start
9.qmailctl stat
the status is
/service/qmail-send: up (pid 11702) 1 seconds
/service/qmail-send/log: up (pid 11592) 8 seconds
/service/qmail-smtpd: up (pid 11584) 8 seconds
/service/qmail-smtpd/log: up (pid 11587) 8 seconds
/service/qmail-submission: up (pid 11586) 8 seconds
/service/qmail-submission/log: up (pid 11591) 8 seconds
/service/vpopmaild: up (pid 11583) 8 seconds
/service/vpopmaild/log: up (pid 11585) 8 seconds
messages in queue: 0
messages in queue but not yet preprocessed: 0
10. qmailctl stat again
/service/qmail-send: up (pid 11742) 1 seconds
/service/qmail-send/log: up (pid 11592) 10 seconds
/service/qmail-smtpd: up (pid 11584) 10 seconds
/service/qmail-smtpd/log: up (pid 11587) 10 seconds
/service/qmail-submission: up (pid 11586) 10 seconds
/service/qmail-submission/log: up (pid 11591) 10 seconds
/service/vpopmaild: up (pid 11583) 10 seconds
/service/vpopmaild/log: up (pid 11585) 10 seconds
messages in queue: 0
messages in queue but not yet preprocessed: 0
so it can not work.
and i use your "roberto-netqmail-1.06_auth_tls_force-tls.patch-latest" every is ok except send mail to other mail server.
the /home/vpopmail/etc/tcp.smtp is
10.0.0.:allow,RELAYCLIENT=""
127.:allow,RELAYCLIENT=""
the /home/vpopmail/etc/tcp.smtp is
:allow,CHKUSER_WRONGRCPTLIMIT="3"
if i send mail to other mail acount, the error is
Please check the email <wangyouyu6@163.com>, server reply: 553 sorry, that domain isn't in my list of allowed rcpthosts; no valid cert for gatewaying (#5.7.1)
i reread your testing carefully tomorrow to find if solve my problem.
Thanks very much.
and if you will i can give you my mail server test acount, you enter my mail server and see what happen(i have no problem about this, because the mail server is just a test server )
if you want this, i can send you the test acount and password about my mail server.(can you receive mail about your mail acountroberto.puzzanghera@sagredo.eu?) and my email acount is wangyouyu6@163.com
i'm sorry for previous question
carlos h xia0sheng September 3, 2021 13:56 CET
hi roberto,
I m exactly in the same point as xia0sheng in 2015, how did you resolve it?
many thanks and kind regards
i'm sorry for previous question
Carlos carlos h September 3, 2021 15:11 CET
I explain me better my problem. All seems fine, less when I try to send an email, it remains in the queue and lots of qmail-todo appears when I execute "top". Seems that is entered in an infinite loop.
I checked the log:
cat /var/log/qmail/smtpd/current
@400000006131272939ba7eec qlogreceived: result=accepted code=250 reason=queueaccept detail= helo=localhost mailfrom=carlos@autoexaming.com rcptto=chernandez@webfutura.online relay=yes rcpthosts= size=91 authuser= authtype= encrypted= sslverified=no localip=127.0.0.1 localport=25 remoteip=127.0.0.1 remoteport=35356 remotehost=localhost qp=1999 pid=1998
I believe the problem is in the part "remoteip=127.0.0.1" and "remotehost=localhost" but I dont how can I fix it.
I cleaned the queue, and patched, and recompiled qmail
srs check
Roberto Puzzanghera Carlos September 3, 2021 16:35 CET
can you do this and post the response please?
ldconfig -p|grep libsrs2
then check the srs.c in your source dir and check that the same dir is reported there, For example
#include </usr/local/include/srs2.h>
srs check
carlos h Roberto Puzzanghera September 4, 2021 09:04 CET
In srs.c
#include </usr/local/include/srs2.h>
srs check
carlos h Roberto Puzzanghera September 4, 2021 08:51 CET
I think this is fine, and for some reason is ignoring rcpthosts, because in the log shows "rcpthosts=" not "rcpthosts=yes"
# ldconfig -p|grep libsrs2
libsrs2.so.0 (libc6,x86-64) => /usr/local/lib/libsrs2.so.0
libsrs2.so (libc6,x86-64) => /usr/local/lib/libsrs2.so
srs check
Roberto Puzzanghera carlos h September 4, 2021 10:20 CET
rcpthost= is normal, but I agree that it should advertise that it considered the domain as rcpthost. This is eventually an issue of the log line verbosity.
i'm sorry for previous question
Roberto Puzzanghera carlos h September 3, 2021 14:14 CET
Hi Carlos, can you please describe what is the issue in your server, please? I read the above from xiao and it is not clear to me...
i'm sorry for previous question
carlos h Roberto Puzzanghera September 3, 2021 15:57 CET
I m not absolutely secure, but I think there is a bug in the patch: roberto-netqmail-1.06.patch-2021.08.22 on chkuser part (I dont know if is a part of my previous problem)
On line 456 says:
+ hostname the value of "TCPREMOTEHOST"
and I believe it must be:
+ remotehostname the value of "TCPREMOTEHOST"
I dont know if after in some point the variable name is toggled or not, and if it causes the mistake to loop with my qmail-todo process
i'm sorry for previous question
Roberto Puzzanghera carlos h September 3, 2021 16:32 CET
but CHKUSER.log_format is just an info file, which is not part of the program...
i'm sorry for previous question
carlos Roberto Puzzanghera September 3, 2021 17:31 CET
Yes, you are right.
Sorry I wrote above as anonymous. When I send an email from my server (autoexaming.com) to an external domain (webfutura.online) In my /var/log/qmail/smtpd/current appears a connection from 127.0.0.1 to 127.0.0.1
@4000000061322839241167f4 qlogreceived: result=accepted code=250 reason=queueaccept detail= helo=localhost mailfrom=carlos@autoexaming.com rcptto=chernandez@webfutura.online relay=yes rcpthosts= size=88 authuser= authtype= encrypted= sslverified=no localip=127.0.0.1 localport=25 remoteip=127.0.0.1 remoteport=33472 remotehost=localhost qp=1287 pid=1279
@400000006132283b0c98c504 tcpserver: end 1279 status 0
@400000006132283b0c98d4a4 tcpserver: status: 0/200
@4000000061324c30147e1224 tcpserver: status: 0/200
@4000000061324c873434d094 tcpserver: status: 1/200
@4000000061324c8734399f0c tcpserver: pid 8425 from 127.0.0.1
@4000000061324c873446b2b4 tcpserver: ok 8425 autoexaming.com:127.0.0.1:25 localhost:127.0.0.1::33550
@4000000061324cc330c129bc tcpserver: end 8425 status 0
@4000000061324cc330c1395c tcpserver: status: 0/200
i'm sorry for previous question
Roberto Puzzanghera carlos September 3, 2021 23:19 CET
What do you have in your control/rcpthosts?
Please reply also to the other comment of mine here https://notes.sagredo.eu/en/qmail-notes-185/patching-qmail-82.html#comment2223
i'm sorry for previous question
carlos h Roberto Puzzanghera September 4, 2021 08:42 CET
thank you so much in advance for your great job :)
(In my case I preferred domain without smtp. prefix in all vars, and when generated cert i wrote the same)
$ cat /var/qmail/control/rcpthosts
autoexaming.com
i'm sorry for previous question
Roberto Puzzanghera carlos h September 4, 2021 10:33 CET
remoteip=127.0.0.1 remotehost=localhost is normal as you are connecting to localhost from localhost. If you connect to your server from another server, because you want to send an email after the auth, then you will see the remote ip in remoteip, but this is mainly for the submission service.
Concerning your rcpthosts issue... sorry if I ask... are you sure not to have changed rcpthosts and forgot to restart qmail?
Concerning the todo loop (it seems to be a separate problem) what do you have in your queue? How many msg?
i'm sorry for previous question
carlos Roberto Puzzanghera September 4, 2021 13:09 CET
First of all, thanks a lot for your affords :)
1) I m trying to send from my localhost to an external server (a hosting, that is working fine, not mine)
2) Concerning your rcpthosts issue... sorry if I ask... are you sure not to have changed rcpthosts and forgot to restart qmail?
Yes, indead i recompiled all, many times in the last days
3) Concerning the todo loop (it seems to be a separate problem) what do you have in your queue? How many msg?
It is half-solved for me, just enter in the loop when i do qmailctl restart. When I want restart qmail, reboot the computer.
I tried to do this test: https://notes.sagredo.eu/en/qmail-notes-185/testing-qmail-smtp-and-auth-22.html#vpopmail
In the test: "No valid MX test, mailbox syntax test" I get some strange:
# telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
220 autoexaming.com ESMTP
mail from: unexistent@fakedomain.xxx
553 5.1.7 sorry, mailbox syntax not allowed (chkuser)
mail from: unexistent@fake_domain.xxx
553 5.1.7 sorry, mailbox syntax not allowed (chkuser)
quit
in the first case according with the test example, it should be:
mail from: unexistent@fakedomain.xxx
550 5.1.8 sorry, can't find a valid MX for sender domain (chkuser)
i'm sorry for previous question
Roberto Puzzanghera carlos September 4, 2021 16:24 CET
your server looks very bad as many different (apparently unrelated) issues appear
I think it's better if you write me in private and continue there the investigation. Once solved we'll post here the solution
ok, let me know once you have
roberto puzzanghera xia0sheng March 15, 2015 15:01 CET
ok, let me know once you have finished to double check everything
Everything is ok, Thanks very much.
xia0sheng roberto puzzanghera March 19, 2015 04:15 CET
dear roberto:
Thanks very much, now everything is ok. i can use roundcube to send and receive mail.
the problem is the configure of roundcube configure.inc.php file
i chose "Use the current IMAP username and password for SMTP authentication" and then i can send mail to other mail account.
thanks very much for the helps these days.
Thanks very much....
from:xia0sheng
still have problems
xia0sheng roberto puzzanghera March 17, 2015 13:15 CET
dear roberto:
i check everything carefully, but still have some problems.
I can use foxmail to send and receive mail to or from other mail acounts.
the setting is:
send server:smtp.wangyouyu.cn,
ssl(not select)
port is 587
and i should select use STARTTLS. If the setting is this, every is ok.
but if I don't select use STASTTLS, if i send mail the error is "538 auth not available without TLS (#5.3.3)"
and in the roundcube webmail the config.inc.php is
<?php
/* Local configuration for Roundcube Webmail */
// ----------------------------------
// SQL DATABASE
// ----------------------------------
// Database connection string (DSN) for read+write operations
// Format (compatible with PEAR MDB2): db_provider://user:password@host/database
// Currently supported db_providers: mysql, pgsql, sqlite, mssql or sqlsrv
// For examples see http://pear.php.net/manual/en/package.database.mdb2.intro-dsn.php
// NOTE: for SQLite use absolute path: 'sqlite:////full/path/to/sqlite.db?mode=0646'
$config['db_dsnw'] = 'mysql://temp:XXXXXXX@localhost/roundcubemail';
// ----------------------------------
// IMAP
// ----------------------------------
// The mail host chosen to perform the log-in.
// Leave blank to show a textbox at login, give a list of hosts
// to display a pulldown menu or set one host as string.
// To use SSL/TLS connection, enter hostname with prefix ssl:// or tls://
// Supported replacement variables:
// %n - hostname ($_SERVER['SERVER_NAME'])
// %t - hostname without the first part
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
// %s - domain name after the '@' from e-mail address provided at login screen
// For example %n = mail.domain.tld, %t = domain.tld
// WARNING: After hostname change update of mail_host column in users table is
// required to match old user data records with the new host.
$config['default_host'] = 'smtp.wangyouyu.cn';
// ----------------------------------
// SMTP
// ----------------------------------
// SMTP server host (for sending mails).
// To use SSL/TLS connection, enter hostname with prefix ssl:// or tls://
// If left blank, the PHP mail() function is used
// Supported replacement variables:
// %h - user's IMAP hostname
// %n - hostname ($_SERVER['SERVER_NAME'])
// %t - hostname without the first part
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
// %z - IMAP domain (IMAP hostname without the first part)
// For example %n = mail.domain.tld, %t = domain.tld
$config['smtp_server'] = 'smtp.wangyouyu.cn';
// SMTP port (default is 25; use 587 for STARTTLS or 465 for the
// deprecated SSL over SMTP (aka SMTPS))
$config['smtp_port'] = 587;
// provide an URL where a user can get support for this Roundcube installation
// PLEASE DO NOT LINK TO THE ROUNDCUBE.NET WEBSITE HERE!
$config['support_url'] = '';
// this key is used to encrypt the users imap password which is stored
// in the session record (and the client cookie if remember password is enabled).
// please provide a string of exactly 24 chars.
$config['des_key'] = 'al=t9fl&8A&Y+0D4rhipphsN';
// Automatically add this domain to user names for login
// Only for IMAP servers that require full e-mail addresses for login
// Specify an array with 'host' => 'domain' values to support multiple hosts
// Supported replacement variables:
// %h - user's IMAP hostname
// %n - hostname ($_SERVER['SERVER_NAME'])
// %t - hostname without the first part
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
// %z - IMAP domain (IMAP hostname without the first part)
// For example %n = mail.domain.tld, %t = domain.tld
$config['username_domain'] = 'wangyouyu.cn';
// Name your service. This is displayed on the login screen and in the window title
$config['product_name'] = 'xxxxxxx????';
// ----------------------------------
// PLUGINS
// ----------------------------------
// List of active plugins (in plugins/ directory)
$config['plugins'] = array('acl', 'additional_message_headers', 'archive', 'attachment_reminder', 'autologon', 'database_attachments', 'debug_logger', 'emoticons', 'enigma', 'example_addressbook', 'filesystem_attachments', 'help', 'hide_blockquote', 'http_authentication', 'identity_select', 'jqueryui', 'legacy_browser', 'managesieve', 'markasjunk', 'new_user_dialog', 'new_user_identity', 'newmail_notifier', 'password', 'redundant_attachments', 'show_additional_headers', 'squirrelmail_usercopy', 'subscriptions_option', 'userinfo', 'vcard_attachments', 'virtuser_file', 'virtuser_query', 'zipdownload');
// the default locale setting (leave empty for auto-detection)
// RFC1766 formatted language name like en_US, de_DE, de_CH, fr_FR, pt_BR
$config['language'] = 'zh_CN';
in the webmail if i send mail to other mail acounts
the error is "SMTP error: [553] sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)"
How can I set the roundcube use STARTTLS as foxmail setting?
thank very much.
I really don't konwn what to do now.
qmail-smtpd: read failed: (null) only with one sender
Marc January 2, 2015 12:29 CET
Hello Roberto,
i have a problem with mails coming from amazon. Every Mail send from amazon is not delivered because it shows the error qmail-smtpd: read failed. This error only happen with mails from the amazon mail servers, i do not have this eror with other mails. I have no clue whats wrong - do you have an idea? Output from Log File:
tcpserver: pid 18422 from 54.240.0.89 tcpserver: ok 18422 0:::ffff:5.9.211.13:25 :54.240.0.89::32891 CHKUSER accepted sender: from <20141222011816fe8d1176403e4a1da936071f1208d53f-C24F0W6MS7QTYP@bounces.amazon.com|remoteinfo/auth:|chkuser-identify:> remote <helo:a0-89.smtp-out.eu-west-1.amazonses.com|remotehostname:unknown|remotehostip:54.240.0.89> rcpt <> : sender accepted tcpserver: status: 1/20 qmail-smtpd: read failed: (null) from 54.240.0.89 to 20141222011816fe8d1176403e4a1da936071f1208d53f-C24F0W6MS7QTYP@bounces.amazon.com helo a0-89.smtp-out.eu-west-1.amazonses.com tcpserver: end 18422 status 256
Regards,
Marc
I think you should record the
roberto puzzanghera Marc January 3, 2015 11:06 CET
I think you should record the smtp conversation enabling recordio in your run file. Let me know if you solve
qmail-smtpd read failed - SPF Check was the problem
Marc roberto puzzanghera January 3, 2015 16:55 CET
Hello Roberto,
thanks for the hint with recordio. I figured out that the SPF check was the problem:
@4000000054a81075289ded24 9091 > 451 SPF lookup failure (#4.3.0) @4000000054a8107529ddac9c 9091 < RSET @4000000054a8107529de0674 9091 > 250 flushed
When i changed the /var/qmail/control/spfbehavior entry to 1 mail from amazon get thru and i noticed, that it take some time to process the mail.
I tried a manual spfquery for the amazon mail and the check take about 70 sec. So i think that the check takes to long and the qmail-smtp process take this as an timeout and reject the mail because of that. Other spf checks to other domains are working fast. Maybe i should try to change the dns server entry? But it is strange that this happens only to amazon servers.
Thanks for helping.
I would try a test
roberto puzzanghera Marc January 3, 2015 22:58 CET
I would try a test like
dig amazon.com txt
and see if you get a timeout error or not
qmail-send fail
huyenha December 6, 2014 17:15 CET
Dear Roberto
I completely followed your notes, my email server can send email to another domain but cannot deliver to local account.
I've try to send from huyenha to nxhuy (2 accounts already created and loged in sucsessful) but it said:
failure: Sorry,_no_mailbox_here_by_that_name._(#5.1.1)/
qmail-send log:
@4000000054832f6635627354 new msg 2754774 @4000000054832f6635627b24 info msg 2754774: bytes 1228 from <huyenha@4trust.vn> qp 2158 uid 89 @4000000054832f6635627f0c starting delivery 1: msg 2754774 to local log@4trust.vn @4000000054832f6635627f0c status: local 1/10 remote 0/20 @4000000054832f66356282f4 starting delivery 2: msg 2754774 to local nxhuy@4trust.vn @4000000054832f66356282f4 status: local 2/10 remote 0/20 @4000000054832f66358539ac delivery 2: failure: Sorry,_no_mailbox_here_by_that_name._(#5.1.1)/ @4000000054832f6635e71474 status: local 1/10 remote 0/20 @4000000054832f6635f5b2a4 delivery 1: success: Received:_(qmail_2158_invoked_by_uid_89);_6_Dec_2014_11:31:24_-0500/Received:_(qmail_2158_invoked_by_uid_89);_6_Dec_2014_11:31:24_-0500/Received:_by_simscan_1.4.0_ppid:_2149,_pid:_2151,_t:_0.0077s/Received:_by_simscan_1.4.0_ppid:_2149,_pid:_2151,_t:_0.0077s/Received:_from_unknown_(HELO_mail.4trust.vn)_()/Received:_from_unknown_(HELO_mail.4trust.vn)_()/__by_0_with_SMTP;_6_Dec_2014_11:31:24_-0500/Date:_Sat,_06_Dec_2014_23:31:24_+0700/From:_huyenha@4trust.vn/To:_nxhuy@4trust.vn/Subject:_Re:_Fwd:_ssdfadf/In-Reply-To:_<e8dd61a49b9a353705819b4d656a3cbc@4trust.vn>/References:_<01988b8baeb0552fb9b3e52dbf482e6a@4trust.vn>/_<e8dd61a49b9a353705819b4d656a3cbc@4trust.vn>/Message-ID:_<8e9696acc4134d69e84119c5567ac871@4trust.vn>/Message-ID:_<8e9696acc4134d69e84119c5567ac871@4trust.vn>/---/did_0+0+2/ @4000000054832f6635f62bbc status: local 0/10 remote 0/20 @4000000054832f670250cbdc bounce msg 2754774 qp 2167 @4000000054832f670250d3ac end msg 2754774
Please help me!
Duplicate emails
Arturo huyenha January 2, 2015 23:03 CET
Hi,
I made the installation of a new server, I have the same problems as mentioned, for every email that incoming or outgoing a copy this email is sent to the account log@domain.com.
I revert the path and all work fine.
Any ideas???
Thanks
This is normal, as the
roberto puzzanghera Arturo January 3, 2015 11:09 CET
This is normal, as the log@yourdomain.xy account is used to improve the qmail-send log. What do you have in your ~alias/.qmail-log file?
The .qmail-log contains:|
Arturo roberto puzzanghera January 3, 2015 11:40 CET
The .qmail-log contains:
| awk '/^$/ { exit } /^[mM][eE][sS][sS][aA][gG][eE]/ { print } /^[rR][eE][cC][eE][iI][vV][eE][dD]:/ { print; } /^[fF][rR][oO][mM]:/ { print } /^[tT][oO]:/ { print } /^[sS][uU][bB][jJ][eE][cC][tT]:/ { print } /^[xX]-[mM][aA][iI][lL][eE][rR]/ { print } /[hH][eE][lL][oO]/{ print } /^[rR][eE][pP][lL][yY]-[tT][oO]/{ print } /^[rR][eE][tT][uU][rR][nN]-[pP][aA][tT][hH]/{ print } /^[cC][cC]:/{ print } /^[dD][eE][lL][iI][vV][eE][rR][eE][dD]-[tT][oO]/{ print } /^[dD][aA][tT][eE]:/{ print } / by /{ print } / id /{ print } /<.*>/{ print }'
| echo "---"
But the error is:
<log@domain.com>: Sorry, no mailbox here by that name. (#5.1.1)
And log:
@4000000054a7d4ad3592ce3c new msg 1322152 @4000000054a7d4ad3592d224 info msg 1322152: bytes 2377 from <> qp 4710 uid 1008 @4000000054a7d4ad359310a4 starting delivery 3: msg 1322152 to local domain.com-log@domain.com @4000000054a7d4ad359310a4 status: local 1/10 remote 0/20 @4000000054a7d4ad35933f84 starting delivery 4: msg 1322152 to remote me@mail.es @4000000054a7d4ad3593436c status: local 1/10 remote 1/20 @4000000054a7d4ad35c68c54 delivery 3: failure: Sorry,_no_mailbox_here_by_that_name._(#5.1.1)/ @4000000054a7d4ad35c75774 status: local 0/10 remote 1/20
Thanks!
can you confirm that
roberto puzzanghera Arturo January 3, 2015 12:25 CET
can you confirm that domain.com (the domain inside control/me) really exists and has a valid MX record?
Yes is correct!
Arturo roberto puzzanghera January 3, 2015 18:25 CET
Hi,
The MX is correct and set fine in control/me file.
and you created the
roberto puzzanghera Arturo January 3, 2015 22:51 CET
and you created the domain with vpopmail?
Yes
Arturo roberto puzzanghera January 3, 2015 22:55 CET
Yes, the domain was created with vpopmail, and i delete and recreate the domain.
The domain is on another files control\files.
what control\files is
roberto puzzanghera Arturo January 3, 2015 23:13 CET
what control\files is needed for?
I mean that the domain is
Arturo roberto puzzanghera January 3, 2015 23:45 CET
I mean that the domain is automatically added to other files in the folder Control (virtualdomains, rcpthosts, etc).
No ideas at the moment, but
roberto puzzanghera Arturo January 4, 2015 11:01 CET
No ideas at the moment, but you can be sure that the domain was actually created trying to connect to the postmaster account, for example
telnet 0 89 login postmaster@domain.com PASSWORD
Good news, I think I've found
Arturo roberto puzzanghera January 4, 2015 12:52 CET
Good news, I think I've found a possible motive, apparently aliases found in /var/qmail/alias not working, I created a symbolic link to /home/vpopmail/domains/domain.com/.qmail-log and this if is working now.
@4000000054a9350306110ffc delivery 19: success: Received:_(qmail_30229_invoked_by_uid_33);_4_Jan_2015_12:41:28_+0000/Received:_(qmail_30229_invoked_by_uid_33);_4_Jan_2015_12:41:28_+0000/To:_Arturo_Blanco_/To:_Arturo_Blanco_/Subject:_Re:_test_03/Date:_Sun,_04_Jan_2015_13:41:28_+0100/From:_user@domain.com/In-Reply-To:_/References:_/Message-ID:_/Message-ID:_/---/did_0+0+2/
Any idea why I do not work the /var/qmail/alias??
mmh... do you have your
roberto puzzanghera Arturo January 4, 2015 14:36 CET
mmh... do you have your aliases stored in mysql db (vpopmail compiled with --enable-valias)?
This configurator with the
Arturo roberto puzzanghera January 4, 2015 14:50 CET
This configurator with the --disable-valias option (I followed every step of your tutorial)
root@mail:~# telnet 0
Arturo roberto puzzanghera January 4, 2015 12:35 CET
root@mail:~# telnet 0 89 Trying 0.0.0.0... Connected to 0. Escape character is '^]'. +OK login postmaster@domain.com pass +OK+ vpopmail_dir /home/vpopmail domain_dir /home/vpopmail/domains/domain.com uid 89 gid 89 name postmaster comment Postmaster quota NOQUOTA user_dir /home/vpopmail/domains/domain.com/postmaster encrypted_password pass_encrypt clear_text_password pass no_password_change 0 no_pop 0 no_webmail 0 no_imap 0 bounce_mail 0 no_relay 0 no_dialup 0 user_flag_0 0 user_flag_1 0 user_flag_2 0 user_flag_3 0 no_smtp 0 domain_admin_privileges 1 override_domain_limits 0 no_spamassassin 0 delete_spam 0 no_maildrop 0 system_admin_privileges 0 .
I realise that in qmail-send
huyenha huyenha December 7, 2014 04:50 CET
I realise that in qmail-send log:
@4000000054832f66356282f4 starting delivery 2: msg 2754774 to local nxhuy@4trust.vn
must be:
@4000000054832f66356282f4 starting delivery 2: msg 2754774 to local 4trust.vn-nxhuy@4trust.vn
So I delete the domain and re-add, now it can deliver to local account.
But that generate another error that can't deliver to "log alias" for qmail-tap function
@400000005483d6841bf4da4c new msg 2754788 @400000005483d6841bf4de34 info msg 2754788: bytes 628 from <huyenha@4trust.vn> qp 11658 uid 89 @400000005483d6841bf4e21c starting delivery 1: msg 2754788 to local 4trust.vn-log@4trust.vn @400000005483d6841bf4e604 status: local 1/10 remote 0/20 @400000005483d6841bf4e9ec starting delivery 2: msg 2754788 to local 4trust.vn-nxhuy@4trust.vn @400000005483d6841bf4e9ec status: local 2/10 remote 0/20 @400000005483d6841ccb8f24 delivery 1: failure: Sorry,_no_mailbox_here_by_that_name._(#5.1.1)/ @400000005483d6841ccb96f4 status: local 1/10 remote 0/20 @400000005483d6841cced314 delivery 2: success: did_0+0+1/ @400000005483d6841cced6fc status: local 0/10 remote 0/20 @400000005483d6842401182c bounce msg 2754788 qp 11669 @400000005483d6842401c40c end msg 2754788
I think this is because my
roberto puzzanghera huyenha December 7, 2014 08:25 CET
I think this is because my patch creates an alias /var/qmail/alias/.qmail-log which uses the same address of your tap address (http://notes.sagredo.eu/node/82#queue-extra). This alias is needed to improve the log of qmail send. You can solve by changing the tap address
qmail-log alias
Shailendra Shukla roberto puzzanghera December 12, 2014 12:29 CET
Hi Roberto ,
I have followed your excellent guide and installed my server. The issues is for every mail that is sent or received it is trying to send a copy to some log alias. How can I disable that . Below is the message transcript.
Hi. This is the qmail-send program at akhurathacpl.com. I'm afraid I wasn't able to deliver your message to the following addresses. This is a permanent error; I've given up. Sorry it didn't work out. <log@akhurathacpl.com>: Sorry, no mailbox here by that name. (#5.1.1) --- Below this line is a copy of the message. Return-Path: <support@akhurathacpl.com> Received: (qmail 11804 invoked by uid 89); 12 Dec 2014 13:46:33 +0530 Received: by simscan 1.4.0 ppid: 11796, pid: 11799, t: 0.0938s scanners: attach: 1.4.0 clamav: 0.98.5/m:55/d:19764 spam: 3.4.0 Received: from unknown (HELO mail.akhurathacpl.com) (::1) by 0 with SMTP; 12 Dec 2014 13:46:33 +0530 Received-SPF: unknown (0: No IP address in conversation) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_354b252cc407d8efce244ea9bc720ecc" Date: Fri, 12 Dec 2014 13:46:20 +0530 From: support@akhurathacpl.com To: support@akhurathacpl.com Subject: test mail Message-ID: <0703b9b216a5918c3639dcf4dad7d264@akhurathacpl.com> X-Sender: support@akhurathacpl.com User-Agent: Roundcube Webmail/1.0.3 --=_354b252cc407d8efce244ea9bc720ecc Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII test --=_354b252cc407d8efce244ea9bc720ecc Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=UTF-8 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"> <html><body style=3D'font-size: 10pt; font-family: Verdana,Geneva,sans-seri= f'> <p>test</p> <div> </div> </body></html> --=_354b252cc407d8efce244ea9bc720ecc--
Request your help in this regards
Thanks
you can revert this patch
roberto puzzanghera Shailendra Shukla December 12, 2014 13:01 CET
you can revert this patch http://notes.sagredo.eu/node/82#queue-extra
anyway I think you have deleted the ~alias/.qmail-log alias or you don't have a valid mx for your control/me domain. Actually this is not a real mailbox but an alias created in order to improve the qmail-send log, so you may want to continue to use it
qmail-log alias
Shailendra Shukla roberto puzzanghera December 12, 2014 13:10 CET
ahhh now I get you , actually this is a newly created server and I have still not pointed the mx to the new servers ip . Let me check by doing point the valid MX to the server .
Thanks a lot for your precious guidance as always you are a real life saver
I think you have a valid mx
roberto puzzanghera Shailendra Shukla December 12, 2014 13:15 CET
I think you have a valid mx for for your domain
$ dig akhurathacpl.com mx
; <<>> DiG 9.9.6-P1 <<>> akhurathacpl.com mx
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 36916
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;akhurathacpl.com. IN MX
;; ANSWER SECTION:
akhurathacpl.com. 3600 IN MX 10 mail.net4india.com.
;; Query time: 288 msec
;; SERVER: 213.205.32.70#53(213.205.32.70)
;; WHEN: Fri Dec 12 14:03:12 CET 2014
;; MSG SIZE rcvd: 65
and are you sure you are
roberto puzzanghera huyenha December 6, 2014 17:30 CET
and are you sure you are using my patch? I can't see chkuser in action... is it enabled?
Yes, chkuser in action, this
huyenha roberto puzzanghera December 6, 2014 17:52 CET
Yes, chkuser in action, this is qmail-smtpd log:
@4000000054832fc82cfe8ff4 tcpserver: status: 1/20 @4000000054832fc82cffbcbc tcpserver: pid 2222 from ::1 @4000000054832fc82d009f4c tcpserver: ok 2222 0:::1:25 :::1::40420 @4000000054832fc82d3d331c CHKUSER accepted sender: from <huyenha@4trust.vn|remoteinfo/auth:|chkuser-identify:> remote <helo:mail.4trust.vn|remotehostname:unknown|remotehostip:::1> rcpt <> : accepted any sender always @4000000054832fc82d66a47c CHKUSER accepted rcpt: from <huyenha@4trust.vn|remoteinfo/auth:|chkuser-identify:> remote <helo:mail.4trust.vn|remotehostname:unknown|remotehostip:::1> rcpt <nxhuy@4trust.vn> : found existing recipient @4000000054832fc8304afbd4 simscan:[2222]:RELAYCLIENT:0.0045s:-:::1:huyenha@4trust.vn:nxhuy@4trust.vn @4000000054832fc83547c734 mail recv: pid 2222 from <huyenha@4trust.vn> qp 2224 @4000000054832fc83547cb1c qmail-smtpd: message accepted: huyenha@4trust.vn from ::1 to nxhuy@4trust.vn helo mail.4trust.vn @4000000054832fc907f41454 tcpserver: end 2222 status 0 @4000000054832fc907f41c24 tcpserver: status: 0/20
can you show your
roberto puzzanghera huyenha December 6, 2014 17:59 CET
can you show your control/defaultdelivery?
Now it
huyenha roberto puzzanghera December 6, 2014 18:09 CET
Now it is:
|/var/qmail/bin/preline -f /usr/local/dovecot/libexec/dovecot/deliver -d $EXT@$USER
I also tried "| /home/vpopmail/bin/vdelivermail '' bounce-no-mailbox"
But the result is the same error
the content of the
roberto puzzanghera huyenha December 6, 2014 18:20 CET
the content of the defaultdelivery is
| /home/vpopmail/bin/vdelivermail '' bounce-no-mailbox
without quotes, right?
dovecot issue?
roberto puzzanghera huyenha December 6, 2014 18:15 CET
It can be a dovecot issue (you should also look for dovecot-lda errors, expecially in the sql driver).
But it's strange that you can't have it working when using vpopmail as deliver. Are there any .qmail overriding the defaultdelivery?
Let's fix vpopmail first of all.
I've change the
huyenha roberto puzzanghera December 6, 2014 18:28 CET
I've change the control/defaultdelivery and ~vpopmail/domains/4trust.vn/.qmail_default to | /home/vpopmail/bin/vdelivermail '' bounce-no-mailbox"
But the error is still the same :(
do you have double quotes?
roberto puzzanghera huyenha December 6, 2014 18:34 CET
do you have double quotes at the end of that line?
Sorry, It's my mistake, i've
huyenha roberto puzzanghera December 6, 2014 18:43 CET
Sorry, It's my mistake, i've remove the double quote and re-test. The error is still there.
Could it be a qmail's error?
can you send me in a private
roberto puzzanghera huyenha December 6, 2014 18:53 CET
can you send me in a private msg an strace of smtp session?
Hi, have you passed the
roberto puzzanghera huyenha December 6, 2014 17:27 CET
Hi, have you passed the vpopmail login test from the command line?
I've follow your vpopmail
huyenha roberto puzzanghera December 6, 2014 18:02 CET
I've follow your vpopmail auth test at http://notes.sagredo.eu/node/22#vpopmail
the result is ok
telnet localhost 89 Trying ::1... Connected to localhost. Escape character is '^]'. +OK login nxhuy@4trust.vn 123456 +OK+ vpopmail_dir /home/vpopmail domain_dir /home/vpopmail/domains/4trust.vn uid 89 gid 89 name nxhuy comment nxhuy quota 524288000S user_dir /home/vpopmail/domains/4trust.vn/nxhuy encrypted_password $1$uk0Fi8aE$USOXMa6g9i0Rjgd9vgLx2/ clear_text_password 123456 no_password_change 0 no_pop 0 no_webmail 0 no_imap 0 bounce_mail 0 no_relay 0 no_dialup 0 user_flag_0 0 user_flag_1 0 user_flag_2 0 user_flag_3 0 no_smtp 0 domain_admin_privileges 0 override_domain_limits 0 no_spamassassin 0 delete_spam 0 no_maildrop 0 system_admin_privileges 0 .
forcetls patch
Andrei August 21, 2014 21:43 CET
Can you pls let me know how to remove the ForceTls patch from the big patch? I need the auth to work without tls.
Thank you!
DKIM and SRS = fail :-(
S July 6, 2014 02:21 CET
Hi,
if you use SRS, DKIM filter fails, as it sets original SENDER domain instead of that specified in SRS. Any suggestions how to fix it?
cheers and thanks for your patches!
S.
Can you post how the headers
roberto puzzanghera S July 7, 2014 12:50 CET
Can you post how the headers look like when we you use SRS?
I contacted M.Banghui, the author of the DKIM patch, and he told me that he can fix it.
Sure :)
S roberto puzzanghera July 7, 2014 17:25 CET
The DKIM is getting _SENDER - and SRS is providing to qmail an original Sender domain, instead of the one taken from /var/qmail/control/srs_domain
BTW, why don't you move your awesome patchset to github? It would make things much easier :)
I would declare I can work on IPv6 part, as it is the only (but big) missing thing from your patches.
cheers,
S
Hi, can you do a cut&paste of
roberto puzzanghera S July 7, 2014 21:11 CET
Hi, can you do a cut&paste of the headers?
Actually an help on the IPv6 patch would be appreciated, as I have not much time these days, and I'm not an IPv6 expert. As you probably know M.Banghui has merged an IPv6 patch in his DKIM/SURBL and my plan is to add it to my package soon or later :)
qmail-todo problem
Kamal June 15, 2014 21:33 CET
Firslty, thanks Roberto for ur efforts of creating the patch, But i'm facing a critical problem after i patched qmail 1.6 with ur patch that i have found my server load reached to 250, and when i check the process found that qmail-todo consuming cpu terribly. But i don't know why this happened and what should i do, although i have applied the steps and installed qmail successfully.
Re: qmail-todo problem
roberto puzzanghera Kamal June 15, 2014 22:00 CET
Hi Kamal,
I assume that you erased your queue in this way before installing the todo-patched qmail for the first time:
qmailctl stop rm -rf /var/qmail/queue make setup check
If yes please post a
ps axfuww | grep qmail
The best way to investigate what qmail-todo is doing is using strace:
strace -Ff -o /tmp/qmail-strace.log -p <pid_of_qmail-todo>
Re: qmail-todo problem
Kamal roberto puzzanghera June 16, 2014 11:46 CET
Hi Roberto,
Yes, I already erased the queue as you mentioned, I want to clear something i'm using the combined patch "roberto-netqmail1.06.patch-latest" NOT todo-patch. but the problem with qmail-todo process that was consuming cpu.
Kindly find output details below,
strace.log
http://www.mediafire.com/view/9ptwzxri9xpptgr/qmail-strace.log
ps-axfuww.log
http://www.mediafire.com/view/1277h6de1g80xsn/ps-axfuww
Maybe a lbsrs problem did you
Enetcs Kamal June 16, 2014 17:57 CET
Maybe a lbsrs problem did you successfully installed it? did you ldconfig it?
I think it's not a libsrs
roberto puzzanghera Enetcs June 16, 2014 19:22 CET
I think it's not a libsrs issue, as in that case the compilation itself will break
Re: qmail-todo problem
roberto puzzanghera Kamal June 16, 2014 12:52 CET
it seems to be an infinite loop...
when you stop qmail I would try to kill all those qmail-todo which doesn't belong to qmail-send anymore, and after that erase the existing queue, recompile and restart qmail
Re: qmail-todo problem
kamal roberto puzzanghera June 19, 2014 16:12 CET
I realy did that, but unfortunately still the same, the load reached to 270,and server was going to explode.
Hi, I have the same
ruddur kamal January 31, 2015 16:27 CET
Hi,
I have the same problem
I followed the howto line by line but nothing
You have to find the solution ?
thx
Hi ruddur, can you describe
roberto puzzanghera ruddur January 31, 2015 19:42 CET
Hi ruddur, can you describe the problem you have?
Roberto, Rudi, I took a
Pierre L. roberto puzzanghera February 1, 2015 16:06 CET
Roberto, Rudi,
I took a look at the problem..... so.... qmail-todo is launched by qmail-send. While doing an strace -f on the qmail-send supervise run file, I noticed this:
9011 stat("/usr/lib64", {st_mode=S_IFDIR|0755, st_size=167936, ...}) = 0
9011 writev(2, [{"qmail-send", 10}, {": ", 2}, {"error while loading shared libra"..., 36}, {": ", 2}, {"libsrs2.so.0", 12}, {": ", 2}, {"cannot open shared object file", 30}, {": ", 2}, {"No such file or directory", 25}, {"\n", 1}], 10) = -1 EBADF (Bad file descriptor)
9011 exit_group(127) = ?
Doing an ldd /var/qmail/bin/qmail-send, I realized that your libsrs2 is already included in your Slack64 but not under /usr/lib64. Instead you have it both under /usr/lib and /usr/local/lib.
I simply symlinked your libsrs2 to /usr/lib64 and everything is now working fine :)
Good troubleshooting exercice right :)
Pierre
PS: salutations to you Roberto - always nice to hear from you my friend!
Hi my friend, thanks for your
roberto puzzanghera Pierre L. February 2, 2015 16:24 CET
Hi my friend, thanks for your hint!
But I expect that qmail-send will find the library provided that /usr/local/lib is in my /etc/ld.so.conf, right? So it's not clear to me the need to symlink /usr/lib64
SRS2
NIcholas Chua May 4, 2014 19:20 CET
Hi,
I am trying out the latest patch with the SRS2. While compiling i had an error
/usr/bin/ld: cannot find -lsrs2 collect2: ld returned 1 exit status make: *** [qmail-local] Error 1
In the beginning it cannot find the file srs2.h so i download it from http://www.filewatcher.com/p/libsrs2-dev_1.0.18-4_amd64.deb.14658/usr/include/srs2.h.html and copied it to /usr/local/include/
I am on CentOS 6 64 bits.
Thanks for helping.
nic
You need libsrs2
roberto puzzanghera NIcholas Chua May 4, 2014 21:25 CET
You have to install the libsrs2 libraries, not only the srs.h, see above. Check if they are installed in this way
ldconfig -p|grep libsrs2
ldconfig -p|grep libsrs2
RD roberto puzzanghera March 6, 2015 23:34 CET
Hi Roberto,
Successfully compiled libsrs2 but libsrs2 is not linked.
# ldconfig -p|grep libsrs2
<ends up with no results>
I'm using CentOS 5.8. Thanks.
Re: ldconfig and libsrs2
roberto puzzanghera RD March 7, 2015 08:12 CET
supposing that you remembered to run "ldconfig" after the compilation, where libsrs2 was installed? Check that the directory where it was installed is included in your /etc/ld.so.conf (or similar). If not, you should add it and run "ldconfig" again after that
Hello,Yes i
NIcholas Chua roberto puzzanghera May 5, 2014 05:01 CET
Hello,
Yes i did.
[root@beyond ~]# ldconfig -p|grep libsrs2
libsrs2.so.0 (libc6,x86-64) => /usr/lib64/libsrs2.so.0
regards
nic
did you modify srs.c?
roberto puzzanghera NIcholas Chua May 5, 2014 06:30 CET
did you modify srs.c accordingly?
Didnt thought of doing that.
NIcholas Chua roberto puzzanghera May 5, 2014 07:23 CET
Didnt thought of doing that. What should i edit?
regards
nic
SSL CERTIFICATES
Enetcs April 8, 2014 21:00 CET
Hi roberto
I succesfully create the certificates and it works great, the only problem is that in mozilla-thunderbird, iphone, android show a warning because the certificate is not valid, configuring an exception it works. About it I have two questions.
First
Is there any chance to have differents certificates for every domain?
Second
If I buy a "valid certificate" can I just copy into the folder and it will work?
Thanks in advance
Enetcs as far as I know
roberto puzzanghera Enetcs April 8, 2014 21:26 CET
Enetcs
as far as I know the e.h. auth patch works with a global certificate.
Yes you simply have to copy the certificate into that folder, but when you buy a valid certificate you also get an "intermidiate certificate" to be copied in the same folder, which assures that your cert is valid
CHKUSER patch - how to disable!!
Anonymous October 10, 2013 22:24 CET
imho, chkuser patch is way more problems than it's worth. It's blocking legit emails from namecheap, comodo, godaddy and others. How does one disable chkuser permenantly????? I've tried commenting out of my qmail-submission/run, and restarting qmail, chkuser still running. grrr.
can you please provide log
roberto puzzanghera Anonymous October 11, 2013 07:12 CET
can you please provide log details about the rejections for such providers? thank you
chkuser silently dropping
Anonymous roberto puzzanghera October 11, 2013 18:03 CET
chkuser silently dropping mail ! How do I completely disable chkuser??????????????????????
2013-10-11 12:39:48.373851500 tcpserver: status: 1/20
2013-10-11 12:39:48.374029500 tcpserver: pid 28172 from 208.65.144.245
2013-10-11 12:39:48.374142500 tcpserver: ok 28172 0:::ffff:192.184.84.112:587 :208.65.144.245::35583
2013-10-11 12:39:48.621588500 CHKUSER accepted sender: from <ehip1mxb2o0kj8twj5yh0wz9nvb9wa04-b@news.columbiarestaurant.com::> remote <p02c11m083.mxlogic.net:unknown:208.65.144.245> rcpt <> : accepted any sender always
2013-10-11 12:39:48.767883500 tcpserver: end 28172 status 02013-10-11 12:39:48.767910500 tcpserver: status: 0/20
what make you think that it's
roberto puzzanghera Anonymous October 11, 2013 20:13 CET
what makes you think that it's a chkuser fault? this is not a rejection, and this is the log of port 587, but you said that you have some incoming legitimate email rejected, which should be received on port 25
It blocks legitimate emails,
Anonymous roberto puzzanghera October 11, 2013 15:03 CET
It blocks legitimate emails, it just sucks. Shouldn't be included in the net-qmail patch.
Tried commenting out of my
Anonymous roberto puzzanghera October 11, 2013 15:02 CET
Tried commenting out of my qmail/submission/run file, chkuser still running!
# cat /var/qmail/supervise/qmail-submission/run #!/bin/sh QMAILDUID=`id -u vpopmail`NOFILESGID=`id -g vpopmail`MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`SOFTLIMIT=`cat /var/qmail/control/softlimit` # You MUST export this, otherwise you'd get a 30 sec timeoutexport SMTPAUTH="" # This enables greetdelay for qmail-smtpd.export SMTPD_GREETDELAY=0 # This enables chkuserexport CHKUSER_START=NONE # This enables simscan debug#export SIMSCAN_DEBUG=2 exec /usr/local/bin/softlimit -m "$SOFTLIMIT" \ /usr/local/bin/tcpserver -v -H -R -l 0 \ -x /home/vpopmail/etc/tcp.submission.cdb -c "$MAXSMTPD" \ -u "$QMAILDUID" -g "$NOFILESGID" 0 587 \ /var/qmail/bin/qmail-smtpd \ /home/vpopmail/bin/vchkpw /bin/true 2>&1
again, this is the submission
roberto puzzanghera Anonymous October 11, 2013 20:15 CET
again, this is the submission service, which has nothing to do with incoming emails. In any case you have an error. Correct in this way
export CHKUSER_START=NONE
but be aware that this should be done on standard smtpd (port 25) service.
first of all, i think you can
roberto puzzanghera Anonymous October 10, 2013 22:33 CET
first of all, i think you can try to take a look to the chkuser manual, to see how to fit it to your needs.
If you want to disable it, just comment it in your run file (in case you are following my configuration).
If you want to delete it from my package you have to look at the original patch and see what it modifies. I remember that it modifies only qmail-smtpd.c and the Makefile, apart from new created files. You can easily recognise the modifications because there is a comment more or less like "chkuser patch starts here"
qmail-qmqpc.c change needed
Robbie Walker August 24, 2013 15:53 CET
Hi Roberto,
First, thanks for the patch collection. I ran across an issue that I thought I would make you aware of: one of the patches in this collection modifies the function signature of timeoutconn.c/timeoutconn() . I assume it's one of the TLS or AUTH patches, but I haven't tried to figure it out. In any case, the patch adds an additional parameter to the signature which is not present in the original calls to timeoutconn() in qmail-qmqpc.c
None of the patches even touch qmail-qmqpc.c ( probably because very few people make use of it) but I actually use it for SMTP servers. Crypto can put quite a load on older hardware so I "spread the wealth" around with multiple smtp servers using QMQP to send the messages to my queue machine.
In any case, the fix is pretty straightforward and I am going to try and post the patch here in this comment:
diff netqmail-1.06/qmail-qmqpc.c netqmail-1.06.patched/qmail-qmqpc.c 0a1,20 > /*** 2013-08-24 Robbie Walker > DESCRIPTION: the great collection of patches from Roberto Puzzanghera [ https://notes.sagredo.eu ] > includes changes to timeoutconn.c function signature as listed below. qmail-qmqpc.c also calls > timeoutconn and needs to be patched as well.
> > original timeoutconn() signature: > int timeoutconn(s,ip,port,timeout) > int s; > struct ip_address *ip; > unsigned int port; > int timeout; > > modifed timeoutconn() signature: > int timeoutconn(s,ip,outip,port,timeout) > int s; > struct ip_address *ip; > struct ip_address *outip; > unsigned int port; > int timeout; > */ > 104a125,126 > struct ip_address outip; > outip.d[0]=outip.d[1]=outip.d[2]=outip.d[3]=(unsigned char) 0; 112c134 < if (timeoutconn(qmqpfd,&ip,PORT_QMQP,10) != 0) { --- > if (timeoutconn(qmqpfd,&ip,&outip,PORT_QMQP,10) != 0) {
Thanks for the fix
roberto puzzanghera Robbie Walker August 24, 2013 22:37 CET
Hi Robbie, I'm going to add your fix in the next release that will be released in a few days
Thanks for the contribution :)
SPF
Nicholas July 28, 2013 15:43 CET
Hi,
I noticed that the spf is not running properly. The IP consist of 4 fs.
Received: from unknown (HELO p14g.com) (::ffff:183.240.178.142)
by 0 with SMTP; 28 Jul 2013 14:37:47 -0000
Received-SPF: unknown (0: No IP address in conversation)
Whereas my old box running on shupp toaster 0.9.4
Received: from unknown (HELO om-jetstar.rsys2.com) (12.130.139.139)
by 0 with SMTP; 26 Jul 2013 03:02:52 -0000
Received-SPF: pass (0: SPF record at envfrm.rsys2.com designates
Am i right to say that the fs infront of the IP is affecting spf?
Is there a fix or workaround?
regards
nic
Hi Nicholas,I think you are
roberto puzzanghera Nicholas July 28, 2013 16:30 CET
Hi Nicholas,
I think you are right. The SPF patch is very old (the same embedded in the shupp's combined patch) and is not compatible with IPv6. As far as I know there are no fix to this (but you can ask the author) or alternative spf patches.If you find something interersting let me know
But i am not on
Nicholas roberto puzzanghera July 29, 2013 02:54 CET
But i am not on IPv6.
regards
nic
you are not in an IPv6 net
roberto puzzanghera Nicholas July 29, 2013 10:02 CET
you are not in an IPv6 net but that address ::ffff:183.240.178.142 is IPv6, and the SPF patch is not able to recognize such an IP
Understand nowThanksnic
Nicholas roberto puzzanghera July 29, 2013 20:34 CET
Understand now
Thanks
nic
Hi Roberto,Manvendra Bhangui
Nicholas Nicholas July 31, 2013 06:55 CET
Hi Roberto,
Manvendra Bhangui from IndiMail get it fixed.
http://sourceforge.net/p/indimail/bugs/55/#ac98
http://sourceforge.net/projects/indimail/files/Patches/qmail-1.03.patch.gz/download
Is it possible to get it into your combined patches?
regards
nic
Hi Nick, Manvendra Bhangui
roberto puzzanghera Nicholas July 31, 2013 15:27 CET
Hi Nick, Manvendra Bhangui has already answered to my requests. He is kind as always and provided details to make saout's spf patch work with IPv6-mapped as well. So I modified my big patch accordingly and this is a test version:
roberto-netqmail-1.06.patch-20130731testing.gz
It is important that you have the new ucspi-tcp6 installed otherwise the filter on IPv6 clients will not work. I tested it both against the new tcpserver (ucspi-tcp6) and the original djb's ucspi-tcp-0.88 and they are both ok for IPv4 clients. Unfortunately I don't have any IPv6 net.
Test if you like and let me know :)
Hi Roberto,I also do not have
Nicholas roberto puzzanghera August 1, 2013 09:04 CET
Hi Roberto,
I also do not have IPv6, Tested the new patch and don't seem to be working
Received: from unknown (HELO bay0-omc3-s14.bay0.hotmail.com) (::ffff:65.54.190.152)
regards
nic
So, if I understand well, you
roberto puzzanghera Nicholas August 1, 2013 09:10 CET
So, if I understand well, you can't see the "Received-SPF: ...." line in the header?
Edit: Can you confirm that you are using ucspi-tcp6 or another tcpserver with IPv6 capabilities?
Roberto,Can you send me
Cprogrammer roberto puzzanghera August 4, 2013 15:04 CET
Roberto,
Can you send me qmail-smtpd.c as an attachment. Just want to check the call to spfcheck() function.
Regards Manvendra
Hi Roberto,Received-SPF:
Nicholas roberto puzzanghera August 1, 2013 09:18 CET
Hi Roberto,
Received-SPF: unknown (0: No IP address in conversation)
I am using uspi-tcp6-0.98
regards
nic
Hi NIck, I will try to ask
roberto puzzanghera Nicholas July 31, 2013 10:01 CET
Hi NIck, I will try to ask Manvendra Bhangui if he can provide more details. If he can I will certainly update my patch
The link to the download page is the big indimail patch and it's impossibile (for me) to extract the modifications he did.
Thanks for the contribution
Roberto
0 instead of the server name
Gabriel Torres roberto puzzanghera July 6, 2019 15:58 CET
Hi Roberto,
Please take a look how, in this thread, the mail server from this other user has the same issue I am discussing in another thread: the header is showing "0" instead of his server's name:
Received: from unknown (HELO p14g.com) (::ffff:183.240.178.142)
by 0 with SMTP; 28 Jul 2013 14:37:47 -0000
This shows that this issue isn't specific to my environment here.
With our previous qmail installation, our FQDN would show up correctly there.
Cheers.
0 instead of the server name
Roberto Puzzanghera Gabriel Torres July 7, 2019 11:54 CET
yes, and he reports the same bahaviour in another machine running shupp's patch, then this is not an issue of my patch's...
but let's continue the discussion in the other thread
503_MAIL_first_(#5.5.1)
Fabiano Heringer July 26, 2013 18:58 CET
Hi , i need some help, after applying his combined patch, i get many emails with this errors:
503_MAIL_first_(#5.5.1)
No mail that happen this error are delivering in my mailbox, make a lot of googleeing and nothing, could you help me?
Re: 503_MAIL_first_(#5.5.1)
roberto puzzanghera Fabiano Heringer July 26, 2013 22:01 CET
Hi Fabiano, I think this is due to improper commands entered by the client. You should enable recordio inside your smtpd run file to record the entire smtp conversation and try to find out the reason of the reject. Post here the smtp dialog if you like.
Re: 503_MAIL_first_(#5.5.1)
Sam F roberto puzzanghera November 5, 2024 12:39 CET
Did anyone find the root cause of this ?
Re: 503_MAIL_first_(#5.5.1)
Roberto Puzzanghera Sam F November 5, 2024 12:55 CET
The error msg says that the first line after the helo should be MAIL FROM. If not you'll get that error. You can have confirmation by activating recordio before qmail-smtpd, or even simulating an smtpd conversation where you start with anything that is not mail from
root@qmail:~# telnet 0 25
Trying 0.0.0.0...
Connected to 0.
Escape character is '^]'.
220 smtp.sagredo.eu ESMTP
ehlo test
250-smtp.sagredo.eu
250-STARTTLS
250-PIPELINING
250-SMTPUTF8
250-8BITMIME
250 SIZE 10000000
rcpt to:<test@test.com>
503 MAIL first (#5.5.1)
quit
221 smtp.sagredo.eu
Connection closed by foreign host.
Bounce size limitation
Nicholas July 11, 2013 06:20 CET
Hi Everyone,
Has anyone came across a patch to limit size of any type of bounce?
I had tried qmail-bounce.patch by Frank Denis. But it will only work if databytes is enabled.
Thanks
nic
SMTPAUTH
Nicholas May 4, 2013 21:31 CET
Hi after apply the patch and export auth, CRAM-MD5 is not enabled
220 my.domain.com ESMTP
ehlo
250-my.domain.com
250-STARTTLS
250-PIPELINING
250-8BITMIME
250-AUTH LOGIN PLAIN
250 SIZE 0
Do i need to export CRAM-MD5?
Thanks
Nic
cram-md5 auth
roberto puzzanghera Nicholas May 4, 2013 21:34 CET
No, take a look to README.auth for details
Hi, thank you very much for
GG April 18, 2013 15:40 CET
Hi, thank you very much for your work. I was wondering if it is possible to have a combined patch including ALL the patches above, EXCEPT for the BIG-TODO one. It is mentioned somewhere, but I couldn't find it.
Thanks again!
it should be quite simple to
roberto puzzanghera GG April 18, 2013 15:56 CET
it should be quite simple to reverse that patch, but for me it's already very time consuming to follow one single patch, so I can't fullfil all requests for changes. anyway I'm always available as advisor :)
Just want to say thank you
Anonymous April 7, 2013 12:23 CET
Just wanted to say thank you for pulling this all together in one page. It has been very helpful have a single source location to get what I needed for qmail, your hard work is appreciated!
IPv6 support?
Jacekalex March 19, 2012 17:06 CET
Is this version netqmail, with your patch supports IPv6?
I mean SPF, setting RELAYCIENT and other variables.
I found a patch for IPv6 netqmail-1.06:
But when I tried to put it on the source of your patch, came out a lot of mistakes, which can not cope.
On my server a few weeks, turn on the full support of IPv6, I also found a patch to patch the IPv6 tcpserwer:
http://www.brandonturner.net/blog/2009/08/qmail-ipv6-tcpserver/
It remains to Spamdyke, but that's my problem;)
Cheers;)
No, my combined patch doesn't support IPv6
roberto puzzanghera Jacekalex March 19, 2012 17:22 CET
No, my combined patch doesn't support IPv6. Unfortunately I don't have any IPv6 network to test the patches that are around.
cheers :)
Forcetls
Jacekalex roberto puzzanghera March 20, 2012 04:40 CET
Hi
I improved a little patch Forcetls to Qmail did not propose an authorization when it is not possible, due to lack of TLS encryption:
http://pastebin.com/N4zBQZUu#
Still I would like to improve the correct fragment responsible for:
538 auth not available without TLS (# 5.3.3) Connection closed by foreign host.
To properly closed the connection, such as MUSTAUTH, or SPFFAIL
-> QUIT <- 221 example.com === Connection closed with remote host.
But I have no idea how to do it .
Cheers ;)
If my understanding
roberto puzzanghera Jacekalex March 20, 2012 10:38 CET
If my understanding of you code is correct, you want to allow the auth with CRAM_MD5 when STARTTLS is not provided. So it's not clear to me why you want to close the door once you decided that it's a user's responsibity to secure the connection with TLS
538 auth not available without TLS (# 5.3.3) Connection closed by foreign host.
In my opinion it would be a responsibility of the postmaster to forcetls. If not, you may want to rename the "forcetls" label of this patch with something like "skiptls" :)
HI "If my understanding of
Jacekalex roberto puzzanghera March 20, 2012 11:40 CET
HI "If my understanding of you code is correct, you want to allow the auth with CRAM_MD5 when the user does not provide STARTTLS
No, :it's not at all with CRAM-MD5:
swaks -f user@example.com -t postmaster@example.com -s example.com --p 587 -au user@example.com -ap password === Trying example.com:587... === Connected to example.com. <- 220 example.com ESMTP -> EHLO localhost.localdomain <- 250-wampir7.pl <- 250-STARTTLS <- 250-PIPELINING <- 250-8BITMIME <- 250-SIZE 67108864 <- 250 X Authorization requires an encrypted SSL or TLS connection *** Host did not advertise authentication -> QUIT <- 221 example.com === Connection closed with remote host.
My goal was that the server did not provide authentication, authorization when it is not possible due to lack of TLS encryption:
While the offer, when encryption is enabled:
Like this:
swaks -f user@example.com -t postmaster@example.com -s example.com --p 587 -au user@example.com -ap q --tls === Trying example.com:587... === Connected to example.com. <- 220 example.com ESMTP -> EHLO localhost.localdomain <- 250-example.com <- 250-STARTTLS <- 250-PIPELINING <- 250-8BITMIME <- 250-SIZE 67108864 <- 250 X Authorization requires an encrypted SSL or TLS connection -> STARTTLS <- 220 ready for tls === TLS started w/ cipher DHE-RSA-AES256-SHA === TLS peer subject DN="/C=IT/ST=PL/L=TestO=Test/OU=IMAP server/CN=example.com/emailAddress=postmaster@example.com" ~> EHLO localhost.localdomain <~ 250-example.com <~ 250-PIPELINING <~ 250-8BITMIME <~ 250-SIZE 67108864 <~ 250 AUTH LOGIN PLAIN CRAM-MD5 ~> AUTH CRAM-MD5 <~ 334 PDMyNjAwLjEzMzIyNDI3NjhAMD4= ~> dXNlckBleGFtcGxlLmNvbSAwMzFlYjgwNTE4OTcyODgwZWRlOWU5M2U1ZThhZDJjYw== <~ 235 ok, go ahead (#2.0.0) ~> MAIL FROM:<user@example.com> <~ 250 ok ~> RCPT TO:<postmaster@exammple.com> <~ 250 ok ~> DATA <~ 354 go ahead ~> Date: Tue, 20 Mar 2012 12:26:08 +0100 ~> To: postmaster@exammple.com ~> From: user@example.com ~> Subject: test Tue, 20 Mar 2012 12:26:08 +0100 ~> X-Mailer: swaks v20111230.0 jetmore.org/john/code/swaks/ ~> ~> This is a test mailing ~> ~> . <~ 250 ok 1332242769 qp 32604 ~> QUIT <~ 221 example.com === Connection closed with remote host.
That was my reservation it immediately, and disconnect the test without TLS authentication constitute circumvention of the problem, but it only partially solved.
Here, not about the CRAM-MD5, but here is that the server did not provide authorization for no reason that can not be held, and that in connection with any mail client that does not try to send the password without encryption.
Made sure that the CRAM-MD5 was exclusive, as before. ;)
I meant it to be solved better than Gmail. :D
Cheers ;)
I'm sorry but I'm not sure
roberto puzzanghera Jacekalex March 20, 2012 13:51 CET
I'm sorry but I'm not sure I have understood what you say towards the end of your message..
Anyway, are the tests you provide made using my patch or your modified one?
My goal was that the server did not provide authentication, authorization when it is not possible due to lack of TLS encryption:
This is exactly what my forcetls patch does, right?
Hi This is exactly what my
Jacekalex roberto puzzanghera March 20, 2012 14:39 CET
Hi
This is exactly what my forcetls patch does, right?
Exactly the point, I had to just to authorization was not offered when it is unrealistic due to lack of TLS.
This is to avoid situations where someone set the example in Outlook autoryzaj? PLAIN, then this Outlok trying to log in, and the error log.
I prefer a system where the server does not offer authorization (AUTH), if it can not be done, just like in Gmail
Cheers ;)


qmail-remoteauthentication on remote servers can select the auth method even when the first method advertised by the remote server is not available locally.