DBFORMMAIL(1)

πŸ“¦
version 3.9 Β· 3 versions
, in epel 9

πŸ’Œ DBFORMMAIL(1) β€” the dbformmail manual, bestie edition πŸ’Œ

okay so real quick: this is the page for dbformmail, and yes it lives in User Contributed Perl Documentation, so you know it's got lore. it writes you a shell script that'll send e-mail to a whole bunch of people at once. buckle up. πŸŽ€


✨ NAME ✨

dbformmail β€” write a shell script that will send e-mail to many people


πŸ¦‹ SYNOPSIS πŸ¦‹

dbformmail [-m MECHANISM] format_file.txt

πŸ’… DESCRIPTION πŸ’…

so basically: it reads a "form mail" message out of the file FORMAT_FILE.TXT, and it fills in the underscore-preceded column-names with actual data. πŸ’– Then it outputs a shell script β€” and that script is the thing that sends each message through some mail transport, the MECHANISM.

🚨 one (1) moral clause, no cap: do not use this program for evil or I will have to come over and have words with you. you've been warned, bestie. 😀

huge thing to know, and I mean huge: this program does NOT actually SEND the mail. it writes a shell script that will send the mail for you. the recommendation is literally: save it to a file, check it (one last time!), then run it with sh. main character move is reading your own script before running it, fr fr. πŸ‘‘

also β€” and this is the plot twist β€” unlike most Fsdb programs, this program does not output a FSDB file. it's just built different. 🌈


✨ OPTIONS ✨

  • -m MECHANISM β€” picks the mail-sending mechanism. your choices are Mail, sendmail, and mh. defaults to "Mail". πŸ’Œ
    • Mail uses a Berkeley-style /usr/bin/Mail.
    • sendmail invokes /usr/bin/sendmail.
    • mh writes messages into the current directory, treating it as an mh-style mailbox (one message per file, with filesnames as sequential integrates β€” that's the manpage's exact wording, don't come for me πŸ˜­πŸ’€).

then there's the standard fsdb options, and this module supports all of them too:

  • -d β€” enable debugging output. πŸ›
  • -i or --input InputSource β€” read from InputSource. typically a file name, or "-" for standard input, or (if you're in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue object.
  • -o or --output OutputDestination β€” write to OutputDestination. typically a file name, or "-" for standard output, or (if you're in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue object.
  • --autorun or --noautorun β€” by default, programs process automatically, but Fsdb::Filter objects in Perl do not run until you invoke the run() method. the --(no)autorun option controls that behavior within Perl. πŸŽ›οΈ
  • --help β€” show help. 🫢
  • --man β€” show full manual. (hi, you're here πŸ‘‹)

🌸 SAMPLE USAGE 🌸

πŸ“ Input:

#fsdb account passwd uid gid fullname homedir shell
johnh * 2274 134 John_Heidemann /home/johnh /bin/bash
greg * 2275 134 Greg_Johnson /home/greg /bin/bash
root * 0 0 Root /root /bin/bash
# this is a simple database

🧚 Sample form (in the file form.txt):

To: _account
From: the sysadmin <root>
Subject: time to change your password

Please change your password regularly.
Doesn't this message make you feel safer?

⭐ Command:

cat DATA/passwd.fsdb | dbformmail form.txt >outgoing.sh

πŸ”₯ Output (in outgoing.sh):

#!/bin/sh
sendmail 'johnh' <<'END'
To: johnh
From: the sysadmin <root>
Subject: time to change your password

Please change your password regularly.
Doesn't this message make you feel safer?

END
sendmail 'greg' <<'END'
(etc.)

and to actually send the mail, run

sh outgoing.sh

periodt. that's the whole flow. πŸ’œ


πŸŽ€ SEE ALSO πŸŽ€

Fsdb.


Copyright (C) 1991-2018 by John Heidemann <johnh@isi.edu>

This program is distributed under terms of the GNU general public license, version 2. See the file COPYING with the distribution for details.


and that's the tea bestie πŸ’– this page is from perl v5.32.1, dated 2024-08-02, manual page DBFORMMAIL(1) β€” go send some mail responsibly πŸ¦‹βœ¨

πŸ“¦ where this page comes from