Bug#989169: sendmail: 'User unknown' while running 'makemap' on virtual-domains
Package: sendmail
Version: 8.15.2-14~deb10u1
Severity: normal
Dear Maintainer,
I noticed that we have mail bouncing exactly the same second we are running 'makemap'
on the virtual-domains database.
I am able to reproduce this by running the following bash-loop (with a real username of
course);
>username.log
while true ; do
echo $(date +%H:%m:%S.%N; sendmail -bv username@arcada.fi) >> username.log
done
And at the same time I use the following command to rebuild the virtual-domains
database;
/usr/sbin/makemap hash /etc/mail/virtual-domains.db < /etc/mail/virtual-domains
( Yes, I know that Debian has a Makefile for this that does it via renaming, but
bear with me).
I get the following unexpected output;
<clip>
14:05:55.057025244 username@arcada.fi... deliverable: mailer esmtp, host ourinstant.onmicrosoft.com., user username@arcadauas.onmicrosoft.com
14:05:55.073265573 username@arcada.fi... deliverable: mailer esmtp, host ourinstant.onmicrosoft.com., user username@arcadauas.onmicrosoft.com
14:05:55.095313475 username@arcada.fi... deliverable: mailer esmtp, host ourinstant.onmicrosoft.com., user username@arcadauas.onmicrosoft.com
14:05:55.115518841 username@arcada.fi... deliverable: mailer esmtp, host ourinstant.onmicrosoft.com., user username@arcadauas.onmicrosoft.com
14:05:55.133942140 username@arcada.fi... deliverable: mailer esmtp, host ourinstant.onmicrosoft.com., user username@arcadauas.onmicrosoft.com
14:05:55.155289570 username@arcada.fi... deliverable: mailer esmtp, host ourinstant.onmicrosoft.com., user username@arcadauas.onmicrosoft.com
14:05:55.176463893 username@arcada.fi... deliverable: mailer esmtp, host ourinstant.onmicrosoft.com., user username@arcadauas.onmicrosoft.com
14:05:55.198450748 username@arcada.fi... User unknown
14:05:55.220447541 username@arcada.fi... User unknown
14:05:55.239004722 username@arcada.fi... deliverable: mailer esmtp, host ourinstant.onmicrosoft.com., user username@arcadauas.onmicrosoft.com
14:05:55.261296350 username@arcada.fi... deliverable: mailer esmtp, host ourinstant.onmicrosoft.com., user username@arcadauas.onmicrosoft.com
14:05:55.279081285 username@arcada.fi... deliverable: mailer esmtp, host ourinstant.onmicrosoft.com., user username@arcadauas.onmicrosoft.com
14:05:55.299622297 username@arcada.fi... deliverable: mailer esmtp, host ourinstant.onmicrosoft.com., user username@arcadauas.onmicrosoft.com
14:05:55.317871857 username@arcada.fi... deliverable: mailer esmtp, host ourinstant.onmicrosoft.com., user username@arcadauas.onmicrosoft.com
<clip>
As You can see, something happens that causes sendmail to say "User unknown" for a
few split seconds. This causes e-mail to bounce as well in real-world.
I was able circumvent this by doing the rebuild like this;
/usr/sbin/makemap hash /etc/mail/virtual-domains.new.db < /etc/mail/virtual-domains
mv -f /etc/mail/virtual-domains.new.db /etc/mail/virtual-domains.db
This is not how the sendmail documentation suggests I should do it though. According
to Claus Aßmann this would suggest a problem with fcntl().
I got the testlk.c from nfs-utils and rand that on the database, and at least in that
simple test-case fcntl() seems to work.
# ./testlk /etc/mail/virtual-domains
fcntl: ok
^C
I was expecting the suggested makemap-command to work without causing a "User unknown".
Octa core AMD FX 8120, 16 GB ECC RAM, SSD-drives.
The file /etc/mail/virtual-domains is around 8000 lines.
I don't see this problem with the access or domaintable databases.
-- Package-specific info:
Output of /usr/share/bug/sendmail/script:
ls -alR /etc/mail:
/etc/mail:
total 2920
drwxr-sr-x 12 smmta smmsp 4096 May 27 13:30 .
drwxr-xr-x 128 root root 12288 May 27 14:11 ..
-rwxr-xr-- 1 root smmsp 12391 Dec 10 19:26 Makefile
-rw-r--r-- 1 root smmsp 270319 May 27 13:30 access
-rw-r----- 1 smmta smmsp 659456 May 27 13:30 access.db
-rw-r--r-- 1 root root 3093 Jun 4 2020 access.default
-rw-r--r-- 1 root root 281 Sep 21 2010 address.resolve
drwxr-xr-x 8 root root 4096 May 27 06:01 aliases
-rw-r--r-- 1 root root 4163 May 27 06:01 aliases.txt
-rw-r--r-- 1 smmta smmsp 12288 May 27 06:01 aliases.txt.db
-rw-r--r-- 1 root root 4163 May 26 06:01 aliases.txt.old
-rwxr-xr-x 1 root smmsp 352 Mar 7 2012 check-virtdomain.sh
-rwxr-xr-x 1 root smmsp 654 Mar 7 2012 check.sh
-rwxr-xr-x 1 root smmsp 893 Mar 7 2012 check2.sh
-rw-r--r-- 1 root root 3579 Dec 10 19:26 databases
-rw-r----- 1 smmta smmsp 53 Mar 7 2012 default-auth-info
-rw-r--r-- 1 root smmsp 424 Dec 11 10:35 dh2048.pem
-rw-r--r-- 1 root smmsp 0 Mar 7 2012 domaintable
-rw-r----- 1 smmta smmsp 12288 May 27 13:30 domaintable.db
-rw-r--r-- 1 root root 5659 Dec 8 2016 helpfile
-rw-r--r-- 1 root smmsp 1408 Feb 26 15:00 local-host-names
drwxr-sr-x 2 smmta smmsp 4096 May 5 17:12 m4
-rw-r--r-- 1 root smmsp 12933 Dec 11 11:47 mimedefang-filter
-rw-r--r-- 1 root root 276 Nov 14 2018 mimedefang.pl.conf
drwxr-xr-x 2 root root 4096 Dec 10 19:21 peers
-rw-r--r-- 1 root smmsp 121 Sep 20 2016 relay-domains
-rw-r--r-- 1 root root 2730 Nov 14 2018 sa-mimedefang.cf
-rw-r--r-- 1 root root 2730 Jun 23 2010 sa-mimedefang.cf.dist
drwxr-xr-x 2 smmta smmsp 4096 Mar 7 2012 sasl
-rw-r--r-- 1 root smmsp 62186 Mar 6 19:31 sendmail.cf
-rw-r--r-- 1 root smmsp 64473 Mar 7 2012 sendmail.cf.dist
-rw-r--r-- 1 root root 67708 Dec 10 19:26 sendmail.cf.old
-rw-r--r-- 1 root root 12239 Dec 10 19:26 sendmail.conf
-rw-r--r-- 1 root smmsp 5458 Dec 10 19:26 sendmail.mc
-rw-r--r-- 1 root smmsp 4223 Mar 7 2012 sendmail.mc.dist
-rw-r--r-- 1 root root 148 Aug 25 2019 service.switch
-rw-r--r-- 1 root root 179 Aug 25 2019 service.switch-nodns
drwxr-sr-x 2 smmta smmsp 4096 Mar 7 2012 smrsh
lrwxrwxrwx 1 root root 15 Mar 7 2012 spamassassin -> ../spamassassin
-rw-r--r-- 1 root smmsp 41144 Dec 10 20:04 submit.cf
-rw-r--r-- 1 root smmsp 43997 Mar 7 2012 submit.cf.dist
-rw-r--r-- 1 root root 42062 Dec 10 19:26 submit.cf.old
-rw-r--r-- 1 root smmsp 990 Dec 10 20:04 submit.mc
-rw-r--r-- 1 root smmsp 2376 Mar 7 2012 submit.mc.dist
drwxr-xr-x 2 smmta smmsp 4096 Mar 7 2012 tls
-rw-r--r-- 1 root smmsp 27 Mar 7 2012 trusted-users
-rw-r--r-- 1 root root 441734 May 27 13:30 virtual-domains
drwxr-xr-x 2 root root 4096 Apr 28 10:43 virtual-domains.d
drwxr-xr-x 2 root root 4096 Mar 3 2020 virtual-domains.d.old
-rw-r----- 1 smmta smmsp 659456 May 27 14:15 virtual-domains.db
-rw-r----- 1 smmta smmsp 659456 May 24 14:35 virtual-domains.db.new.db
-rw-r--r-- 1 root root 4243 Oct 14 2019 virtual-domains.txt
/etc/mail/aliases:
<clip>
/etc/mail/m4:
total 12
drwxr-sr-x 2 smmta smmsp 4096 May 5 17:12 .
drwxr-sr-x 12 smmta smmsp 4096 May 27 13:30 ..
-rw-r--r-- 1 root root 790 Jan 27 2018 clamav-milter.m4
-rw-r----- 1 root smmsp 0 Mar 7 2012 dialup.m4
-rw-r----- 1 root smmsp 0 Mar 7 2012 provider.m4
/etc/mail/peers:
total 12
drwxr-xr-x 2 root root 4096 Dec 10 19:21 .
drwxr-sr-x 12 smmta smmsp 4096 May 27 13:30 ..
-rw-r--r-- 1 root root 328 Sep 21 2010 provider
/etc/mail/sasl:
total 16
drwxr-xr-x 2 smmta smmsp 4096 Mar 7 2012 .
drwxr-sr-x 12 smmta smmsp 4096 May 27 13:30 ..
-rw-r----- 1 smmta smmsp 885 Mar 7 2012 Sendmail.conf.2
-rwxr--r-- 1 root root 3671 Dec 10 19:26 sasl.m4
/etc/mail/smrsh:
total 8
drwxr-sr-x 2 smmta smmsp 4096 Mar 7 2012 .
drwxr-sr-x 12 smmta smmsp 4096 May 27 13:30 ..
lrwxrwxrwx 1 root smmsp 26 Mar 7 2012 mail.local -> /usr/lib/sm.bin/mail.local
lrwxrwxrwx 1 root smmsp 17 Mar 7 2012 procmail -> /usr/bin/procmail
/etc/mail/tls:
total 48
drwxr-xr-x 2 smmta smmsp 4096 Mar 7 2012 .
drwxr-sr-x 12 smmta smmsp 4096 May 27 13:30 ..
-rw-r--r-- 1 root root 7 Mar 7 2012 no_prompt
-rw------- 1 root root 1191 Mar 7 2012 sendmail-client.cfg
-rw-r--r-- 1 root smmsp 1257 Mar 7 2012 sendmail-client.crt
-rw------- 1 root root 1029 Mar 7 2012 sendmail-client.csr
-rw-r----- 1 root smmsp 1679 Mar 7 2012 sendmail-common.key
-rw-r----- 1 root smmsp 1582 Mar 7 2012 sendmail-common.prm
-rw------- 1 root root 1191 Mar 7 2012 sendmail-server.cfg
-rw-r--r-- 1 root smmsp 1257 Mar 7 2012 sendmail-server.crt
-rw------- 1 root root 1029 Mar 7 2012 sendmail-server.csr
-rwxr--r-- 1 root root 3278 Dec 10 19:26 starttls.m4
/etc/mail/virtual-domains.d:
total 124
drwxr-xr-x 2 root root 4096 Apr 28 10:43 .
drwxr-sr-x 12 smmta smmsp 4096 May 27 13:30 ..
<clip>
sendmail.conf:
DAEMON_NETMODE="Static";
DAEMON_NETIF="eth0";
DAEMON_MODE="Daemon";
DAEMON_PARMS="";
DAEMON_HOSTSTATS="Yes";
DAEMON_MAILSTATS="Yes";
QUEUE_MODE="${DAEMON_MODE}";
QUEUE_INTERVAL="10m";
QUEUE_PARMS="";
MSP_MODE="Daemon";
MSP_INTERVAL="20m";
MSP_PARMS="";
MSP_MAILSTATS="${DAEMON_MAILSTATS}";
MISC_PARMS="";
CRON_MAILTO="root";
CRON_PARMS="";
LOG_CMDS="No";
HANDS_OFF="No";
AGE_DATA="";
DAEMON_RUNASUSER="No";
DAEMON_STATS="${DAEMON_MAILSTATS}";
MSP_STATS="${MSP_MAILSTATS}";
sendmail.mc:
define(`_USE_ETC_MAIL_')dnl
include(`/usr/share/sendmail/cf/m4/cf.m4')dnl
VERSIONID(`linux for smtp-only setup')dnl
OSTYPE(debian)dnl
DOMAIN(`debian-mta')dnl
FEATURE(`nouucp', `reject')dnl
FEATURE(always_add_domain)dnl
FEATURE(`access_db',`hash -T<TMPF> /etc/mail/access')dnl
FEATURE(`enhdnsbl', `bl.spamcop.net', `"Spam blocked see: http://spamcop.net/bl.shtml?"$&{client_addr}')dnl
FEATURE(`dnsbl',`dul.dnsbl.sorbs.net',`"554 Rejected " $&{client_addr} " found in dul.dnsbl.sorbs.net"')dnl
FEATURE(`dnsbl',`bhyhticpsm.zen.dq.spamhaus.net')dnl
FEATURE(`delay_checks')dnl
FEATURE(`virtusertable', `hash /etc/mail/virtual-domains')dnl
define(`confMSP_QUEUE_DIR', ``/var/spool/mqueue-client'')dnl
define(`QUEUE_DIR', ``/var/spool/mqueue'')dnl
FEATURE(`nocanonify')dnl
FEATURE(use_cw_file)dnl
FEATURE(`domaintable')dnl
FEATURE(`blacklist_recipients')dnl
FEATURE(`no_default_msa')dnl
FEATURE(`greet_pause', `2000') dnl 2 seconds
MAILER(local)dnl
MAILER(smtp)dnl
define(`confPRIVACY_FLAGS', ``authwarnings,needexpnhelo'')dnl
define(`confMAX_MESSAGE_SIZE', ``5000000'')dnl
define(`confMAX_DAEMON_CHILDREN', ``480'')dnl
define(`confCONNECTION_RATE_THROTTLE', ``64'')dnl
define(`confREFUSE_LA', ``96'')dnl
define(`confDELAY_LA', ``10'')dnl
define(`confERROR_MESSAGE', ``/etc/mail/sendmail.errors'')dnl
define(`confTRUSTED_USERS', ``majordomo'')dnl
define(`ALIAS_FILE',`/etc/mail/aliases.txt,/home/majordomo/etc/aliases')dnl
define(`confREJECT_MSG', ``550 BOOOOO, postmaster is going to come after you!! Sod off!!'')dnl
define(`confCACERT_PATH', `/etc/ssl/certs/')dnl
define(`confCACERT', `/etc/ssl/certs/DigiCertCA.crt')dnl
define(`confSERVER_CERT', `/etc/ssl/certs/inet-server.arcada.fi-cert.pem')dnl
define(`confSERVER_KEY', `/etc/ssl/private/inet-server.arcada.fi-key.pem')dnl
define(`confTO_IDENT', `0s')dnl
define(`confDOUBLE_BOUNCE_ADDRESS', `postmaster+doublebounce@aa.fi')dnl
INPUT_MAIL_FILTER(`clmilter', `S=local:/var/run/clamav/clamav-milter.ctl, F=, T=S:4m;R:4m')dnl
INPUT_MAIL_FILTER(`mimedefang', `S=unix:/var/spool/MIMEDefang/mimedefang.sock, F=T, T=S:360s;R:360s;E:15m')dnl
INPUT_MAIL_FILTER(`spfmilter', `S=unix:/var/run/spf-milter-python/spfmiltersock')dnl
define(`confAUTH_OPTIONS', `A p y')dnl
define(`confAUTH_MECHANISMS', `LOGIN PLAIN DIGEST-MD5 CRAM-MD5')dnl
TRUST_AUTH_MECH(`LOGIN PLAIN DIGEST-MD5 CRAM-MD5')dnl
DAEMON_OPTIONS(`Port=smtp, Name=MTA, Family=inet6')dnl
DAEMON_OPTIONS(`Port=smtps, Name=MSA-SSL, M=s')dnl
submit.mc...
divert(-1)
include(`/usr/share/sendmail/cf/m4/cf.m4')
divert(0)dnl
VERSIONID(`$Id: submit.mc,v 8.6 2002/03/26 03:30:58 ca Exp $')
define(`confCF_VERSION', `Submit')dnl
define(`__OSTYPE__',`')dnl dirty hack to keep proto.m4 from complaining
define(`_USE_DECNET_SYNTAX_', `1')dnl support DECnet
define(`confTIME_ZONE', `USE_TZ')dnl
define(`confQUEUE_DIR', ``/var/spool/mqueue'')dnl
define(`confMSP_QUEUE_DIR', ``/var/spool/mqueue-client'')dnl
FEATURE(`msp')dnl
define(`confPID_FILE', `/var/run/sendmail/msp/sendmail.pid')dnl
-- System Information:
Debian Release: 10.9
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 4.19.0-14-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.utf8 (charmap=UTF-8), LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages sendmail depends on:
ii sendmail-base 8.15.2-14~deb10u1
ii sendmail-bin 8.15.2-14~deb10u1
ii sendmail-cf 8.15.2-14~deb10u1
ii sensible-mda 8.15.2-14~deb10u1
sendmail recommends no packages.
Versions of packages sendmail suggests:
pn rmail <none>
ii sendmail-doc 8.15.2-14~deb10u1
Versions of packages sensible-mda depends on:
ii libc6 2.28-10
ii procmail 3.22-26
ii sendmail-bin [mail-transport-agent] 8.15.2-14~deb10u1
Versions of packages libmilter1.0.1 depends on:
ii libc6 2.28-10
Versions of packages sendmail-bin depends on:
ii debconf 1.5.71
ii libc6 2.28-10
ii libdb5.3 5.3.28+dfsg1-0.5
ii libldap-2.4-2 2.4.47+dfsg-3+deb10u6
ii liblockfile1 1.14-1.1
ii libsasl2-2 2.1.27+dfsg-1+deb10u1
ii libssl1.1 1.1.1d-0+deb10u6
ii libwrap0 7.6.q-28
ii lsb-base 10.2019051400
ii procps 2:3.3.15-2
ii sendmail-base 8.15.2-14~deb10u1
ii sendmail-cf 8.15.2-14~deb10u1
Versions of packages sendmail-bin suggests:
ii libsasl2-modules 2.1.27+dfsg-1+deb10u1
ii openssl 1.1.1d-0+deb10u6
ii sasl2-bin 2.1.27+dfsg-1+deb10u1
ii sendmail-doc 8.15.2-14~deb10u1
-- no debconf information
Reply to: