Debian Codegraph @

man/imput

raw
1 Manual for IMPUT
2
3 1. Outline
4
5 * Messages of mail and news are dispatched by way of SMTP/NNTP.
6 (If there is header field such as To: or Cc:, imput dispatches as mail
7 by way of SMTP. If there is header field such as Newsgroups:, imput
8 dispatches as news
9 * Multiple SMTP/NNTP servers can be specified in the configuration
10 file. Imput try one server at a time, and select next server on
11 failure, continuously select servers until it successfully post the
12 message. The service port of each server can be configured.
13 * Japanese in header field can be converted into the MIME(RFC2047) form.
14 * Japanese written with EUC/SJIS can be converted into JIS(ISO-2022-JP).
15 * Text of a message which contains 8bit code is converted into
16 quoted-printable or base64 (RFC2045).
17 * When error occurs while dispatching, error message of Delivery Status
18 Notification form (RFC1891,RFC1892,RFC1894) is generated.
19 * BCC (blind carbon copy) is sent with MIME Message/rfc822 capsulated form
20 (RFC2045).
21 * DCC (distribution carbon copy) is supported. (Addresses will not be show
22 in header field and messages are not capsulated like BCC.)
23 * FCC (folder carbon copy) is also supported.
24 * Message-Id:/Date: header fields are generated automatically.
25 (Therefore, same Message-Id:/Date remains in the message which saved by FCC)
26 * "List:;" (RFC822) style addressing is supported.
27 * "Group:u1,u2;" (RFC822) style addressing is also supported.
28 (The message will be sent to u1 and u2, and the address will be rewritten
29 into "group:;" form)
30 * "Group:/file;" (non-standard) style addressing is supported.
31 (/file is a path of local file and addresses described in the file is
32 read and mail is sent aiming at those addresses. The address will be
33 rewritten into "group:;" form.)
34 * A big size message can be divided into MIME Message/partial form (RFC2045).
35 * Aliasing for mail addresses at individual level is supported (like MH).
36 * Aliasing for domain part of addresses at individual level is supported.
37 (hostalias form of BIND.)
38 * History of all dispatched messages are recorded (like syslog of sendmail).
39 * MH style Annotation is supported (except Forwarded:).
40 * SIZE and DSN (new plan of Return-Receipt-To:) in ESMTP are supported.
41 * imput can be used as replacement of send in MH or sendmail which is
42 called from UCBMAIL or something else.
43
44
45 2. Usage
46
47 * with Mew
48 Please read the document of Mew.
49
50 * Direct use from "shell"s
51 imput [options] [list of destinations|path of a message to be sent]
52
53 Parameters between [ and ] are optional.
54 The option is described later.
55 "list of destinations" are mail addresses delimited by the blank.
56 If list of destinations are specified and no message file is
57 specified by the option, the message is read from a standard input.
58 Path of a message should be absolute-path form.
59
60 * with MH
61 Please specify imput for sendproc of ~/.mh_profile.
62 Example:
63 sendproc: /home/motonori/cmd/imput
64
65 * with mh-e (Ver.4 or later)
66 Please execute (setq mh-send-prog "imput").
67
68 * with UCB Mail
69 Please set an environment variable, "sendmail".
70 Example:
71 setenv sendmail /home/motonori/cmd/imput (For csh etc.).
72 It is possible to describe in mailrc.
73 Example:
74 set sendmail /home/motonori/cmd/imput
75
76 * with Mail clients which directly executes the sendmail
77 Please replace /usr/lib/sendmail with imput. (/usr/lib/sendmail
78 may be /usr/sbin/sendmail or something else. This is different
79 in dependence on OS).
80 Please devise on location when it is necessary to leave original
81 sendmail for the reception of messages.
82
83 * with News clients which executes "inews"
84 Please replace inews with imput.
85 Note: Options other than -h are not supported.
86
87
88 3. Options
89
90 Options which can be specified with a command line or environment variables
91 are shown below. Current settings are displayed with imput --help.
92 Case of letters in option names are insensitive.
93
94 The form of the argument when the option is accompanied by the argument
95 is shown by the following signs.
96
97 <sw> "on" or "off" (can be omitted)
98 <num> numerics
99 <str> character string
100 <str,> character strings delimited with ","
101
102 The descriptions below are based on forms as command line options.
103 But all options "--Option=value" can also be described in Config file
104 like "Option=value".
105
106
107 [Options concerning setting]
108
109 --Help=<sw> help message is displayed.
110 --Config=<str,> block name which should be referred in configuration
111 files. specify WORD at <str,> to select a block
112 which starts from the line labeled "case WORD"
113 in configuration file. If multiple names are specified,
114 each block is sequentially evaluated.
115 If address information of a message is extracted
116 from header part of the message (by using --ObeyHeader
117 or --Message option), block name can be specified as
118 a value for "Config:" header field.
119 "Config:" header field will be stripped from the
120 message when it dispatched.
121 --Require=<str> path of a perl script which will be evaluated at
122 initialization. (c.f. Hooks)
123 --Debug=<sw> debugging mode (every modules run in debugging mode).
124 --DebugFlag=<str,> module names to be set in debugging mode.
125 specify XXX to make &debug("xxx") in the script true.
126 --Verbose verbose mode.
127
128 [Options concerning server information]
129
130 --SMTPservers=<str,> SMTP servers (and port numbers) are specified
131 (in server_name[/remote_port][%local_port] forms).
132 When /remote_port is omitted, SMTP(25) will be assumed.
133 If local_port is specified, use SSH port forwarding.
134 --TryNextOnFatal=<sw> on: Even if permanent error is detected, try to the
135 next server specified with --SMTPservers option.
136 off: If permanent error is detected, rest of servers
137 are not tried.
138 --NNTPservers=<str,> NNTP servers (and port numbers) are specified
139 (in server_name[/remote_port][%local_port] forms).
140 When /remote_port is omitted, NNTP(119) will be
141 assumed. If local_port is specified, use SSH port
142 forwarding.
143 --EmgSMTPsvrs=<str,> SMTP servers which should be tried when a message
144 has a permanent error and cannot bounce back to
145 any servers specified with --SMTPservers.
146 --Clientname=<str> host name to be used when imput introduces oneself
147 with HELO of SMTP.
148 --ESMTP=<sw> on: try ESMTP first even when a SMTP server does not
149 show it can communicate with ESMTP.
150 off: only when a SMTP server shows that it can accept
151 ESMTP.
152 --NewsPost=<sw> on: posting of news is permitted
153 (messages are posted if necessary).
154 off: posting of news is prohibited.
155 --SSHServer=<str> Use the specified host as an SSH port relay server.
156
157 [Options concerning header field generation]
158
159 --User=<str> local part (user name) of sender's address.
160 The login name is used in default.
161 --Name=<str> full name of sender.
162 used for "Full Name" of Full Name <User@FromDomain>.
163 In default, content of the GCOS field of password file
164 is used.
165 --NameInComment=<sw> off: From: Full Name <User@FromDomain> is generated.
166 on: From: User@FromDomain (Full Name) is generated.
167 --Org=<str> Information applied to Organization: header field.
168 --FromDomain=<str> default domain part of sender.
169 --ToDomain=<str> default domain part of recipient.
170 When @domain part of recipient is not specified,
171 this @value is supplemented.
172 --ObeyMTAdomain=<sw> on: default domain part should be supplied at MTA
173 (sendmail etc.) and imput should not supply it.
174 --MsgIdDomain=<str> domain part to be used in a value of Message-Id:
175 header field.
176 domain part specified by --FromDomain option will be
177 used when --MsgIdDomain option is not specified.
178 --MsgId=<sw> on: Message-Id: will be generated by imput.
179 off: Message-Id: will not be generated by imput.
180 (it will be generated by MTA).
181 --PidMsgId=<sw> on: process ID will be included to a character string
182 in Message-ID: header value.
183 This option is preferable to specify when two or more
184 messages will be occasionally sent in one second.
185 --NoMsgIdForNews on: make Message-Id: header generated by NNTP server
186 for messages which posted with NNTP.
187 --Date=<sw> on: Date: is generated automatically by imput.
188 off: Date: is not generated automatically by imput.
189 (it will be supplemented with MTA)
190 --NewsGMTdate=<sw> on: generate the date information by GMT.
191 GMT might be recommended in news (RFC1036).
192 off: local timezone is used.
193 --NScmpl=<sw> on: completion of domain part by using name server is
194 enabled. parameter of domain or search defined in
195 /etc/resolv.conf will be used by the resolver.
196 off: completion by using name server is disabled.
197 --AliasesFile=<str,> path of alias files for mail addresses.
198 Example:
199 alias1: u1
200 alias2: u2@domain
201 alias3: User-Three <u3@domain>
202 alias4: u4,u5
203 alias5: group:u6,u7;
204 alias6: group:/address/list/file;
205 :
206 --HostAliases=<str,> path of alias files for domain part completion.
207 Example:
208 alias1 realname1.domain
209 alias2 realname2.domain
210 :
211 --ShowRcpts=<sw> on: Apparently-To: header field will be added by MTA.
212 off: To: undisclosed-recipients:; header field will
213 be added by imput not to be added Apparently-To:
214 header field by MTAs.
215 --Subj=<str>(-s) a character string to be added as a value of Subject:.
216 ignored if a message has a Subject: header already.
217 --ObeyHeader=<sw>(-t) on: extract addresses of recipients from header part of
218 a message. the message will be posted if Newsgroups:
219 header field is found.
220 recipients specified in the command line will be
221 ignored.
222 off: To:, Cc:, Newsgroups: of header will not be
223 interpreted. It is necessary to specify the address
224 etc. in the command line.
225 --AddHeader=<str,> Any header to be added.
226 e.g.: --AddHeader='X-Header: value'
227
228 [Options concerning delivery operation of message]
229
230 --MeToo=<sw>(-om) on: send messages also to the sender.
231 (equivalent to specify "Dcc: the sender").
232 --Receipt=<sw> on: request to send back the delivery status
233 notification (depend on RFC1891).
234 --MIMEbcc=<sw> on: dispatch BCC by MIME Message/rfc822 style
235 encapsulation (RFC2045).
236 off: dispatch BCC without encapsulation.
237 --NewsCheck=<sw> on: when To: or Cc: header field exists, no posting is
238 performed for news.
239 off: the message will be posted if Newsgroups: header
240 exists.
241 --Group=<str,> news groups which should be posted.
242 this overrides Newsgroups: header field in original
243 messages.
244 --Dist=<sw> on: changes to the redistribution mode.
245 Resent-*: style header fields are used.
246 --DistMsg=<str> path of a message to be redistributed.
247 recipients should be specified in the command line
248 or in header part of a file specified with --Message
249 option.
250 --SMTP=<sw>(-bs) on: interactive SMTP mode (like sendmail -bs).
251
252 [Options concerning message filing]
253
254 --Folder=<str> draft folder in which a draft message to be dispatched
255 located.
256 --TrashMark=<str> a character which should be added before the name of
257 a draft message file when the message is dispatched
258 successfully.
259 --Message=<str> Path of a message to be dispatched.
260 if relative path is specified, it will be considered
261 as relative from a folder specified with --Folder
262 option.
263 --Fcc=<str> folder name in which dispatched message should be
264 preserved.
265 --FccPartial=<sw> on: divided with multipart/partial form when
266 preserving.
267 # --FccDir=<sw> preserved in MH (directory) style.
268 # --FccFile=<sw> preserved in mbox (single file) style.
269
270 [Options concerning Japanese Handling]
271
272 --JPheader=<sw> on: JIS(ISO-2022-JP) characters in header fields are
273 encoded with the MIME
274 (RFC2047) form.
275 off: JIS characters are preserved as is.
276 --HdrQEncoding=<sw> on: JIS characters are encoded with Q-encoding
277 method.
278 off: JIS characters are encoded by B-encoding method.
279 --NoHdrFolding=<sw> on: no line folding
280 off: line folding of about 72 characters a line.
281 --JPconv=<sw> on: EUC/SJIS->JIS conversion allowed.
282 off: EUC/SJIS->JIS conversion prohibited.
283 --DefCode=<str> The default code when it is not possible to
284 distinguish automatically (EUC/SJIS/8BIT).
285 --8to7=<sw> on: The message body which includes 8bit codes should
286 be encoded to 7bit.
287 Either base64 or quoted-printable is automatically
288 selected by the rate of 8bit codes.
289 off: The message body which includes 8bit codes will
290 not be encoded to 7bit.
291 --8BitLabel=<str> value for Content-Type: when body has 8bit codes and
292 Mime-Version is not found in header part.
293
294 [Options concerning processing of message body]
295
296 --IgnoreDot=<sw>(-oi) on: not to interpret a line only of '.' as the
297 terminal of a message.
298 off: interpret a line only of '.' as the terminal
299 of a message.
300 --MultipartAdd=<str> files to be added as a part of multiparted message.
301 if this option specified multiple times, each file
302 is added as a separate part in that order.
303 If original message is not a multiparted message,
304 the message becomes a multiparted automatically.
305 If original message is a multiparted message, a new
306 part is simply added.
307
308 [Options concerning message division]
309
310 --Lines=<num> number of lines by which large mail is divided.
311 (divided with MIME Message/partial form (RFC2045).)
312 when 0 is specified, division is not done.
313 --Sleep=<num> interval of transmissions of divided messages
314 (in seconds).
315
316 [Options concerning queue processing]
317
318 --QueueDir=<str> path of a directory to be used as queue.
319 When the directory does not exist, it will be created
320 automatically (default is ~/.im/queue).
321 --JustQueuing=<sw>(-odq)
322 on: message is preserved in the queue without
323 dispatching attempt.
324 --Queuing=<sw> on: When a message cannot be passed to the server,
325 the message is preserved in the queue instead of
326 bouncing back.
327 --ProcessQueue=<sw>(-q)
328 on: messages preserved in the queue are processed
329 to be dispatched.
330 --QueueStatus=<sw>(-bp)
331 on: list of preserved messages is displayed.
332
333 [Options concerning error processing]
334
335 --Report=<sw> on: notify the error by mail when transmission error
336 occurs.
337 off: display messages on transmission error.
338 --Dead=<str> path of a file in which a message will be preserved
339 when the message cannot be sent (mbox form, default
340 is ~/.im/dead.letter).
341
342 [Options concerning recording history of dispatching activities]
343
344 --Annotate=<sw> on: Replied: or Resent: header fields will be
345 prepended on a message which is referenced with
346 References: or In-Reply-To: field.
347 (Forwarded: is not yet supported.)
348 --Log=<str> path of file which records history.
349 If <str> is NULL, nothing recorded
350 (default is ~/.im/putlog).
351 --Syslog=<sw> on: recorded via syslog with MAIL/INFO.
352
353 Besides above, some compatible options with the send command of MH
354 and inews exist.
355
356
357 4. Interpreted environment variable
358
359 HOSTALIASES equivalent to --HostAliases option
360 SMTPSERVERS equivalent to --SMTPservers option
361 NNTPSERVERS equivalent to --NNTPservers option
362 ORGANIZATION equivalent to --Org option
363 MSGIDDOMAIN equivalent to --Msgid option
364 FROMDOMAIN equivalent to --FromDomain option
365 TODOMAIN equivalent to --ToDomain option
366 NAME used for comment part of From:
367 SIGNATURE used for comment part of From: (overrides NAME)
368
369
370 5. Handling of header field
371
372 5.1 Destinations of messages
373
374 When it is specified to extract address information from header part of a
375 message, the following header field will be referred:
376 To:, Cc:, Dcc:, Bcc:
377 Copies of a messages for recipients specified in Bcc: are encapsulated with
378 MIME message/rfc822. @MYSELF@ or @ME@ can be specified in these header field
379 for a value. When these values are specified, it will be replaced with
380 the address of sender (which will be shown in From:) of a message.
381
382 5.2 expansion of aliases and completion of addresses
383
384 As for the address of following header field, rewritten by the definition
385 under files which are specified by --HostAliases or --AliasesFile:
386 To:, Cc:, Bcc:, Dcc:, Resent-To:, Resent-Cc:, Resent-Bcc:, Resent-Dcc:
387 When @domain part does not exist in addresses, domain name specified with
388 --ToDomain is appended. (Only when you do not specify the --ObeyMTAdomain
389 option).
390
391 As for the address of following header field, rewritten by the definition
392 under files which are specified by --HostAliases or --AliasesFile:
393 From:, Resent-From:, Reply-To, Resent-Reply-To, Errors-To,
394 Return-Receipt-To:
395 When @domain part does not exist in addresses, domain name specified with
396 --FromDomain is appended (Only when you do not specify the --ObeyMTAdomain
397 option).
398
399 5.3 Fcc:
400
401 If Fcc: header field (or --Fcc command line option) is specified, a copy of
402 of the message is preserved in the folder specified after dispatching.
403
404 5.4 Date: and Message-Id:
405
406 In some UA (User Agent; user's application for mail transmitting and
407 receiving), Date: and Message-Id: field are not generated and it is expected
408 to be generated by MTA (Mail Transfer Agent). In that case, a copy of message
409 (preserved with Fcc:) does not have Date: or Message-Id: header field,
410 and there is no way to identify message by specifying unique message ID.
411 With imput, all copies of message will have Date: and Message-Id: field
412 by default.
413
414 5.5 Sender: and Originator:
415
416 If there is From: header field in a message to be sent and the value of
417 From: header field is different from an address which is configured to
418 be added automatically, Sender: header field with the configured address
419 is added automatically. When the message is sent as news, Originator:
420 field name is used instead of Sender:.
421
422 5.6 Redistribute and Resent-*: header fields
423
424 When a message is dispatched in redistribution mode, addresses etc.
425 concerning to redistribution are shown in Resent-To:, Resent-Cc:, Resent-Dcc:,
426 Resent-Bcc:, Resent-From:, Resent-Reply-To:, Resent-Sender:, Resent-Date: and
427 Resent-Message-Id: instead of To:, Cc:, Dcc:, Bcc:, From:, Reply-To:, Sender:,
428 Date: and Message-Id:. If Resent-*: header fields exist already, they are
429 rewritten to Prev-Resent-*: and new Resent-*: header fields for this redistri-
430 bution are added.
431
432 5.7 Return-Receipt-To:
433
434 So far, Return-Receipt-To: header field is used to request notification of
435 successful delivery. Return-Receipt-To: is obsolete and SMTP extension for
436 DSN (Delivery Status Notification) is defined in RFC1891 which can be used
437 for telling to the receiver to respond about result of delivery.
438 With imput, Return-Receipt-To: header field is deleted but the request is
439 passed to the receiver in RFC1891 way. However, it is likely not to function
440 if any MTA in a route to destination does not support RFC1891.
441
442 5.8 posting to news
443
444 When Newsgroups: header field exists or newsgroups are specified with --Group
445 option, the message is posted to news system.
446 It fails unless all of the following header field exist:
447 From: ,Subject: ,Newsgroups:
448 since news system will check the existence of these header fields. Moreover,
449 message body should not be empty.
450
451 When following header fields already exist when dispatching to news system,
452 the message will rejected (for instance, INN1.4 etc.):
453 Path:, Received:, Return-Path:, NNTP-Posting-Host:, Xref:
454 Therefore, these header fields are automatically deleted with imput for
455 posting to news system. Moreover, when --NewsCheck option specified,
456 even if Newsgroups: header field exists:, imput will not attempt to post
457 if the following header fields are exist:
458 To: ,Cc: ,Apparently-To:
459
460 Newsgroups: header in a message will be converted into X-Newsgroups:
461 header when sending the message as mail at the same time. Moreover,
462 to avoid sending X-Newsgroups: header information to recipients of the
463 message as mail, use BNewsgroups: header to specify news group name instead.
464
465 5.9 Config:
466
467 value of Config: header field will be taken and specified configuration
468 block will be used in configuration files if it is specified to extract
469 addresses etc. information from header part of the message.
470
471 5.10 additional header fields
472
473 Lines: header field which indicates number of lines of the message is
474 generated automatically. Version information on imput will be shown in
475 X-Dispatcher: header field.
476
477
478 6. Error processing
479
480 When an error occurs when a message was about to be passed to a SMTP server
481 or a NNTP server, error processing is done. When --Queuing option is specified
482 at a case of temporary failure, the message is preserved in the queue.
483 When --Queuing option is not specified and temporary failure or permanent
484 error occurs, it is reported to the sender.
485 When --Report=yes option is specified, the error is notified to the sender
486 by mail. If a draft message is specified by --Message option (or equivalent
487 options), trash-processing (The character specified with --TrashMark will be
488 prepended to the file name) is done.
489 When --Report=no option is specified, the error message is written to
490 display and the message is preserved in the dead.letter file. However, when
491 draft message is specified by --Message option (or equivalent options), the
492 trash-processing is not done and the message file is left as it is and
493 the message is not preserved even in dead.letter.
494 In any case, the error is recorded in the dispatch log file (unless
495 recording to log file is suppressed).
496
497
498 7. Environmental, set file
499
500 A personal configuration file is ~/.im/Config and system wide one is
501 /usr/local/lib/im/Config by default. The configuration method is common
502 in all the "im" commands. However, a definition block which is delimited by
503 the "case" line can be defined to select special configuration.
504 The "case" line shows that a definition block starts there and the name of
505 the block is described after the word "case". Settings between from top of
506 the configuration file to the first "case" line of the file are treated as
507 default definition. To write default definitions behind "case" lines,
508 specify "case default". Definitions which can be shared by two or more block
509 are started with "case blockname1,blockname2" line.
510
511 A sample of configuration file is shown below:
512
513 Lines=3000
514 #Name=NAKAMURA Motonori
515
516 SMTPservers=mail.econ.kyoto-u.ac.jp
517 NNTPservers=news.kuis.kyoto-u.ac.jp
518 EmgSMTPsvrs=localhost
519 FromDomain=econ.kyoto-u.ac.jp
520 ToDomain=econ.kyoto-u.ac.jp
521 Org=Faculty of Economics, Kyoto University, Japan
522
523 case mew
524 FromDomain=mew.org
525 ToDomain=mew.org
526 Org=Internet Message Group
527
528
529 8. Format of queue file
530
531 When --JustQueuing option is specified or when --Queuing options is specified
532 and dispatch of a message fails (temporary failure), the message is preserved
533 in the queue. A preserved message is stored in a file and numbered from 1
534 sequentially. Content of a file is:
535
536 internal state
537 < empty line >
538 RFC822 header part
539 < empty line >
540 RFC822 body part
541
542 When imput is started with --QueueStatus option, information on preserved
543 messages is displayed. When imput is started with --ProcessQueue option,
544 delivery is attempted sequentially from the file of a small number.
545 Messages in which the delivery fails are left in the queue as it is as
546 long as it has not a permanent failure.
547
548
549 9. Format of dispatch log file
550
551 Dispatching activities are recorded in a file by one action one line.
552 Form is:
553
554 date time proto=[p] server=[s] id=[m] from=[f] to=[t] stat=[r]
555
556 and [p], [s], [m], [t], and [r] are as follows:
557
558 [p]: smtp processed with SMTP
559 esmtp processed with ESMTP
560 nntp processed with NNTP
561 fcc saved into FCC folder
562 queue queued in queue directory
563 dead-letter saved into dead.letter file on failure
564 draft processing on a draft message
565
566 [s]: server/port to connect
567 port information will be omitted when the port of default is used.
568 The final server will be recorded if all attempt to servers are
569 failed.
570
571 [m]: value of Message-Id: header
572
573 [f]: sender address (config)
574 "config" is a case name specified with Config: or --config option.
575 (config) is omitted if Config: or --config option is not specified.
576
577 [t]: recipient addresses, folder name or file name
578 delimited with ',' if there are multiple recipients.
579 addresses specified in BCC are enclosed with <>.
580
581 [r]: sent dispatched successfully
582 information on reception process ID etc are shown in ().
583 skipped skipped to the next server
584 failed was not dispatched successfully
585 reason of the failure is shown in ().
586 queued preservation to message queue
587 preserved the draft message was left as it is
588
589
590 10. Hooks
591
592 To want to make a special processing done personally in imput, the following
593 are prepared as hooks in the imput script.
594
595 $Hook_PreHeaderconv Just before the processing of the
596 ISO-2022-JP header conversion.
597 $Hook_PreFinalHeaderProc Just before the processing of the
598 final adjustment of headers.
599 $Hook_PreDispatching Just before the processing of the
600 delivery
601
602 Define a name of function to be called at that point.
603 The variables should be defined in script specified with --Require option.
604
605
606 11. Known Bugs
607
608 There might be a problem that the message cannot be dispatched on some
609 IRIX systems of SGI. In such case, remove the # (comment) mark in the middle
610 line of following lines in TcpTransaction.pm to activate 'print $CHAN " ";'.
611
612 ## if you have mysterious TCP/IP bug on IRIX/SGI
613 # print $CHAN " ";
614 ## endif
615
616 [end of document]