EDITMAP(8)

πŸ“¦
version 8.18.2 Β· 2 versions
  • 8.18.2 Β· debian bookworm, debian trixie, freebsd 14.5, freebsd 15.1, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 8.15.2 Β· ubuntu jammy
, in debian bookworm, debian trixie, freebsd 14.5, freebsd 15.1, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– EDITMAP πŸ’–

okay bestie, so editmap is a System Manager's Manual girly (section 8, we love a root-coded queen πŸ‘‘) and she's here to query and edit single records in database maps for sendmail. let's get into it ✨


🌸 NAME 🌸

editmap β€” query and edit single records in database maps for sendmail πŸ¦‹


✨ SYNOPSIS ✨

editmap [-C file] [-N] [-f] [-q|-u|-x] maptype mapname key [ "value ..."
]

πŸ’… DESCRIPTION πŸ’…

so basically, editmap queries or edits one record in database maps used by the keyed map lookups in sendmail(8). you pass the arguments on the command line, and the output (for queries, obvi) goes straight to standard output. main character energy fr fr πŸŽ€

depending on how it was compiled, editmap handles different database formats β€” and you pick which one with the maptype parameter. the options are:

  • dbm β€” DBM format maps. this one needs the ndbm(3) library. lowkey vintage πŸ’œ
  • btree β€” B-Tree format maps. this needs the new Berkeley DB library.
  • hash β€” Hash format maps. also needs the Berkeley DB library.
  • cdb β€” CDB (Constant DataBase) format maps. this one needs the tinycdb library. ✨

and here's a lil detail that matters: if the TrustedUser option is set in the sendmail configuration file and editmap is invoked as root, then the generated files will be owned by the specified TrustedUser. no cap πŸ‘‘


🚩 Flags 🚩

  • -C β€” use the specified sendmail configuration file when it's looking up the TrustedUser option. πŸŽ€
  • -N β€” include the null byte that terminates strings in the map (this is for alias maps, iykyk). 🫢
  • -f β€” normally all upper case letters in the key get folded to lower case. this flag disables that behaviour. it's meant to mesh with the -f flag in the K line in sendmail.cf. and heads up: the value is never case folded. periodt πŸ’…
  • -q β€” query the map for the specified key. if it's found, print the value to standard output and exit with 0. if it's not found, print an error message to stdout and exit with EX_UNAVAILABLE. 😭
  • -u β€” update the record for key with value, or insert a new record if one doesn't exist yet. exits with 0 on success or EX_IOERR on failure. slay when it works, tragic when it doesn't πŸ’€
  • -x β€” deletes the specific key from the map. exits with 0 on success or EX_IOERR on failure. bye bestie πŸ‘‹

πŸ” SEE ALSO πŸ”

sendmail(8), makemap(8) β€” go read your sisters, they're iconic too 🌈


πŸ“œ HISTORY πŸ“œ

the editmap command has no history. not me being mysterious on purpose πŸ™ˆβœ¨


and that's the whole page bestie, you ate it up πŸ’–

this was from the System Manager's Manual, dated $Date: 2013-11-22 20:51:26 $ β€” yeah she's a 2013 baddie and she still runs the group chat. love that for her πŸŽ€β­