1Fsdb::Filter::dbformmaiUls(e3r)Contributed Perl DocumentFastdibo:n:Filter::dbformmail(3)
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. Choose "Mail" or "sendmail".
28 Defaults to "Mail".
29
30 This module also supports the standard fsdb options:
31
32 -d Enable debugging output.
33
34 -i or --input InputSource
35 Read from InputSource, typically a file name, or "-" for standard
36 input, or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue
37 objects.
38
39 -o or --output OutputDestination
40 Write to OutputDestination, typically a file name, or "-" for
41 standard output, or (if in Perl) a IO::Handle, Fsdb::IO or
42 Fsdb::BoundedQueue objects.
43
44 --autorun or --noautorun
45 By default, programs process automatically, but Fsdb::Filter
46 objects in Perl do not run until you invoke the run() method. The
47 "--(no)autorun" option controls that behavior within Perl.
48
49 --help
50 Show help.
51
52 --man
53 Show full manual.
54
56 Input:
57 #fsdb account passwd uid gid fullname homedir shell
58 johnh * 2274 134 John_Heidemann /home/johnh /bin/bash
59 greg * 2275 134 Greg_Johnson /home/greg /bin/bash
60 root * 0 0 Root /root /bin/bash
61 # this is a simple database
62
63 Sample form (in the file form.txt):
64
65 To: _account
66 From: the sysadmin <root>
67 Subject: time to change your password
68
69 Please change your password regularly.
70 Doesn't this message make you feel safer?
71
72 Command:
73 cat DATA/passwd.fsdb | dbformmail form.txt >outgoing.sh
74
75 Output (in outgoing.sh):
76 #!/bin/sh
77 sendmail 'johnh' <<'END'
78 To: johnh
79 From: the sysadmin <root>
80 Subject: time to change your password
81
82 Please change your password regularly.
83 Doesn't this message make you feel safer?
84
85 END
86 sendmail 'greg' <<'END'
87 (etc.)
88
89 And to send the mail, run
90
91 sh outgoing.sh
92
94 Fsdb.
95
97 new
98 $filter = new Fsdb::Filter::dbformmail(@arguments);
99
100 Create a new dbformmail object, taking command-line arguments.
101
102 set_defaults
103 $filter->set_defaults();
104
105 Internal: set up defaults.
106
107 parse_options
108 $filter->parse_options(@ARGV);
109
110 Internal: parse command-line arguments.
111
112 setup
113 $filter->setup();
114
115 Internal: setup, parse headers.
116
117 run
118 $filter->run();
119
120 Internal: run over each rows.
121
122 finish
123 $filter->finish();
124
125 Internal: write trailer, but no trailer for us.
126
128 Copyright (C) 1991-2018 by John Heidemann <johnh@isi.edu>
129
130 This program is distributed under terms of the GNU general public
131 license, version 2. See the file COPYING with the distribution for
132 details.
133
134
135
136perl v5.28.1 2018-02-17 Fsdb::Filter::dbformmail(3)