Use the same mh_hostname() function from test/common.h in mhsign(1)
[mmh] / man / spost.man8
1 .\"
2 .\" %nmhwarning%
3 .\"
4 .TH SPOST %manext8% "%nmhdate%" MH.6.8 [%nmhversion%]
5 .SH NAME
6 spost \- feed a message to sendmail
7 .SH SYNOPSIS
8 .HP 5
9 .na
10 .HP 5
11 .B spost
12 .RB [ \-verbose " | " \-noverbose ]
13 .I file
14 .RB [ \-Version ]
15 .RB [ \-help ]
16 .ad
17 .SH DESCRIPTION
18 .B Spost
19 is the program called by
20 .B send
21 to feed the message in
22 .I file
23 to
24 .B sendmail
25 for delivery.  In fact, many of
26 the features attributed to
27 .B send
28 in its manual page are performed by
29 .BR spost ,
30 with
31 .B send
32 acting as a preprocessor.
33 Thus, it is
34 .B spost
35 which parses the various header fields, appends
36 `From:' and `Date:' lines,
37 and finally feeds the message to the MTA.
38 .B Spost
39 will not normally be called directly by the user.
40 .PP
41 .B Spost
42 searches the `To:', `Cc:', `Bcc:', `Dcc:',
43 `Fcc:', and `Resent\-xxx:' header lines of the specified
44 message for destination addresses,
45 .PP
46 .B Spost
47 invokes
48 .B sendmail
49 with all recipients, except the blind ones (`Bcc:'),
50 as command line arguments:
51 .RS
52 .B sendmail
53 .B \-i
54 .RB [ \-v ]
55 .I recipients ...
56 .RE
57 .PP
58 If a `Bcc:' field is encountered, its addresses will be used for
59 delivery, and the `Bcc:' field will be removed from the message
60 sent to sighted recipients.  The blind recipients will receive a newly
61 constructed message with a copy of the original message attached.
62 MIME rules are used for encapsulation.
63 .RB ( spost
64 invokes
65 .B send
66 to send the Bcc message.)
67 .PP
68 If a `Dcc:' field is encountered, the field will be removed
69 before sending the message. The Dcc recipient will receive the
70 message as well, but without being mentioned in the recipient
71 headers.
72 .PP
73 In contrast to Bcc, the Dcc recipient receives the
74 same original message as all the sighted reciepients, whereas
75 the Bcc recipient receives a special, newly constructed message,
76 which contains the original message as an attachment.
77 .PP
78 Bcc is probably a good choice for a message with both sighted
79 and invisible reciepients (e.g. inform someone privately about
80 the message being sent). Dcc is probably a good choice for
81 a message to a group of only invisible recipients (e.g. invite
82 to a party).
83 .PP
84 The `Aliasfile' profile entry
85 can be used to specify one or more files that spost
86 should take aliases from.
87 .PP
88 Aliasing is done on any address field. Those are:
89 `From:', `To:', `Cc:', `Bcc:' and `Dcc:',
90 or the `Resent\-xxx:' versions of these fields.
91 .PP
92 The
93 .B \-verbose
94 switch enables informational messages.
95 For example, the `\-v' switch will be added to the
96 .B sendmail
97 invocation.
98 .PP
99 If you specify a `From:' line manually in the message draft,
100 it will be used as provided.
101 If there is no `From:' line in the draft,
102 .B spost
103 uses the
104 .RI ` Default-From '
105 profile entry, if set.
106 Otherwise
107 .B spost
108 constructs the `From:' line from the user's login name
109 and the full name from the GECOS field of the passwd file.
110 An example is `From: Dan Harkless <dan>'.
111 .PP
112 If you set the
113 .B $SIGNATURE
114 environment variable.
115 Its value overrides the full name from the GECOS field.
116 .PP
117 A `Sender:' header will be added in two cases.
118 First, if the `From:' line given in the draft contains one or
119 more addresses, of which none is the user's own one, as defined by
120 .RI ` Alternate-Mailboxes '.
121 (The sender address will then be determined equally as described
122 above for the absent `From:' header.)
123 Second, if the `From:' line contains multiple addresses, of
124 which at least one is the user's own address. The first own
125 address will be used as the sender address.
126 .PP
127 Note that this applies equally to `Resent\-From:' lines
128 in messages sent with
129 .BR dist .
130 .PP
131 .B Spost
132 tries to fully qualify the addresses in every address field.
133 Your MTA is supposed to add the correct domain,
134 if there is none after aliasing.
135 .PP
136 The draft is filed to the folders in the Fcc headers by
137 .BR refile .
138
139 .SH FILES
140 .fc ^ ~
141 .nf
142 .ta \w'ExtraBigFileName  'u
143 None
144 .fi
145
146 .SH "PROFILE COMPONENTS"
147 .fc ^ ~
148 .nf
149 .ta 3.5i
150 .ta \w'ExtraBigProfileName  'u
151 ^Aliasfile:~^For default alias files
152 ^Default\-From:~^The default From header
153 ^Alternate\-Mailboxes:~^The user's addresses
154 ^Sendmail:~^The path name to the sendmail program.
155 .fi
156
157 .SH "SEE ALSO"
158 send(1), mh\-mail(5), mh\-alias(5), mh\-tailor(5), refile(1),
159 .I "Standard for the Format of ARPA Internet Text Messages"
160 (RFC\-822)
161
162 .SH DEFAULTS
163 .nf
164 .RB ` \-noverbose '
165 .fi
166
167 .SH CONTEXT
168 None
169
170 .SH BUGS
171 None
172
173 .SH HISTORY
174 The
175 .B spost
176 in mmh-0.1 used
177 .BR sendmail 's
178 .I -t
179 flag to have
180 .B sendmail
181 extract the recipients from the message headers. Now, it
182 passes the recipients as command line arguments. This provides
183 better compatibility to other sendmail implementations.