I'm trying to get sendmail to receive email for any username at my domain. When mail is sent to the email address matching the owning username, e.g., intermark@intermarconcepts.com, the mail is delivered successfully. However, mail sent to any other address bounces, e.g., info@intermarconcepts.com.
/etc/mail/local-host-names contains
/etc/mail/virtusertable contains
/etc/mail/Dreamer.mc contains
Over the past two weeks, I've built and rebuilt Sendmail countless times. I got
I'm at a loss here: Why isn't sendmail reading the virtusertable database?
Someone asked me "Why is this taking so long?" All I could say is "Because of incomplete, conflicting, obsolete and erroneous documentation that's spread out all over the Web instead of being collected in a localized resource center." I was trying to keep notes so I'd be able to do this again with less pain the next time around, but there have been too many setbacks, diversions and restarts, and I lost track along the way ....
sendmail -bv intermark@intermarconcepts.com
returns
Code:
intermark@intermarconcepts.com... deliverable: mailer local, user intermark
sendmail -bv info@intermarconcepts.com
returns
Code:
info@intermarconcepts.com... User unknown
sendmail -d0.1 -bt < /dev/null
returns
Code:
Version 8.15.2
Compiled with: DNSMAP IPV6_FULL LOG MAP_REGEX MATCHGECOS MILTER
MIME7TO8 MIME8TO7 NAMED_BIND NETINET NETINET6 NETUNIX NEWDB
PIPELINING SASLv2 SCANF STARTTLS TCPWRAPPERS USERDB XDEBUG
============ SYSTEM IDENTITY (after readcf) ============
(short domain name) $w = Dreamer
(canonical domain name) $j = Dreamer.FKEinternet.com.
(subdomain name) $m = FKEinternet.com.
(node name) $k = Dreamer.FKEinternet.com.
========================================================
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
Code:
fkeinternet.com
fkeinternet.net
intermarconcepts.com
Code:
# Map one or all usernames at a source hostname to a specific (or the same)
# username at another target hostname. Remember to add the source hostname
# to /etc/mail/local-host-names so that sendmail will accept mail for the
# source hostname.
#
@100.0.193.98 fkeinternet+%1
@100.0.193.99 fkeinternet+%1
@100.0.193.100 fkeinternet+%1
@100.0.193.101 fkeinternet+%1
@100.0.193.102 fkeinternet+%1
@fkeinternet.com fkeinternet+%1
@fkeinternet.net fkeinternet+%1
@intermarconcepts.com intermark
makemap -u hash virtusertable.db
returns
Code:
@100.0.193.99 fkeinternet+%1
@100.0.193.101 fkeinternet+%1
@fkeinternet.com fkeinternet+%1
@fkeinternet.net fkeinternet+%1
@intermarconcepts.com intermark
@100.0.193.98 fkeinternet+%1
@100.0.193.100 fkeinternet+%1
@100.0.193.102 fkeinternet+%1
uname -a
returns
Code:
FreeBSD Dreamer.FKEinternet.com. 10.2-RELEASE FreeBSD 10.2-RELEASE #0: Mon Oct 5 23:53:36 EDT 2015 root@Dreamer.FKEinternet.com.:/usr/obj/usr/src/sys/GENERIC amd64
Code:
divert(-1)
# The best documentation for this .mc file is:
# /usr/share/sendmail/cf/README or
# /usr/src/contrib/sendmail/cf/README
divert(0)
VERSIONID(`$ /etc/mail/Dreamer.mc,v 0.0.12 2016/01/11 22:58 wfredk $')
OSTYPE(freebsd6)
DOMAIN(generic)
define(`confLOG_LEVEL', 18)
define(`confEBINDIR', `/usr/local/libexec')dnl
define(`UUCP_MAILER_PATH', `/usr/local/bin/uux')dnl
dnl The group needs to be mail in order to read the sasldb2 file
define(`confRUN_AS_USER',`root:mail')dnl
LOCAL_DOMAIN(`localhost Dreamer mail ftp www secure ns1 ns2')
FEATURE(access_db, `hash -T<TMPF> -o /etc/mail/access.db')
dnl FEATURE(access_db)dnl
FEATURE(blacklist_recipients)
dnl FEATURE(local_lmtp)
FEATURE(mailertable, `hash -o /etc/mail/mailertable.db')
FEATURE(relay_based_on_MX)
FEATURE(relay_entire_domain)
dnl FEATURE(virtusertable)
FEATURE(virtusertable, `-v hash /etc/mail/virtusertable.db')
FEATURE(local_procmail)
FEATURE(delay_checks)
dnl Settings for SMTP AUTH as client and server
define(`confAUTH_MECHANISMS',`LOGIN PLAIN')
dnl Allow authenticated users relay access
dnl TRUST_AUTH_MECH(`PLAIN LOGIN')dnl
dnl Offer SMTP AUTH only after encryption (STARTTLS) has been negotiated
define(`confAUTH_OPTIONS',`p,y')dnl
dnl Don't ask for client cert(s)
define(`confTLS_SRV_OPTIONS', `V')
define(`CERT_DIR', `/etc/mail/certs')dnl
define(`confCACERT_PATH', `CERT_DIR')dnl
define(`confCACERT', `CERT_DIR/FKE-ca.crt')dnl
define(`confSERVER_CERT', `CERT_DIR/mail-cert.pem')dnl
define(`confSERVER_KEY', `CERT_DIR/mail-key.pem')dnl
define(`confCRL', `CERT_DIR/revoke.crl')dnl
define(`confCLIENT_CERT', `CERT_DIR/mail-cert.pem')dnl
define(`confCLIENT_KEY', `CERT_DIR/mail-key.pem')dnl
DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl
dnl Offer STARTTLS at session beginning for smtps (M=s)
DAEMON_OPTIONS(`Port=smtps, Name=TLSMTA, M=s')dnl
dnl set SASL options
dnl TRUST_AUTH_MECH(`GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN')dnl
dnl define(`confAUTH_MECHANISMS', `GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN')dnl
TRUST_AUTH_MECH(`GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
dnl TRUST_AUTH_MECH(`DIGEST-MD5 CRAM-MD5')dnl
dnl define(`confAUTH_MECHANISMS',`DIGEST-MD5 CRAM-MD5')dnl
define(`confDEF_AUTH_INFO', `/etc/mail/auth-info')dnl
define(`confDONT_BLAME_SENDMAIL',`GroupReadableSASLDBFile')dnl
dnl Dialup users should uncomment and define this appropriately
dnl define(`SMART_HOST', `your.isp.mail.server')
dnl Uncomment the first line to change the location of the default
dnl /etc/mail/local-host-names and comment out the second line.
dnl define(`confCW_FILE', `-o /etc/mail/sendmail.cw')
define(`confCW_FILE', `-o /etc/mail/local-host-names')
dnl Uncomment both of the following lines to listen on IPv6 as well as IPv4
dnl DAEMON_OPTIONS(`Name=IPv4, Family=inet')
dnl DAEMON_OPTIONS(`Name=IPv6, Family=inet6')
define(`confMAX_MIME_HEADER_LENGTH', `256/128')
dnl define(`confNO_RCPT_ACTION', `add-to-undisclosed')
define(`confPRIVACY_FLAGS', `goaway')
FEATURE(`nouucp', `reject')
# List of IP addresses we allow relaying from.
Klocalip hash -a<MATCH> /etc/mail/localip
Kpopip hash -a<MATCH> /etc/mail/popip.db
dnl Kpopip btree -a<MATCH> /etc/mail/dracd
dnl Kpopip btree -a<MATCH> /etc/mail/popip
# dynamic relay authorization control map
Kdrac btree -o /usr/local/etc/dracd
LOCAL_RULESETS
SLocal_check_rcpt
# allow recent POP/IMAP mail clients to relay
R$* $: $&{client_addr}
R$+ $: $(drac $1 $: ? $)
R? $@ ?
R$+ $@ $#OK
# Put the address into cannonical form (even if it doesn't resolve to an MX).
R$* $: $>Parse0 $>3 $1
R$* < $* > $* $: $1 < $2 . > $3 Pretend it's canonical.
R$* < $* . . > $* $1 < $2 . > $3 Remove extra dots.
# Allow relaying if the connected host is a local IP address.
R$* $: < $&{client_addr} > Get client IP address.
R<> $#OK Local is ok.
R< $* . $- > $* $(localip $1.$2 $: < $1 > . $2 $) Check last three octets.
R$* < MATCH > $#OK
R< $- > $* $: $(localip $1 $: < > $1 $2 $) Check first octet.
R$* < MATCH > $#OK
# Allow relaying if the connected host has recently POP3 authenticated.
R$* $: < $&{client_addr} > Get client IP address.
R< $* > $(popip $1 $) Check full address.
R$* < MATCH > $#OK
# IP address didn't match.
define(`confBIND_OPTS', `WorkAroundBrokenAAAA')
dnl define(`confNO_RCPT_ACTION', `add-to-undisclosed')
define(`confPRIVACY_FLAGS', `authwarnings,noexpn,novrfy')
MAILER(local)
MAILER(smtp)
Over the past two weeks, I've built and rebuilt Sendmail countless times. I got
poprelayd
working to support POP-before-SMTP, and rewrote its rc.d script so it works correctly to start, stop and report the status of the service. I got drac
installed and working (which probably means I don't need poprelayd
, but I don't think it's hurting). I adapted the Secure SMTP and POP access on FreeBSD instructions at http://www.hydrus.org.uk/journal/secure-mail.html and got Qpopper configured for TLS. I read chapter 27.9. SMTP Authentication of the Handbook at https://www.freebsd.org/doc/handbook/SMTP-Auth.html to try to get STARTTLS working but had to follow a bunch of other pages to actually make it work because that page is quite outdated now. I also found that sendmail.org has been taken over by Proofpoint, Inc., and there's no documentation newer than 8.13 (at best) - and there likely isn't going to be any newer documentation from sendmail, ever. (100% of the links that I tried on their "Useful Links" page at http://www.sendmail.com/sm/open_source/docs/links/ failed, and it wasn't hard to find pages that haven't been updated since 1997.) Now I've got a system where I can telnet
in to the mail server and manually send mail, and Thunderbird can retrieve mail from the intermark@intermarconcepts.com mailbox, but it can't send mail, and mail sent to any of the user accounts in the domain bounces.I'm at a loss here: Why isn't sendmail reading the virtusertable database?
Someone asked me "Why is this taking so long?" All I could say is "Because of incomplete, conflicting, obsolete and erroneous documentation that's spread out all over the Web instead of being collected in a localized resource center." I was trying to keep notes so I'd be able to do this again with less pain the next time around, but there have been too many setbacks, diversions and restarts, and I lost track along the way ....