Fsdb::F...ormmail(3)
Okay bestie, welcome to the Fsdb::F...ormmail(3) page β yes, the User Contributed Perl Documentation one, aka dbformmail. Buckle up, itβs giving βwrite a mail script, but make it safeβ energy π
π NAME π
dbformmail β write a shell script that will send e-mail to many people β¨
β¨ SYNOPSIS β¨
dbformmail [-m MECHANISM] format_file.txt
πΈ DESCRIPTION πΈ
Okay so hereβs the tea β: dbformmail reads a βform mailβ message from the file FORMAT_FILE.TXT, and it fills in underscore-preceded column-names with data. Then it outputs a shell script that will send each message through some mail transport MECHANISM. Thatβs the whole vibe.
Do not use this program for evil or I will have to come over and have words with you. No cap, thatβs literally in the manual π
Important bestie note: this program does NOT actually SEND the mail. It writes a shell script that will send the mail for you. I recommend you save it to a file, check it (one last time!), then run it with sh.
Also, unlike most Fsdb programs, this program does not output a FSDB file. Itβs not that kind of party π«Ά
π OPTIONS π
Okay, options time. Grab your lilβ checklist π
-m MECHANISMβ pick the mail-sending mechanism:Mail,sendmail, ormh. 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).
This module also supports the standard fsdb options:
-dβ enable debugging output.-ior--inputInputSource β read from InputSource, typically a file name, or-for standard input, or (if in Perl) aIO::Handle,Fsdb::IOorFsdb::BoundedQueueobjects.-oor--outputOutputDestination β write to OutputDestination, typically a file name, or-for standard output, or (if in Perl) aIO::Handle,Fsdb::IOorFsdb::BoundedQueueobjects.--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.
π 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 send the mail, run
sh outgoing.sh
π¦ SEE ALSO π¦
Fsdb β thatβs the one. Go give it a look π
π CLASS FUNCTIONS π
Under the hood, bestie. These are the Perl bits π§
π new π
$filter = new Fsdb::Filter::dbformmail(@arguments);
Makes a fresh dbformmail object, taking command-line arguments.
π set_defaults π
$filter->set_defaults();
Internal: set up defaults β behind-the-scenes glow-up.
π parse_options π
$filter->parse_options(@ARGV);
Internal: parse command-line arguments.
π setup π
$filter->setup();
Internal: setup, parse headers.
π run π
$filter->run();
Internal: run over each rows.
π finish π
$filter->finish();
Internal: write trailer, but no trailer for us.
π 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.
This iconic page is Fsdb::F...ormmail(3), from perl v5.32.1, dated 2024-08-02. Bye bestie, go check that script one last time! π
β¨
π¦ 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