DBFORMMAIL(1)
π 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 β¨
-mMECHANISM β picks the mail-sending mechanism. your choices areMail,sendmail, andmh. defaults to"Mail". πMailuses a Berkeley-style/usr/bin/Mail.sendmailinvokes/usr/bin/sendmail.mhwrites 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. π-ior--inputInputSource β read from InputSource. typically a file name, or"-"for standard input, or (if you're in Perl) aIO::Handle,Fsdb::IOorFsdb::BoundedQueueobject.-oor--outputOutputDestination β write to OutputDestination. typically a file name, or"-"for standard output, or (if you're in Perl) aIO::Handle,Fsdb::IOorFsdb::BoundedQueueobject.--autorunor--noautorunβ by default, programs process automatically, butFsdb::Filterobjects in Perl do not run until you invoke therun()method. the--(no)autorunoption 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.
π AUTHOR and COPYRIGHT π
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
- epel 9: perl-Fsdb 2:3.9-1.el9 Β· GPLv2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms