1DBFORMMAIL(1) User Contributed Perl Documentation DBFORMMAIL(1)
2
3
4
6 dbformmail - write a shell script that will send e-mail to many people
7
9 dbformmail [-m MECHANISM] format_file.txt
10
12 Read a ``form mail'' message from the file FORMAT_FILE.TXT, filling in
13 underscore-preceded column-names with data. Output a shell script
14 which will send each message through some mail transport MECHANISM.
15
16 Do not use this program for evil or I will have to come over and have
17 words with you.
18
19 Note that this program does NOT actually SEND the mail. It writes a
20 shell script that will send the mail for you. I recommend you save it
21 to a file, check it (one last time!), then run it with sh.
22
23 Unlike most Fsdb programs, this program does not output a FSDB file.
24
26 -m MECHANISM
27 Select the mail-sending mechanism: Mail, sendmail, or mh. Defaults
28 to "Mail".
29
30 Mail uses a Berkeley-style /usr/bin/Mail. Sendmail invokes
31 /usr/bin/sendmail. Mh writes messages into the current directory,
32 treating it as an mh-style mailbox (one message per file, with
33 filesnames as sequential integrates).
34
35 This module also supports the standard fsdb options:
36
37 -d Enable debugging output.
38
39 -i or --input InputSource
40 Read from InputSource, typically a file name, or "-" for standard
41 input, or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue
42 objects.
43
44 -o or --output OutputDestination
45 Write to OutputDestination, typically a file name, or "-" for
46 standard output, or (if in Perl) a IO::Handle, Fsdb::IO or
47 Fsdb::BoundedQueue objects.
48
49 --autorun or --noautorun
50 By default, programs process automatically, but Fsdb::Filter
51 objects in Perl do not run until you invoke the run() method. The
52 "--(no)autorun" option controls that behavior within Perl.
53
54 --help
55 Show help.
56
57 --man
58 Show full manual.
59
61 Input:
62 #fsdb account passwd uid gid fullname homedir shell
63 johnh * 2274 134 John_Heidemann /home/johnh /bin/bash
64 greg * 2275 134 Greg_Johnson /home/greg /bin/bash
65 root * 0 0 Root /root /bin/bash
66 # this is a simple database
67
68 Sample form (in the file form.txt):
69
70 To: _account
71 From: the sysadmin <root>
72 Subject: time to change your password
73
74 Please change your password regularly.
75 Doesn't this message make you feel safer?
76
77 Command:
78 cat DATA/passwd.fsdb | dbformmail form.txt >outgoing.sh
79
80 Output (in outgoing.sh):
81 #!/bin/sh
82 sendmail 'johnh' <<'END'
83 To: johnh
84 From: the sysadmin <root>
85 Subject: time to change your password
86
87 Please change your password regularly.
88 Doesn't this message make you feel safer?
89
90 END
91 sendmail 'greg' <<'END'
92 (etc.)
93
94 And to send the mail, run
95
96 sh outgoing.sh
97
99 Fsdb.
100
102 Copyright (C) 1991-2018 by John Heidemann <johnh@isi.edu>
103
104 This program is distributed under terms of the GNU general public
105 license, version 2. See the file COPYING with the distribution for
106 details.
107
108
109
110perl v5.32.1 2021-01-27 DBFORMMAIL(1)