dbformmail (1) Linux Manual Page
dbformmail – write a shell script that will send e-mail to many people
Synopsis
dbformmail [-m MECHANISM] format_file.txtDescription
Read a “form mail” message from the file FORMAT_FILE.TXT, filling in underscore-preceded column-names with data. Output a shell script which will send each message through some mail transport MECHANISM.Do not use this program for evil or I will have to come over and have words with you.
Note that 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.
Unlike most Fsdb programs, this program does not output a FSDB file.
Options
- -m MECHANISM
- Select the mail-sending mechanism. Choose “Mail” or “sendmail”. Defaults to “Mail”.
This module also supports the standard fsdb options:
- -d
- Enable debugging output.
- -i or –input InputSource
- Read from InputSource, typically a file name, or "-" for standard input, or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue objects.
- -o or –output OutputDestination
- Write to OutputDestination, typically a file name, or "-" for standard output, or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue objects.
- –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.
Sample Usage
Input:
#fsdb account passwd uid gid fullname homedir shellSample form (in the file form.txt):
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
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/shAnd to send the mail, run
sendmail ‘johnh’ <<‘END’
To: johnh
From: the sysadmin <root>
Subject: time to change your passwordPlease change your password regularly.
Doesn’t this message make you feel safer?
END
sendmail ‘greg’ <<‘END’
(etc.)
sh outgoing.sh
See Also
Fsdb.AUTHOR and COPYRIGHT
Copyright (C) 1991-2015 by John Heidemann <johnh [at] 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.
