]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/sendmail/src/sendmail.8
Import of sendmail version 8.11.1 into vendor branch SENDMAIL with
[FreeBSD/FreeBSD.git] / contrib / sendmail / src / sendmail.8
1 .\" Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
2 .\"      All rights reserved.
3 .\" Copyright (c) 1983, 1997 Eric P. Allman.  All rights reserved.
4 .\" Copyright (c) 1988, 1991, 1993
5 .\"     The Regents of the University of California.  All rights reserved.
6 .\"
7 .\" By using this file, you agree to the terms and conditions set
8 .\" forth in the LICENSE file which can be found at the top level of
9 .\" the sendmail distribution.
10 .\"
11 .\"
12 .\"     $Id: sendmail.8,v 8.36.8.2 2000/09/07 21:14:00 ca Exp $
13 .\"
14 .TH SENDMAIL 8 "$Date: 2000/09/07 21:14:00 $"
15 .SH NAME
16 .B sendmail
17 \- an electronic mail transport agent
18 .SH SYNOPSIS
19 .B sendmail
20 .RI [ flags "] [" "address ..." ]
21 .br
22 .B newaliases
23 .br
24 .B mailq
25 .RB [ \-v ]
26 .br
27 .B hoststat
28 .br
29 .B purgestat
30 .br
31 .B smtpd
32 .SH DESCRIPTION
33 .B Sendmail
34 sends a message to one or more
35 .I recipients,
36 routing the message over whatever networks 
37 are necessary.
38 .B Sendmail
39 does internetwork forwarding as necessary 
40 to deliver the message to the correct place.
41 .PP
42 .B Sendmail
43 is not intended as a user interface routine; 
44 other programs provide user-friendly 
45 front ends;
46 .B sendmail
47 is used only to deliver pre-formatted messages.
48 .PP
49 With no flags,
50 .B sendmail
51 reads its standard input 
52 up to an end-of-file 
53 or a line consisting only of a single dot 
54 and sends a copy of the message found there
55 to all of the addresses listed.  
56 It determines the network(s) to use 
57 based on the syntax and contents of the addresses.
58 .PP
59 Local addresses are looked up in a file 
60 and aliased appropriately.
61 Aliasing can be prevented by preceding the address 
62 with a backslash.
63 Beginning with 8.10, the sender is included in any alias 
64 expansions, e.g., 
65 if `john' sends to `group', 
66 and `group' includes `john' in the expansion, 
67 then the letter will also be delivered to `john'.
68 .SS Parameters
69 .TP
70 .BI \-B type
71 Set the body type to
72 .IR type .
73 Current legal values are 
74 7BIT 
75 or  
76 8BITMIME.
77 .TP
78 .B \-ba
79 Go into 
80 ARPANET 
81 mode.  All input lines must end with a CR-LF, 
82 and all messages will be generated with a CR-LF at the end.  
83 Also, 
84 the ``From:'' and ``Sender:'' 
85 fields are examined for the name of the sender.
86 .TP
87 .B \-bd
88 Run as a daemon.  This requires Berkeley 
89 IPC.
90 .B Sendmail
91 will fork and run in background 
92 listening on socket 25 for incoming
93 SMTP 
94 connections.  
95 This is normally run from 
96 /etc/rc.
97 .TP
98 .B \-bD
99 Same as
100 .B \-bd
101 except runs in foreground.
102 .TP
103 .B \-bh
104 Print the persistent host status database.
105 .TP
106 .B \-bH
107 Purge expired entries from the persistent host status database.
108 .TP
109 .B \-bi
110 Initialize the alias database.
111 .TP
112 .B \-bm
113 Deliver mail in the usual way (default).
114 .TP
115 .B \-bp
116 Print a listing of the queue.
117 .TP
118 .B \-bs
119 Use the 
120 SMTP 
121 protocol as described in 
122 RFC821 
123 on standard input and output.  
124 This flag implies all the operations of the
125 .B \-ba
126 flag that are compatible with 
127 SMTP.
128 .TP
129 .B \-bt
130 Run in address test mode.  
131 This mode reads addresses and shows the steps in parsing; 
132 it is used for debugging configuration tables.
133 .TP
134 .B \-bv
135 Verify names only \- do not try to collect or deliver a message.
136 Verify mode is normally used for validating 
137 users or mailing lists.
138 .TP
139 .BI \-C file
140 Use alternate configuration file.
141 .B Sendmail
142 refuses to run as root if an alternate configuration file is specified.
143 .TP
144 .BI \-d X
145 Set debugging value to
146 .IR X .
147 .ne 1i
148 .TP
149 .BI \-F fullname
150 Set the full name of the sender.
151 .TP
152 .BI \-f name
153 Sets the name of the ``from'' person 
154 (i.e., the envelope sender of the mail).
155 This address may also be used in the From: header
156 if that header is missing during initial submission.
157 The envelope sender address is used as the recipient
158 for delivery status notifications
159 and may also appear in a Return-Path: header.
160 .B \-f
161 should only be used 
162 by ``trusted'' users 
163 (normally
164 .IR root ", " daemon ,
165 and
166 .IR network )
167 or if the person you are trying to become 
168 is the same as the person you are.
169 Otherwise,
170 an X-Authentication-Warning header
171 will be added to the message.
172 .TP
173 .BI \-G
174 Relay (gateway) submission of a message,
175 e.g., when
176 .BR rmail
177 calls
178 .B sendmail .
179 .TP
180 .BI \-h N
181 Set the hop count to
182 .IR N .
183 The hop count is incremented every time the mail is 
184 processed.
185 When it reaches a limit, 
186 the mail is returned with an error message,
187 the victim of an aliasing loop.  
188 If not specified, 
189 ``Received:'' lines in the message are counted.
190 .TP
191 .B \-i
192 Ignore dots alone on lines by themselves in incoming messages.
193 This should be set if you are reading data from a file.
194 .TP
195 .BI "\-L " tag
196 Set the identifier used in syslog messages to the supplied
197 .IR tag .
198 .TP
199 .BI "\-N " dsn
200 Set delivery status notification conditions to
201 .IR dsn ,
202 which can be 
203 `never' 
204 for no notifications 
205 or a comma separated list of the values 
206 `failure' 
207 to be notified if delivery failed, 
208 `delay'
209 to be notified if delivery is delayed, and 
210 `success' 
211 to be notified when the message is successfully delivered.
212 .TP
213 .B \-n
214 Don't do aliasing.
215 .TP
216 \fB\-O\fP \fIoption\fR=\fIvalue\fR 
217 Set option
218 .I option
219 to the specified
220 .IR value .
221 This form uses long names.  See below for more details.
222 .TP
223 .BI \-o "x value"
224 Set option
225 .I x
226 to the specified
227 .IR value .
228 This form uses single character names only.  
229 The short names are not described in this manual page; 
230 see the
231 .I "Sendmail Installation and Operation Guide"
232 for details.
233 .TP
234 .BI \-p protocol
235 Set the name of the protocol used to receive the message.  
236 This can be a simple protocol name such as ``UUCP'' 
237 or a protocol and hostname, such as ``UUCP:ucbvax''.
238 .TP
239 \fB\-q\fR[\fItime\fR] 
240 Processed saved messages in the queue at given intervals.  
241 If
242 .I time
243 is omitted, process the queue once.
244 .I Time
245 is given as a tagged number, 
246 with 
247 `s' 
248 being seconds, 
249 `m' 
250 being minutes, 
251 `h' 
252 being hours, 
253 `d' 
254 being days, 
255 and 
256 `w' 
257 being weeks.
258 For example, 
259 `\-q1h30m' 
260 or 
261 `\-q90m' 
262 would both set the timeout to one hour thirty minutes.
263 If
264 .I time
265 is specified,
266 .B sendmail
267 will run in the background.  
268 This option can be used safely with
269 .BR \-bd .
270 .TP
271 .BI \-qI substr
272 Limit processed jobs to those containing
273 .I substr
274 as a substring of the queue id.
275 .TP
276 .BI \-qR substr
277 Limit processed jobs to those containing
278 .I substr
279 as a substring of one of the recipients.
280 .TP
281 .BI \-qS substr
282 Limit processed jobs to those containing
283 .I substr
284 as a substring of the sender.
285 .TP
286 .BI "\-R " return
287 Set the amount of the message to be returned 
288 if the message bounces.
289 The
290 .I return
291 parameter can be 
292 `full' 
293 to return the entire message or 
294 `hdrs' 
295 to return only the headers.  
296 In the latter case also local bounces return only the headers.
297 .TP
298 .BI \-r name
299 An alternate and obsolete form of the
300 .B \-f
301 flag.
302 .TP
303 .B \-t
304 Read message for recipients.  
305 To:, Cc:, and Bcc: lines will be scanned for recipient addresses.  
306 The Bcc: line will be deleted before transmission.
307 .TP
308 .B \-U
309 Initial (user) submission.  This should
310 .I always
311 be set when called from a user agent such as
312 .B Mail
313 or
314 .B exmh
315 and
316 .I never
317 be set when called by a network delivery agent such as
318 .BR rmail .
319 .TP
320 .BI "\-V " envid
321 Set the original envelope id.  
322 This is propagated across SMTP to servers that support DSNs 
323 and is returned in DSN-compliant error messages.
324 .TP
325 .B \-v
326 Go into verbose mode.  
327 Alias expansions will be announced, etc.
328 .TP
329 .BI "\-X " logfile
330 Log all traffic in and out of mailers in the indicated log file.
331 This should only be used as a last resort 
332 for debugging mailer bugs.  
333 It will log a lot of data very quickly.
334 .TP
335 .B \-\-
336 Stop processing command flags and use the rest of the arguments as
337 addresses.
338 .SS Options
339 There are also a number of processing options that may be set.
340 Normally these will only be used by a system administrator.  
341 Options may be set either on the command line 
342 using the
343 .B \-o
344 flag (for short names), the
345 .B \-O
346 flag (for long names), 
347 or in the configuration file.  
348 This is a partial list limited to those options that are likely to be useful
349 on the command line 
350 and only shows the long names; 
351 for a complete list (and details), consult the
352 .IR "Sendmail Installation and Operation Guide" .
353 The options are:
354 .TP
355 .RI AliasFile= file
356 Use alternate alias file.
357 .TP
358 HoldExpensive 
359 On mailers that are considered ``expensive'' to connect to, 
360 don't initiate immediate connection.  
361 This requires queueing.
362 .TP
363 .RI CheckpointInterval= N
364 Checkpoint the queue file after every
365 .I N
366 successful deliveries (default 10).  
367 This avoids excessive duplicate deliveries 
368 when sending to long mailing lists 
369 interrupted by system crashes.
370 .ne 1i
371 .TP
372 .RI DeliveryMode= x
373 Set the delivery mode to
374 .IR x .
375 Delivery modes are 
376 `i' 
377 for interactive (synchronous) delivery, 
378 `b'
379 for background (asynchronous) delivery, 
380 `q' 
381 for queue only \- i.e.,
382 actual delivery is done the next time the queue is run, and 
383 `d'
384 for deferred \- the same as 
385 `q' 
386 except that database lookups for maps which have set the \-D option
387 (default for the host map) are avoided.
388 .TP
389 .RI ErrorMode= x
390 Set error processing to mode
391 .IR x .
392 Valid modes are 
393 `m' 
394 to mail back the error message, 
395 `w' 
396 to ``write''
397 back the error message 
398 (or mail it back if the sender is not logged in), 
399 `p' 
400 to print the errors on the terminal 
401 (default), 
402 `q' 
403 to throw away error messages 
404 (only exit status is returned), 
405 and 
406 `e'
407 to do special processing for the BerkNet.  
408 If the text of the message is not mailed back 
409 by 
410 modes
411 `m'
412 or
413 `w'
414 and if the sender is local to this machine, 
415 a copy of the message is appended to the file
416 .I dead.letter
417 in the sender's home directory.
418 .TP
419 SaveFromLine
420 Save
421 UNIX-style
422 From lines at the front of messages.
423 .TP
424 .RI MaxHopCount= N
425 The maximum number of times a message is allowed to ``hop'' 
426 before we decide it is in a loop.
427 .TP
428 IgnoreDots
429 Do not take dots on a line by themselves 
430 as a message terminator.
431 .TP
432 SendMimeErrors
433 Send error messages in MIME format.  
434 If not set, the DSN (Delivery Status Notification) SMTP extension 
435 is disabled.
436 .TP
437 .RI ConnectionCacheTimeout= timeout
438 Set connection cache timeout.
439 .TP
440 .RI ConnectionCacheSize= N
441 Set connection cache size.
442 .TP
443 .RI LogLevel= n
444 The log level.
445 .TP
446 .RI MeToo= False
447 Don't send to ``me'' (the sender) if I am in an alias expansion.
448 .TP
449 CheckAliases
450 Validate the right hand side of aliases during a
451 newaliases(1)
452 command.
453 .TP
454 OldStyleHeaders
455 If set, this message may have 
456 old style headers.  
457 If not set, 
458 this message is guaranteed to have new style headers 
459 (i.e., commas instead of spaces between addresses).  
460 If set, an adaptive algorithm is used that will correctly 
461 determine the header format in most cases.
462 .TP
463 .RI QueueDirectory= queuedir
464 Select the directory in which to queue messages.
465 .TP
466 .RI StatusFile= file
467 Save statistics in the named file.
468 .TP
469 .RI Timeout.queuereturn= time
470 Set the timeout on undelivered messages in the queue to the specified time.  
471 After delivery has failed 
472 (e.g., because of a host being down) 
473 for this amount of time, 
474 failed messages will be returned to the sender.  
475 The default is five days.
476 .TP
477 .RI UserDatabaseSpec= userdatabase
478 If set, a user database is consulted to get forwarding information.
479 You can consider this an adjunct to the aliasing mechanism, 
480 except that the database is intended to be distributed; 
481 aliases are local to a particular host.  
482 This may not be available if your sendmail does not have the
483 USERDB
484 option compiled in.
485 .TP
486 ForkEachJob
487 Fork each job during queue runs.  
488 May be convenient on memory-poor machines.
489 .TP
490 SevenBitInput
491 Strip incoming messages to seven bits.
492 .TP
493 .RI EightBitMode= mode
494 Set the handling of eight bit input to seven bit destinations to
495 .IR mode :
496 m
497 (mimefy) will convert to seven-bit MIME format,
498 p
499 (pass) will pass it as eight bits (but violates protocols), 
500 and
501 s
502 (strict) will bounce the message.
503 .TP
504 .RI MinQueueAge= timeout
505 Sets how long a job must ferment in the queue between attempts to send it.
506 .TP
507 .RI DefaultCharSet= charset
508 Sets the default character set used to label 8-bit data 
509 that is not otherwise labelled.
510 .TP
511 .RI DialDelay= sleeptime
512 If opening a connection fails, 
513 sleep for
514 .I sleeptime
515 seconds and try again.  
516 Useful on dial-on-demand sites.
517 .TP
518 .RI NoRecipientAction= action
519 Set the behaviour when there are no recipient headers (To:, Cc: or
520 Bcc:) in the message to
521 .IR action :
522 none
523 leaves the message unchanged,
524 add-to
525 adds a To: header with the envelope recipients,
526 add-apparently-to
527 adds an Apparently-To: header with the envelope recipients,
528 add-bcc
529 adds an empty Bcc: header, and
530 add-to-undisclosed
531 adds a header reading
532 `To: undisclosed-recipients:;'.
533 .TP
534 .RI MaxDaemonChildren= N
535 Sets the maximum number of children that an incoming SMTP daemon
536 will allow to spawn at any time to
537 .IR N .
538 .TP
539 .RI ConnectionRateThrottle= N
540 Sets the maximum number of connections per second to the SMTP port to
541 .IR N .
542 .PP
543 In aliases, 
544 the first character of a name may be 
545 a vertical bar to cause interpretation of 
546 the rest of the name as a command 
547 to pipe the mail to.  
548 It may be necessary to quote the name 
549 to keep
550 .B sendmail
551 from suppressing the blanks from between arguments. 
552 For example, a common alias is:
553 .IP
554 msgs: "|/usr/bin/msgs -s"
555 .PP
556 Aliases may also have the syntax
557 .RI ``:include: filename ''
558 to ask
559 .B sendmail
560 to read the named file for a list of recipients.  
561 For example, an alias such as:
562 .IP
563 poets: ":include:/usr/local/lib/poets.list"
564 .PP
565 would read
566 .I /usr/local/lib/poets.list
567 for the list of addresses making up the group.
568 .PP
569 .B Sendmail
570 returns an exit status 
571 describing what it did.  
572 The codes are defined in
573 .RI < sysexits.h >:
574 .TP
575 EX_OK
576 Successful completion on all addresses.
577 .TP
578 EX_NOUSER
579 User name not recognized.
580 .TP
581 EX_UNAVAILABLE
582 Catchall meaning necessary resources 
583 were not available.
584 .TP
585 EX_SYNTAX
586 Syntax error in address.
587 .TP
588 EX_SOFTWARE
589 Internal software error, 
590 including bad arguments.
591 .TP
592 EX_OSERR
593 Temporary operating system error, 
594 such as
595 ``cannot fork''.
596 .TP
597 EX_NOHOST
598 Host name not recognized.
599 .TP
600 EX_TEMPFAIL
601 Message could not be sent immediately, 
602 but was queued.
603 .PP
604 If invoked as
605 .BR newaliases ,
606 .B sendmail
607 will rebuild the alias database.  If invoked as
608 .BR mailq ,
609 .B sendmail
610 will print the contents of the mail queue.
611 If invoked as
612 .BR hoststat ,
613 .B sendmail
614 will print the persistent host status database.
615 If invoked as
616 .BR purgestat ,
617 .B sendmail
618 will purge expired entries from the persistent host status database.
619 If invoked as
620 .BR smtpd ,
621 .B sendmail
622 will act as a daemon, as if the
623 .B \-bd
624 option were specified.
625 .SH NOTES
626 .B sendmail
627 often gets blamed for many problems
628 that are actually the result of other problems,
629 such as overly permissive modes on directories.
630 For this reason,
631 .B sendmail
632 checks the modes on system directories and files
633 to determine if they can be trusted.
634 Although these checks can be turned off
635 and your system security reduced by setting the
636 .BR DontBlameSendmail
637 option,
638 the permission problems should be fixed.
639 For more information, see:
640
641 .I http://www.sendmail.org/tips/DontBlameSendmail.html
642 .SH FILES
643 Except for the file
644 .I /etc/mail/sendmail.cf
645 itself the following pathnames are all specified in
646 .IR /etc/mail/sendmail.cf .
647 Thus, 
648 these values are only approximations.
649 .PP
650 .TP
651  /etc/mail/aliases
652 raw data for alias names
653 .TP
654  /etc/mail/aliases.db
655 data base of alias names
656 .TP
657  /etc/mail/sendmail.cf
658 configuration file
659 .TP
660  /etc/mail/helpfile
661 help file
662 .TP
663  /etc/mail/statistics
664 collected statistics
665 .TP
666  /var/spool/mqueue/*
667 temp files
668 .SH SEE ALSO
669 binmail(1),
670 mail(1),
671 rmail(1),
672 syslog(3),
673 aliases(5),
674 mailaddr(7),
675 rc(8)
676 .PP
677 DARPA 
678 Internet Request For Comments
679 .IR RFC819 ,
680 .IR RFC821 ,
681 .IR RFC822 .
682 .IR "Sendmail Installation and Operation Guide" ,
683 No. 8, SMM.
684 .PP
685 http://www.sendmail.org/
686 .SH HISTORY
687 The
688 .B sendmail
689 command appeared in
690 4.2BSD.