CHECKSENDMAIL(8)

πŸ’– CHECKSENDMAIL πŸ’– β€” that's section 8 of the System Manager's Manual, bestie

okay so before we even start: this is checksendmail, and it lives in the system manager's manual (section 8, the big-kid admin section, periodt).


✨ NAME ✨

checksendmail β€” verify sendmail address transformations πŸ’Œ


🌸 SYNOPSIS 🌸

checksendmail [-a] [-d] [-b] [-C file.cf] [-b sendmail_binary]
              [-l log_file] [-r resolve] [-T test.address]

πŸ¦‹ DESCRIPTION πŸ¦‹

So checksendmail is a perl script, and what it does is it helps you test out all the various configuration files that sendmail(8) uses. It literally just takes typical addresses (the ones you put in your input files) and passes them through sendmail, then prints out the results of the resolution and transformation routines. It's giving ✨quality assurance✨.

Your input files are just a list of addresses, one per line. Like, for example:

user
user@site
user@site.com

And yes bestie, the input file can also have comments β€” those start with a # β€” plus blank lines. Go off. πŸ’…


πŸ’… OPTIONS πŸ’…

  • -a β€” show aliasing of local addresses in the mail address resolution phase of testing πŸ‘€
  • -d β€” precede each address translation line with a ruleset sequence summary 🧾
  • -C file.cf β€” use the sendmail configuration file file.cf instead of the default /etc/sendmail.cf file πŸ”§
  • -b sendmail_binary β€” use the specified sendmail_binary as the path to invoke sendmail (instead of /usr/sbin/sendmail) πŸ› οΈ
  • -l log_file β€” log sendmail address test mode debugging output to log_file πŸ“
  • -r resolve β€” use resolve as the input file for the addresses to be used for mail resolving. Defaults to address.resolve πŸ“‚
  • -T test.address β€” use test.address as the single address to test. Cannot be used in conjunction with file setting flags. 🚫

🌈 EXAMPLES 🌈

okay so this command right here is gonna pass the addresses in address.resolve through sendmail using the config info from myconfig.cf. slay:

example% cat address.resolve
user
user@site
user@site.com

example% checksendmail -C myconfig.cf
system: myhost.gadget.com               current dir: /tmp/Checksendmail
resolve file: address.resolve
sendmail binary: /usr/sbin/sendmail     sendmail version: 8.9.3
config file: /etc/sendmail.cf           config file version: V8/Berkeley

Mail address resolution
user                        --(ether )-->  user[rmtc]
user@site                   --(ether )-->  user@site[rmtc]
user@site.com               --(ether )-->  user@site.com[rmtc]

`To' address transformations for mailer ether:
user                        ---->  user
user@site                   ---->  user@site
user@site.com               ---->  user@site.com

`From' address transformations for mailer ether:
user                        ---->  user
user@site                   ---->  user
user@site.com               ---->  user

The first section of that output is showing you how the addresses in the input files get resolved by sendmail(8). So look at this line, bestie:

user@site.com  --(ether )-->  user@site.com[rmtc]

The input address user@site.com resolves to use the ether mailer. And that mailer is directed to send the mail to the user user@site.com at site rmtc β€” that's what's chillin' in the square brackets. πŸ“¬

The two later sections of output show how the addresses specified as the To and From address get transformed in the text of the headers. In the example above, the To addresses are untouched. The From addresses though? every single one of them loses their machine information on the way through the mailer:

user@site      ---->  user

And honestly? That may be desirable when you're using a configuration file on a workstation that's meant to be hidden as a mailhost from the rest of the network. sneaky. πŸ™ˆ

The following is a set of addresses used at one site for the purposes of testing address resolution. The comments after the addresses detail why each particular address is present:

user              Standard trivial address
user@rmtc         qualified at one level
user@rmtc.central
                  qualified at two levels
user@rmtc.central.sun.com
                  qualified all the way
rmtc!user         local but specified as uucp
user@summit       a workstation (normally delivered locally,
                  though)
user@summit.central
                  same but more qualified
user@summit.central.sun.com
                  same but fully qualified
summit!user       same but specified as uucp
user@prisma       Backward compatibility tests
user@prisma.com
prisma!user
user@central      Superior domain testing
user@machine.central
                  more qualified, but unknown
user@summit.central
                  more qualified and known
user@eng          name in faraway domain
user@machine.eng  unknown machine in faraway domain
user@summit.eng   local machine, far away domain
user@hoback       far away machine
user@machine      apparently local but unknown machine
user@sun.com      Standard trivial address
user@machine.dom.sun.com
                  fully qualified but unknown machine
user@foo.com      standard, known, really far away domain
user@foo.dom      standard, unknown, really far away domain
site!user         Single level uucp
site1!site2!user  Double level uucp
user@foo.dom@bar.dom
                  Trickier address
site!user@foo.dom
                  Mixed uucp/domain
site!user@uunet.uu.net
                  Mixed double uucp/domain

πŸŽ€ NOTES πŸŽ€

Note that checksendmail is a perl script. If your site does not have perl(1), it can be obtained via anonymous ftp from ftp.uu.net. πŸ“‘

sendmail requires that the user have access to the directory specified by the OQ parameter in the configuration file (normally /usr/spool/mqueue). And checksendmail verifies that the user has access to this directory before allowing the test to continue. No access, no test, that's the vibe check. πŸ”₯


πŸ‘‘ AUTHORS πŸ‘‘

  • Gene Kim
  • Rob Kolstad
  • Jeff Polk

Modified by Robert Harker


πŸ’œ SEE ALSO πŸ’œ


and that's the whole page, bestie!! πŸ’– this one shipped with Debian, dated November 14, 2000 β€” so yeah, vintage, but still iconic. now go test those addresses, you absolute legend 🫢✨