Mercurial > emacs
comparison lisp/mail/feedmail.el @ 22801:e71025b5e000
Avoid using all-caps for non-arguments.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Wed, 22 Jul 1998 19:02:16 +0000 |
parents | 125816f37462 |
children | dbd281c0a5bf |
comparison
equal
deleted
inserted
replaced
22800:125816f37462 | 22801:e71025b5e000 |
---|---|
91 ;; there is also a queue for draft messages | 91 ;; there is also a queue for draft messages |
92 ;; | 92 ;; |
93 ;; --- you can get one last look at the prepped outbound message and | 93 ;; --- you can get one last look at the prepped outbound message and |
94 ;; be prompted for confirmation | 94 ;; be prompted for confirmation |
95 ;; | 95 ;; |
96 ;; --- removes BCC:/RESENT-BCC: headers after getting address info | 96 ;; --- removes Bcc:/Resent-Bcc: headers after getting address info |
97 ;; | 97 ;; |
98 ;; --- does smart filling of address headers | 98 ;; --- does smart filling of address headers |
99 ;; | 99 ;; |
100 ;; --- calls a routine to process FCC: lines and removes them | 100 ;; --- calls a routine to process Fcc: lines and removes them |
101 ;; | 101 ;; |
102 ;; --- empty headers are removed | 102 ;; --- empty headers are removed |
103 ;; | 103 ;; |
104 ;; --- can force FROM: or SENDER: line | 104 ;; --- can force From: or Sender: line |
105 ;; | 105 ;; |
106 ;; --- can generate a MESSAGE-ID: line | 106 ;; --- can generate a Message-Id: line |
107 ;; | 107 ;; |
108 ;; --- can generate a DATE: line; the date can be the time the | 108 ;; --- can generate a Date: line; the date can be the time the |
109 ;; message was written or the time it is being sent | 109 ;; message was written or the time it is being sent |
110 ;; | 110 ;; |
111 ;; --- strips comments from address info (both "()" and "<>" are | 111 ;; --- strips comments from address info (both "()" and "<>" are |
112 ;; handled via a call to mail-strip-quoted-names); the | 112 ;; handled via a call to mail-strip-quoted-names); the |
113 ;; comments are stripped in the simplified address list given | 113 ;; comments are stripped in the simplified address list given |
122 ;; list | 122 ;; list |
123 ;; | 123 ;; |
124 ;; --- you can specify something other than /bin/mail for the | 124 ;; --- you can specify something other than /bin/mail for the |
125 ;; subprocess | 125 ;; subprocess |
126 ;; | 126 ;; |
127 ;; --- you can generate/modify an X-MAILER: message header | 127 ;; --- you can generate/modify an X-Mailer: message header |
128 ;; | 128 ;; |
129 ;; After a long list of options below, you will find the function | 129 ;; After a long list of options below, you will find the function |
130 ;; feedmail-send-it. Hers's the best way to use the stuff in this | 130 ;; feedmail-send-it. Hers's the best way to use the stuff in this |
131 ;; file: | 131 ;; file: |
132 ;; | 132 ;; |
191 ;; patchlevel 4, issued by someone else | 191 ;; patchlevel 4, issued by someone else |
192 ;; patchlevel 5, issued by someone else | 192 ;; patchlevel 5, issued by someone else |
193 ;; patchlevel 6, not issued as far as I know | 193 ;; patchlevel 6, not issued as far as I know |
194 ;; patchlevel 7, 20 May 1997 | 194 ;; patchlevel 7, 20 May 1997 |
195 ;; abandon futile support of Emacs 18 (sorry if that hurts you) | 195 ;; abandon futile support of Emacs 18 (sorry if that hurts you) |
196 ;; provide a DATE: header by default | 196 ;; provide a Date: header by default |
197 ;; provide a default for generating MESSAGE-ID: header contents | 197 ;; provide a default for generating Message-Id: header contents |
198 ;; and use it by default (slightly changed API) | 198 ;; and use it by default (slightly changed API) |
199 ;; return value from feedmail-run-the-queue | 199 ;; return value from feedmail-run-the-queue |
200 ;; new wrapper function feedmail-run-the-queue-no-prompts | 200 ;; new wrapper function feedmail-run-the-queue-no-prompts |
201 ;; user-mail-address as default for FROM: | 201 ;; user-mail-address as default for From: |
202 ;; properly deal with RESENT-{TO,CC,BCC} | 202 ;; properly deal with Resent-{To,Cc,Bcc} |
203 ;; BCC and RESENT-* now included in smart filling | 203 ;; Bcc and Resent-* now included in smart filling |
204 ;; limited support for a "drafts" directory | 204 ;; limited support for a "drafts" directory |
205 ;; user-configurable default message action | 205 ;; user-configurable default message action |
206 ;; allow timeout for confirmation prompt (where available) | 206 ;; allow timeout for confirmation prompt (where available) |
207 ;; move FCC handling to as late as possible to get max | 207 ;; move Fcc handling to as late as possible to get max |
208 ;; header munging in the saved file | 208 ;; header munging in the saved file |
209 ;; work around sendmail.el's prompts when working from queue | 209 ;; work around sendmail.el's prompts when working from queue |
210 ;; more reliably detect voluntary user bailouts | 210 ;; more reliably detect voluntary user bailouts |
211 ;; offer to save modified buffers visiting queue files | 211 ;; offer to save modified buffers visiting queue files |
212 ;; offer to delete old file copies of messages being queued | 212 ;; offer to delete old file copies of messages being queued |
238 ;; eliminate reliance on directory-sep-char and feedmail-sep-thing | 238 ;; eliminate reliance on directory-sep-char and feedmail-sep-thing |
239 ;; tweak smart filling (reminded of comma problem by levitte@lp.se) | 239 ;; tweak smart filling (reminded of comma problem by levitte@lp.se) |
240 ;; option to control writing in text vs binary mode | 240 ;; option to control writing in text vs binary mode |
241 ;; patchlevel 8, 15 June 1998 | 241 ;; patchlevel 8, 15 June 1998 |
242 ;; reliable re-editing of text-mode (vs binary) queued messages | 242 ;; reliable re-editing of text-mode (vs binary) queued messages |
243 ;; user option to keep BCC: in FCC: copy (keep by default) | 243 ;; user option to keep Bcc: in Fcc: copy (keep by default) |
244 ;; user option to delete body from FCC: copy (keep by default) | 244 ;; user option to delete body from Fcc: copy (keep by default) |
245 ;; feedmail-deduce-bcc-where for envelope (API change for | 245 ;; feedmail-deduce-bcc-where for envelope (API change for |
246 ;; feedmail-deduce-address list) | 246 ;; feedmail-deduce-address list) |
247 ;; feedmail-queue-alternative-mail-header-separator | 247 ;; feedmail-queue-alternative-mail-header-separator |
248 ;; at message action prompt, "I"/"S" bypass message confirmation prompt | 248 ;; at message action prompt, "I"/"S" bypass message confirmation prompt |
249 ;; feedmail-mail-send-hook-splitter, feedmail-mail-send-hook, | 249 ;; feedmail-mail-send-hook-splitter, feedmail-mail-send-hook, |
261 ;; feedmail-queue-reminder, feedmail-queue-reminder-alist (after suggestions | 261 ;; feedmail-queue-reminder, feedmail-queue-reminder-alist (after suggestions |
262 ;; and/or code fragments from tonyl@Eng.Sun.COM (Tony Lam) and | 262 ;; and/or code fragments from tonyl@Eng.Sun.COM (Tony Lam) and |
263 ;; burge@newvision.com (Shane Burgess); bumped up the default value of | 263 ;; burge@newvision.com (Shane Burgess); bumped up the default value of |
264 ;; feedmail-queue-chatty-sit-for since info is more complex sometimes | 264 ;; feedmail-queue-chatty-sit-for since info is more complex sometimes |
265 ;; feedmail-enable-spray (individual transmissions, crude mailmerge) | 265 ;; feedmail-enable-spray (individual transmissions, crude mailmerge) |
266 ;; blank SUBJECT: no longer a special case; see feedmail-nuke-empty-headers | 266 ;; blank Subject: no longer a special case; see feedmail-nuke-empty-headers |
267 ;; fiddle-plexes data structure used lots of places; see feedmail-fiddle-plex-blurb | 267 ;; fiddle-plexes data structure used lots of places; see feedmail-fiddle-plex-blurb |
268 ;; feedmail-fiddle-plex-user-list | 268 ;; feedmail-fiddle-plex-user-list |
269 ;; feedmail-is-a-resend | 269 ;; feedmail-is-a-resend |
270 ;; honor mail-from-style in constructing default for feedmail-from-line | 270 ;; honor mail-from-style in constructing default for feedmail-from-line |
271 ;; re-implement feedmail-from-line and feedmail-sender-line with | 271 ;; re-implement feedmail-from-line and feedmail-sender-line with |
343 :type '(choice (const nil) integer) | 343 :type '(choice (const nil) integer) |
344 ) | 344 ) |
345 | 345 |
346 | 346 |
347 (defcustom feedmail-nuke-bcc t | 347 (defcustom feedmail-nuke-bcc t |
348 "*If non-nil remove BCC: lines from the message headers. | 348 "*If non-nil remove Bcc: lines from the message headers. |
349 In any case, the BCC: lines do participate in the composed address | 349 In any case, the Bcc: lines do participate in the composed address |
350 list. You may want to leave them in if you're using sendmail | 350 list. You may want to leave them in if you're using sendmail |
351 \(see feedmail-buffer-eating-function\)." | 351 \(see feedmail-buffer-eating-function\)." |
352 :group 'feedmail-headers | 352 :group 'feedmail-headers |
353 :type 'boolean | 353 :type 'boolean |
354 ) | 354 ) |
355 | 355 |
356 | 356 |
357 (defcustom feedmail-nuke-resent-bcc t | 357 (defcustom feedmail-nuke-resent-bcc t |
358 "*If non-nil remove RESENT-BCC: lines from the message headers. | 358 "*If non-nil remove Resent-Bcc: lines from the message headers. |
359 In any case, the RESENT-BCC: lines do participate in the composed | 359 In any case, the Resent-Bcc: lines do participate in the composed |
360 address list. You may want to leave them in if you're using sendmail | 360 address list. You may want to leave them in if you're using sendmail |
361 \(see feedmail-buffer-eating-function\)." | 361 \(see feedmail-buffer-eating-function\)." |
362 :group 'feedmail-headers | 362 :group 'feedmail-headers |
363 :type 'boolean | 363 :type 'boolean |
364 ) | 364 ) |
375 or, it can be set to the symbol 'last, in which case they will appear | 375 or, it can be set to the symbol 'last, in which case they will appear |
376 at the end of the list. | 376 at the end of the list. |
377 | 377 |
378 Why should you care? Well, maybe you don't, and certainly the same | 378 Why should you care? Well, maybe you don't, and certainly the same |
379 things could be accomplished by affecting the order of message headers | 379 things could be accomplished by affecting the order of message headers |
380 in the outgoing message. Some people use BCC: as a way of getting | 380 in the outgoing message. Some people use Bcc: as a way of getting |
381 their own \"come back\" copy of each message they send. If BCC: | 381 their own \"come back\" copy of each message they send. If Bcc: |
382 addresses are not handled first, there can be substantial delays in | 382 addresses are not handled first, there can be substantial delays in |
383 seeing the message again. Some configurations of sendmail, for example, | 383 seeing the message again. Some configurations of sendmail, for example, |
384 seem to try to deliver to each addressee at least once, immediately | 384 seem to try to deliver to each addressee at least once, immediately |
385 and serially, so slow SMTP conversations can add up to a delay. There | 385 and serially, so slow SMTP conversations can add up to a delay. There |
386 is an option for either 'first or 'last because you might have a | 386 is an option for either 'first or 'last because you might have a |
392 | 392 |
393 (defcustom feedmail-fill-to-cc t | 393 (defcustom feedmail-fill-to-cc t |
394 "*If non-nil do smart filling of addressee header lines. | 394 "*If non-nil do smart filling of addressee header lines. |
395 Smart filling means breaking long lines at appropriate points and | 395 Smart filling means breaking long lines at appropriate points and |
396 making continuation lines. Despite the function name, it includes | 396 making continuation lines. Despite the function name, it includes |
397 TO:, CC:, BCC: (and their RESENT-* forms), as well as FROM: and | 397 To:, Cc:, Bcc: (and their Resent-* forms), as well as From: and |
398 REPLY-TO: (though they seldom need it). If nil, the lines are left | 398 Reply-To: (though they seldom need it). If nil, the lines are left |
399 as-is. The filling is done after mail address alias expansion." | 399 as-is. The filling is done after mail address alias expansion." |
400 :group 'feedmail-headers | 400 :group 'feedmail-headers |
401 :type 'boolean | 401 :type 'boolean |
402 ) | 402 ) |
403 | 403 |
408 :type 'integer | 408 :type 'integer |
409 ) | 409 ) |
410 | 410 |
411 | 411 |
412 (defcustom feedmail-nuke-bcc-in-fcc nil | 412 (defcustom feedmail-nuke-bcc-in-fcc nil |
413 "*If non-nil remove [RESENT-]BCC: lines in message copies saved via FCC:. | 413 "*If non-nil remove [Resent-]Bcc: lines in message copies saved via Fcc:. |
414 This is independent of whether the BCC: header lines are actually sent | 414 This is independent of whether the Bcc: header lines are actually sent |
415 with the message (see feedmail-nuke-bcc). Though not implied in the name, | 415 with the message (see feedmail-nuke-bcc). Though not implied in the name, |
416 the same FCC: treatment applies to both BCC: and RESENT-BCC: lines." | 416 the same Fcc: treatment applies to both Bcc: and Resent-Bcc: lines." |
417 :group 'feedmail-headers | 417 :group 'feedmail-headers |
418 :type 'boolean | 418 :type 'boolean |
419 ) | 419 ) |
420 | 420 |
421 | 421 |
422 (defcustom feedmail-nuke-body-in-fcc nil | 422 (defcustom feedmail-nuke-body-in-fcc nil |
423 "*If non-nil remove body of message in copies saved via FCC:. | 423 "*If non-nil remove body of message in copies saved via Fcc:. |
424 If an positive integer value, leave (up to) that many lines of the | 424 If an positive integer value, leave (up to) that many lines of the |
425 beginning of the body intact. The result is that the FCC: copy will | 425 beginning of the body intact. The result is that the Fcc: copy will |
426 consist only of the message headers, serving as a sort of an outgoing | 426 consist only of the message headers, serving as a sort of an outgoing |
427 message log." | 427 message log." |
428 :group 'feedmail-headers | 428 :group 'feedmail-headers |
429 ;;:type 'boolean | 429 ;;:type 'boolean |
430 :type '(choice (const nil) (const t) integer) | 430 :type '(choice (const nil) (const t) integer) |
443 ) | 443 ) |
444 | 444 |
445 | 445 |
446 (defcustom feedmail-nuke-empty-headers t | 446 (defcustom feedmail-nuke-empty-headers t |
447 "*If non-nil, remove header lines which have no contents. | 447 "*If non-nil, remove header lines which have no contents. |
448 A completely empty SUBJECT: header is always removed, regardless of | 448 A completely empty Subject: header is always removed, regardless of |
449 the setting of this variable. The only time you would want them left | 449 the setting of this variable. The only time you would want them left |
450 in would be if you used some headers whose presence indicated | 450 in would be if you used some headers whose presence indicated |
451 something rather than their contents. This is rare in Internet email | 451 something rather than their contents. This is rare in Internet email |
452 but common in some proprietary systems." | 452 but common in some proprietary systems." |
453 :group 'feedmail-headers | 453 :group 'feedmail-headers |
454 :type 'boolean | 454 :type 'boolean |
455 ) | 455 ) |
456 | 456 |
457 ;; wjc sez: I think the use of the SENDER: line is pretty pointless, | 457 ;; wjc sez: I think the use of the Sender: line is pretty pointless, |
458 ;; but I left it in to be compatible with sendmail.el and because | 458 ;; but I left it in to be compatible with sendmail.el and because |
459 ;; maybe some distant mail system needs it. Really, though, if you | 459 ;; maybe some distant mail system needs it. Really, though, if you |
460 ;; want a sender line in your mail, just put one in there and don't | 460 ;; want a sender line in your mail, just put one in there and don't |
461 ;; wait for feedmail to do it for you. (Yes, I know all about | 461 ;; wait for feedmail to do it for you. (Yes, I know all about |
462 ;; RFC-822 and RFC-1123, but are you *really* one of those cases | 462 ;; RFC-822 and RFC-1123, but are you *really* one of those cases |
463 ;; they're talking about? I doubt it.) | 463 ;; they're talking about? I doubt it.) |
464 (defcustom feedmail-sender-line nil | 464 (defcustom feedmail-sender-line nil |
465 "*If non-nil and the email has no SENDER: header, use this value. | 465 "*If non-nil and the email has no Sender: header, use this value. |
466 May be nil, in which case nothing in particular is done with respect | 466 May be nil, in which case nothing in particular is done with respect |
467 to SENDER: lines. By design, will not replace an existing SENDER: | 467 to Sender: lines. By design, will not replace an existing Sender: |
468 line, but you can achieve that with a fiddle-plex 'replace action. | 468 line, but you can achieve that with a fiddle-plex 'replace action. |
469 NB: it makes no sense to use the value t since there is no sensible | 469 NB: it makes no sense to use the value t since there is no sensible |
470 default for SENDER:. | 470 default for Sender:. |
471 | 471 |
472 If not nil, it may be a string, a fiddle-plex, or a function which | 472 If not nil, it may be a string, a fiddle-plex, or a function which |
473 returns either nil, t, a string, or a fiddle-plex (or, in fact, | 473 returns either nil, t, a string, or a fiddle-plex (or, in fact, |
474 another function, but let's not be ridiculous). If a string, it | 474 another function, but let's not be ridiculous). If a string, it |
475 should be just the contents of the header, not the name of the header | 475 should be just the contents of the header, not the name of the header |
479 cases the name element of the fiddle-plex is ignored and is hardwired | 479 cases the name element of the fiddle-plex is ignored and is hardwired |
480 by feedmail to either \"X-Sender\" or \"X-Resent-Sender\". | 480 by feedmail to either \"X-Sender\" or \"X-Resent-Sender\". |
481 | 481 |
482 You can probably leave this nil, but if you feel like using it, a good | 482 You can probably leave this nil, but if you feel like using it, a good |
483 value would be a string of a fully-qualified domain name form of your | 483 value would be a string of a fully-qualified domain name form of your |
484 address. For example, \"bill@bubblegum.net (WJCarpenter)\". The SENDER: | 484 address. For example, \"bill@bubblegum.net (WJCarpenter)\". The Sender: |
485 header is fiddled after the FROM: header is fiddled." | 485 header is fiddled after the From: header is fiddled." |
486 :group 'feedmail-headers | 486 :group 'feedmail-headers |
487 :type '(choice (const nil) string) | 487 :type '(choice (const nil) string) |
488 ) | 488 ) |
489 | 489 |
490 | 490 |
491 (defcustom feedmail-force-binary-write t | 491 (defcustom feedmail-force-binary-write t |
492 "*If non-nil, force writing file as binary (this applies to queues and FCC:). | 492 "*If non-nil, force writing file as binary (this applies to queues and Fcc:). |
493 On systems where there is a difference between binary and text files, | 493 On systems where there is a difference between binary and text files, |
494 feedmail will temporarily manipulate the values of `buffer-file-type' | 494 feedmail will temporarily manipulate the values of `buffer-file-type' |
495 and/or default-buffer-file-type to make the writing as binary. If | 495 and/or default-buffer-file-type to make the writing as binary. If |
496 nil, writing will be in text mode. On systems where there is no | 496 nil, writing will be in text mode. On systems where there is no |
497 distinction or where it is controlled by other variables or other | 497 distinction or where it is controlled by other variables or other |
500 :type 'boolean | 500 :type 'boolean |
501 ) | 501 ) |
502 | 502 |
503 | 503 |
504 (defcustom feedmail-from-line t | 504 (defcustom feedmail-from-line t |
505 "*If non-nil and the email has no FROM: header, use this value. | 505 "*If non-nil and the email has no From: header, use this value. |
506 May be t, in which case a default is computed (and you probably won't | 506 May be t, in which case a default is computed (and you probably won't |
507 be happy with it). May be nil, in which case nothing in particular is | 507 be happy with it). May be nil, in which case nothing in particular is |
508 done with respect to FROM: lines. By design, will not replace an | 508 done with respect to From: lines. By design, will not replace an |
509 existing FROM: line, but you can achieve that with a fiddle-plex 'replace | 509 existing From: line, but you can achieve that with a fiddle-plex 'replace |
510 action. | 510 action. |
511 | 511 |
512 If neither nil nor t, it may be a string, a fiddle-plex, or a function | 512 If neither nil nor t, it may be a string, a fiddle-plex, or a function |
513 which returns either nil, t, a string, or a fiddle-plex (or, in fact, | 513 which returns either nil, t, a string, or a fiddle-plex (or, in fact, |
514 another function, but let's not be ridiculous). If a string, it | 514 another function, but let's not be ridiculous). If a string, it |
523 your address. For example, \"bill@bubblegum.net (WJCarpenter)\". The | 523 your address. For example, \"bill@bubblegum.net (WJCarpenter)\". The |
524 default value of this variable uses the standard elisp variable | 524 default value of this variable uses the standard elisp variable |
525 `user-mail-address' which should be set on every system but has a decent | 525 `user-mail-address' which should be set on every system but has a decent |
526 chance of being wrong. It also honors `mail-from-style'. Better to set | 526 chance of being wrong. It also honors `mail-from-style'. Better to set |
527 this variable explicitly to the string you want or find some other way | 527 this variable explicitly to the string you want or find some other way |
528 to arrange for the message to get a FROM: line." | 528 to arrange for the message to get a From: line." |
529 :group 'feedmail-headers | 529 :group 'feedmail-headers |
530 :type '(choice (const nil) string) | 530 :type '(choice (const nil) string) |
531 ) | 531 ) |
532 | 532 |
533 | 533 |
534 (defcustom feedmail-deduce-envelope-from t | 534 (defcustom feedmail-deduce-envelope-from t |
535 "*If non-nil, deduce message envelope \"from\" from header FROM: or SENDER:. | 535 "*If non-nil, deduce message envelope \"from\" from header From: or Sender:. |
536 In other words, if there is a SENDER: header in the message, temporarily | 536 In other words, if there is a Sender: header in the message, temporarily |
537 change the value of `user-mail-address' to be the same while the message | 537 change the value of `user-mail-address' to be the same while the message |
538 is being sent. If there is no SENDER: header, use the FROM: header, | 538 is being sent. If there is no Sender: header, use the From: header, |
539 if any. Address values are taken from the actual message just before | 539 if any. Address values are taken from the actual message just before |
540 it is sent, and the process is independent of the values of | 540 it is sent, and the process is independent of the values of |
541 feedmail-from-line and/or feedmail-sender-line. | 541 feedmail-from-line and/or feedmail-sender-line. |
542 | 542 |
543 There are many and good reasons for having the message header | 543 There are many and good reasons for having the message header |
544 FROM:/SENDER: be different from the message envelope \"from\" | 544 From:/Sender: be different from the message envelope \"from\" |
545 information. However, for most people and for most circumstances, it | 545 information. However, for most people and for most circumstances, it |
546 is usual for them to be the same (this is probably especially true for | 546 is usual for them to be the same (this is probably especially true for |
547 the case where the user doesn't understand the difference between the | 547 the case where the user doesn't understand the difference between the |
548 two in the first place). | 548 two in the first place). |
549 | 549 |
550 The idea behind this feature is that you can have everything set up | 550 The idea behind this feature is that you can have everything set up |
551 some normal way for yourself. If for some reason you want to send a | 551 some normal way for yourself. If for some reason you want to send a |
552 message with another FROM: line, you can just type it at the top of | 552 message with another From: line, you can just type it at the top of |
553 the message, and feedmail will take care of \"fixing up\" the envelope | 553 the message, and feedmail will take care of \"fixing up\" the envelope |
554 \"from\". This only works for mail senders which make use of | 554 \"from\". This only works for mail senders which make use of |
555 `user-mail-address' as the envelope \"from\" value. For some mail | 555 `user-mail-address' as the envelope \"from\" value. For some mail |
556 senders (e.g., feedmail-buffer-to-bin-mail), there is no simple way to | 556 senders (e.g., feedmail-buffer-to-bin-mail), there is no simple way to |
557 influence what they will use as the envelope." | 557 influence what they will use as the envelope." |
566 :type '(choice (const nil) string) | 566 :type '(choice (const nil) string) |
567 ) | 567 ) |
568 | 568 |
569 | 569 |
570 (defcustom feedmail-x-mailer-line t | 570 (defcustom feedmail-x-mailer-line t |
571 "*Control the form of an X-MAILER: header in an outgoing message. | 571 "*Control the form of an X-Mailer: header in an outgoing message. |
572 Moderately useful for debugging, keeping track of your correspondents' | 572 Moderately useful for debugging, keeping track of your correspondents' |
573 mailer preferences, or just wearing your MUA on your sleeve. You | 573 mailer preferences, or just wearing your MUA on your sleeve. You |
574 should probably know that some people are fairly emotional about the | 574 should probably know that some people are fairly emotional about the |
575 presence of X-MAILER: lines in email. | 575 presence of X-Mailer: lines in email. |
576 | 576 |
577 If nil, nothing is done about X-MAILER:. | 577 If nil, nothing is done about X-Mailer:. |
578 | 578 |
579 If t, an X-MAILER: header of a predetermined format is produced, | 579 If t, an X-Mailer: header of a predetermined format is produced, |
580 combining its efforts with any existing X-MAILER: header. If you want | 580 combining its efforts with any existing X-Mailer: header. If you want |
581 to take the default construct and just add a little blob of your own | 581 to take the default construct and just add a little blob of your own |
582 at the end, define the variable feedmail-x-mailer-line-user-appendage | 582 at the end, define the variable feedmail-x-mailer-line-user-appendage |
583 as that blob string. A value of t is equivalent to using the function | 583 as that blob string. A value of t is equivalent to using the function |
584 feedmail-default-x-mailer-generator. | 584 feedmail-default-x-mailer-generator. |
585 | 585 |
596 :type '(choice (const t) (const nil) string function) | 596 :type '(choice (const t) (const nil) string function) |
597 ) | 597 ) |
598 | 598 |
599 | 599 |
600 (defcustom feedmail-message-id-generator t | 600 (defcustom feedmail-message-id-generator t |
601 "*Specifies the creation of a MESSAGE-ID: header field. | 601 "*Specifies the creation of a Message-Id: header field. |
602 | 602 |
603 If nil, nothing is done about MESSAGE-ID:. | 603 If nil, nothing is done about Message-Id:. |
604 | 604 |
605 If t, a MESSAGE-ID: header of a predetermined format is produced, but | 605 If t, a Message-Id: header of a predetermined format is produced, but |
606 only if there is not already a MESSAGE-ID: in the message. A value of | 606 only if there is not already a Message-Id: in the message. A value of |
607 t is equivalent to using the function feedmail-default-message-id-generator. | 607 t is equivalent to using the function feedmail-default-message-id-generator. |
608 | 608 |
609 If neither nil nor t, it may be a string, a fiddle-plex, or a function | 609 If neither nil nor t, it may be a string, a fiddle-plex, or a function |
610 which returns either nil, t, a string, or a fiddle-plex (or, in fact, | 610 which returns either nil, t, a string, or a fiddle-plex (or, in fact, |
611 another function, but let's not be ridiculous). If a string, it | 611 another function, but let's not be ridiculous). If a string, it |
613 itself nor the trailing newline. If a function, it will be called | 613 itself nor the trailing newline. If a function, it will be called |
614 with one argument: the possibly-nil name of the file associated with | 614 with one argument: the possibly-nil name of the file associated with |
615 the message buffer. For an explanation of fiddle-plexes, see the | 615 the message buffer. For an explanation of fiddle-plexes, see the |
616 documentation for the variable feedmail-fiddle-plex-blurb. In all | 616 documentation for the variable feedmail-fiddle-plex-blurb. In all |
617 cases the name element of the fiddle-plex is ignored and is hardwired | 617 cases the name element of the fiddle-plex is ignored and is hardwired |
618 by feedmail to either \"Message-ID\" or \"Resent-Message-ID\". | 618 by feedmail to either \"Message-Id\" or \"Resent-Message-Id\". |
619 | 619 |
620 You should let feedmail generate a MESSAGE-ID: for you unless you are sure | 620 You should let feedmail generate a Message-Id: for you unless you are sure |
621 that whatever you give your messages to will do it for you (e.g., most | 621 that whatever you give your messages to will do it for you (e.g., most |
622 configurations of sendmail). Even if the latter case is true, it | 622 configurations of sendmail). Even if the latter case is true, it |
623 probably won't hurt you to generate your own, and it will then show up | 623 probably won't hurt you to generate your own, and it will then show up |
624 in the saved message if you use FCC:." | 624 in the saved message if you use Fcc:." |
625 :group 'feedmail-headers | 625 :group 'feedmail-headers |
626 :type '(choice (const nil) function) | 626 :type '(choice (const nil) function) |
627 ) | 627 ) |
628 | 628 |
629 | 629 |
641 ) | 641 ) |
642 | 642 |
643 ;; this was suggested in various forms by several people; first was | 643 ;; this was suggested in various forms by several people; first was |
644 ;; Tony DeSimone in Oct 1992; sorry to be so tardy | 644 ;; Tony DeSimone in Oct 1992; sorry to be so tardy |
645 (defcustom feedmail-date-generator t | 645 (defcustom feedmail-date-generator t |
646 "*Specifies the creation of a DATE: header field. | 646 "*Specifies the creation of a Date: header field. |
647 | 647 |
648 If nil, nothing is done about DATE:. | 648 If nil, nothing is done about Date:. |
649 | 649 |
650 If t, a DATE: header of a predetermined format is produced, but only | 650 If t, a Date: header of a predetermined format is produced, but only |
651 if there is not already a DATE: in the message. A value of t is | 651 if there is not already a Date: in the message. A value of t is |
652 equivalent to using the function feedmail-default-date-generator. | 652 equivalent to using the function feedmail-default-date-generator. |
653 | 653 |
654 If neither nil nor t, it may be a string, a fiddle-plex, or a function | 654 If neither nil nor t, it may be a string, a fiddle-plex, or a function |
655 which returns either nil, t, a string, or a fiddle-plex (or, in fact, | 655 which returns either nil, t, a string, or a fiddle-plex (or, in fact, |
656 another function, but let's not be ridiculous). If a string, it | 656 another function, but let's not be ridiculous). If a string, it |
664 | 664 |
665 If you decide to format your own date field, do us all a favor and know | 665 If you decide to format your own date field, do us all a favor and know |
666 what you're doing. Study the relevant parts of RFC-822 and RFC-1123. | 666 what you're doing. Study the relevant parts of RFC-822 and RFC-1123. |
667 Don't make me come up there! | 667 Don't make me come up there! |
668 | 668 |
669 You should let feedmail generate a DATE: for you unless you are sure | 669 You should let feedmail generate a Date: for you unless you are sure |
670 that whatever you give your messages to will do it for you (e.g., most | 670 that whatever you give your messages to will do it for you (e.g., most |
671 configurations of sendmail). Even if the latter case is true, it | 671 configurations of sendmail). Even if the latter case is true, it |
672 probably won't hurt you to generate your own, and it will then show up | 672 probably won't hurt you to generate your own, and it will then show up |
673 in the saved message if you use FCC:." | 673 in the saved message if you use Fcc:." |
674 :group 'feedmail-headers | 674 :group 'feedmail-headers |
675 :type '(choice (const nil) function) | 675 :type '(choice (const nil) function) |
676 ) | 676 ) |
677 | 677 |
678 | 678 |
716 message headers except as noted. | 716 message headers except as noted. |
717 | 717 |
718 Spray mode is usually pointless, and if you can't think of a good reason for | 718 Spray mode is usually pointless, and if you can't think of a good reason for |
719 it, you should avoid it since it is inherently less efficient than normal | 719 it, you should avoid it since it is inherently less efficient than normal |
720 multiple delivery. One reason to use it is to overcome mis-featured mail | 720 multiple delivery. One reason to use it is to overcome mis-featured mail |
721 transports which betray your trust by revealing BCC: addressees in the | 721 transports which betray your trust by revealing Bcc: addressees in the |
722 headers of a message. Another use is to do a crude form of mailmerge, for | 722 headers of a message. Another use is to do a crude form of mailmerge, for |
723 which see feedmail-spray-address-fiddle-plex-list. | 723 which see feedmail-spray-address-fiddle-plex-list. |
724 | 724 |
725 If one of the calls to the buffer-eating function results in an error, | 725 If one of the calls to the buffer-eating function results in an error, |
726 what happens next is carelessly defined, so beware." | 726 what happens next is carelessly defined, so beware." |
740 `feedmail-fiddle-plex-blurb', for an overview of fiddle-plex data structures. | 740 `feedmail-fiddle-plex-blurb', for an overview of fiddle-plex data structures. |
741 | 741 |
742 May be nil, in which case nothing in particular is done about message | 742 May be nil, in which case nothing in particular is done about message |
743 headers for specific addresses. | 743 headers for specific addresses. |
744 | 744 |
745 May be t, in which case a \"TO:\" header is added to the message with | 745 May be t, in which case a \"To:\" header is added to the message with |
746 the stripped address as the header contents. The fiddle-plex operator | 746 the stripped address as the header contents. The fiddle-plex operator |
747 is 'supplement. | 747 is 'supplement. |
748 | 748 |
749 May be a string, in which case the string is assumed to be the name of | 749 May be a string, in which case the string is assumed to be the name of |
750 a message header field with the stripped address serving as the value. | 750 a message header field with the stripped address serving as the value. |
768 called and will consult feedmail-spray-this-address to find the | 768 called and will consult feedmail-spray-this-address to find the |
769 stripped envelope email address (no comments or angle brackets). The | 769 stripped envelope email address (no comments or angle brackets). The |
770 function should return an embellished form of the address. | 770 function should return an embellished form of the address. |
771 | 771 |
772 The recipe for sending form letters is: (1) create a message with all | 772 The recipe for sending form letters is: (1) create a message with all |
773 addressees on BCC: headers; (2) tell feedmail to remove BCC: headers | 773 addressees on Bcc: headers; (2) tell feedmail to remove Bcc: headers |
774 before sending the message; (3) create a function which will embellish | 774 before sending the message; (3) create a function which will embellish |
775 stripped addresses, if desired; (4) define feedmail-spray-address-fiddle-plex-list | 775 stripped addresses, if desired; (4) define feedmail-spray-address-fiddle-plex-list |
776 appropriately; (5) send the message with feedmail-enable-spray set | 776 appropriately; (5) send the message with feedmail-enable-spray set |
777 non-nil; (6) stand back and watch co-workers wonder at how efficient | 777 non-nil; (6) stand back and watch co-workers wonder at how efficient |
778 you are at accomplishing inherently inefficient things." | 778 you are at accomplishing inherently inefficient things." |
836 | 836 |
837 (defcustom feedmail-queue-draft-directory | 837 (defcustom feedmail-queue-draft-directory |
838 (if (memq system-type '(axp-vms vax-vms)) | 838 (if (memq system-type '(axp-vms vax-vms)) |
839 (expand-file-name (concat (getenv "HOME") "[.MAIL.DRAFT]")) | 839 (expand-file-name (concat (getenv "HOME") "[.MAIL.DRAFT]")) |
840 (concat (getenv "HOME") "/mail/draft")) | 840 (concat (getenv "HOME") "/mail/draft")) |
841 "*Name of an directory where DRAFT messages will be queued. | 841 "*Name of an directory where draft messages will be queued. |
842 Directory will be created if necessary. Should be a string that | 842 Directory will be created if necessary. Should be a string that |
843 doesn't end with a slash. Default, except on VMS, is \"$HOME/mail/draft\"." | 843 doesn't end with a slash. Default, except on VMS, is \"$HOME/mail/draft\"." |
844 :group 'feedmail-queue | 844 :group 'feedmail-queue |
845 :type 'string | 845 :type 'string |
846 ) | 846 ) |
988 :type '(choice (const nil) function) | 988 :type '(choice (const nil) function) |
989 ) | 989 ) |
990 | 990 |
991 | 991 |
992 (defcustom feedmail-queue-use-send-time-for-date nil | 992 (defcustom feedmail-queue-use-send-time-for-date nil |
993 "*If non-nil, use send time for the DATE: header value. | 993 "*If non-nil, use send time for the Date: header value. |
994 This variable is used by the default date generating function, | 994 This variable is used by the default date generating function, |
995 feedmail-default-date-generator. If nil, the default, the | 995 feedmail-default-date-generator. If nil, the default, the |
996 last-modified timestamp of the queue file is used to create the | 996 last-modified timestamp of the queue file is used to create the |
997 message DATE: header; if there is no queue file, the current time is | 997 message Date: header; if there is no queue file, the current time is |
998 used." | 998 used." |
999 :group 'feedmail-queue | 999 :group 'feedmail-queue |
1000 :type 'boolean | 1000 :type 'boolean |
1001 ) | 1001 ) |
1002 | 1002 |
1003 | 1003 |
1004 (defcustom feedmail-queue-use-send-time-for-message-id nil | 1004 (defcustom feedmail-queue-use-send-time-for-message-id nil |
1005 "*If non-nil, use send time for the MESSAGE-ID: header value. | 1005 "*If non-nil, use send time for the Message-Id: header value. |
1006 This variable is used by the default MESSAGE-ID: generating function, | 1006 This variable is used by the default Message-Id: generating function, |
1007 feedmail-default-message-id-generator. If nil, the default, the | 1007 feedmail-default-message-id-generator. If nil, the default, the |
1008 last-modified timestamp of the queue file is used to create the | 1008 last-modified timestamp of the queue file is used to create the |
1009 message MESSAGE-ID: header; if there is no queue file, the current time is | 1009 message Message-Id: header; if there is no queue file, the current time is |
1010 used." | 1010 used." |
1011 :group 'feedmail-queue | 1011 :group 'feedmail-queue |
1012 :type 'boolean | 1012 :type 'boolean |
1013 ) | 1013 ) |
1014 | 1014 |
1169 :type 'hook | 1169 :type 'hook |
1170 ) | 1170 ) |
1171 | 1171 |
1172 | 1172 |
1173 (defcustom feedmail-before-fcc-hook nil | 1173 (defcustom feedmail-before-fcc-hook nil |
1174 "*User's last opportunity to modify the message before FCC action. | 1174 "*User's last opportunity to modify the message before Fcc action. |
1175 It has already had all the header prepping from the standard package. | 1175 It has already had all the header prepping from the standard package. |
1176 The next step after running the hook will be to save the message via | 1176 The next step after running the hook will be to save the message via |
1177 FCC: processing. The hook might be interested in these: (1) | 1177 Fcc: processing. The hook might be interested in these: (1) |
1178 feedmail-prepped-text-buffer contains the header and body of the | 1178 feedmail-prepped-text-buffer contains the header and body of the |
1179 message, ready to go; (2) feedmail-address-list contains a list of | 1179 message, ready to go; (2) feedmail-address-list contains a list of |
1180 simplified recipients of addressees to whom the message was sent (3) | 1180 simplified recipients of addressees to whom the message was sent (3) |
1181 feedmail-error-buffer is an empty buffer intended to soak up errors | 1181 feedmail-error-buffer is an empty buffer intended to soak up errors |
1182 for display to the user. If the hook allows interactive activity, the | 1182 for display to the user. If the hook allows interactive activity, the |
1263 for different scenarios. Users shouldn't set or change this | 1263 for different scenarios. Users shouldn't set or change this |
1264 variable, but may depend on its value as described here.") | 1264 variable, but may depend on its value as described here.") |
1265 | 1265 |
1266 | 1266 |
1267 (defvar feedmail-is-a-resend nil | 1267 (defvar feedmail-is-a-resend nil |
1268 "*Non-nil means the the message is a RESEND (in the RFC-822 sense). | 1268 "*Non-nil means the the message is a Resend (in the RFC-822 sense). |
1269 This affects the composition of certain headers. feedmail sets this | 1269 This affects the composition of certain headers. feedmail sets this |
1270 variable as soon as it starts prepping the message text buffer, so any | 1270 variable as soon as it starts prepping the message text buffer, so any |
1271 user-supplied functions can rely on it. Users shouldn't set or change this | 1271 user-supplied functions can rely on it. Users shouldn't set or change this |
1272 variable, but may depend on its value as described here.") | 1272 variable, but may depend on its value as described here.") |
1273 | 1273 |
1289 | 1289 |
1290 | 1290 |
1291 (defcustom feedmail-binmail-template (if mail-interactive "/bin/mail %s" "/bin/rmail %s") | 1291 (defcustom feedmail-binmail-template (if mail-interactive "/bin/mail %s" "/bin/rmail %s") |
1292 "*Command template for the subprocess which will get rid of the mail. | 1292 "*Command template for the subprocess which will get rid of the mail. |
1293 It can result in any command understandable by /bin/sh. Might not | 1293 It can result in any command understandable by /bin/sh. Might not |
1294 work at all in non-UNIX environments. The single '%s', if present, | 1294 work at all in non-Unix environments. The single '%s', if present, |
1295 gets replaced by the space-separated, simplified list of addressees. | 1295 gets replaced by the space-separated, simplified list of addressees. |
1296 Used in feedmail-buffer-to-binmail to form the shell command which | 1296 Used in feedmail-buffer-to-binmail to form the shell command which |
1297 will receive the contents of the prepped buffer as stdin. If you'd | 1297 will receive the contents of the prepped buffer as stdin. If you'd |
1298 like your errors to come back as mail instead of immediately in a | 1298 like your errors to come back as mail instead of immediately in a |
1299 buffer, try /bin/rmail instead of /bin/mail (this can be accomplished | 1299 buffer, try /bin/rmail instead of /bin/mail (this can be accomplished |
1320 (mapconcat 'identity addr-listoid " ")))))) | 1320 (mapconcat 'identity addr-listoid " ")))))) |
1321 | 1321 |
1322 | 1322 |
1323 (defun feedmail-buffer-to-sendmail (prepped errors-to addr-listoid) | 1323 (defun feedmail-buffer-to-sendmail (prepped errors-to addr-listoid) |
1324 "Function which actually calls sendmail as a subprocess. | 1324 "Function which actually calls sendmail as a subprocess. |
1325 Feeds the buffer to it. Probably has some flaws for RESENT-* and other | 1325 Feeds the buffer to it. Probably has some flaws for Resent-* and other |
1326 complicated cases." | 1326 complicated cases." |
1327 (set-buffer prepped) | 1327 (set-buffer prepped) |
1328 (apply 'call-process-region | 1328 (apply 'call-process-region |
1329 (append (list (point-min) (point-max) | 1329 (append (list (point-min) (point-max) |
1330 (if (boundp 'sendmail-program) sendmail-program "/usr/lib/sendmail") | 1330 (if (boundp 'sendmail-program) sendmail-program "/usr/lib/sendmail") |
1849 ) | 1849 ) |
1850 | 1850 |
1851 (defun feedmail-queue-subject-slug-maker (&optional queue-directory) | 1851 (defun feedmail-queue-subject-slug-maker (&optional queue-directory) |
1852 "Create a name for storing the message in the queue. | 1852 "Create a name for storing the message in the queue. |
1853 Optional argument QUEUE-DIRECTORY specifies into which directory the | 1853 Optional argument QUEUE-DIRECTORY specifies into which directory the |
1854 file will be placed. The name is based on the SUBJECT: header (if | 1854 file will be placed. The name is based on the Subject: header (if |
1855 there is one). If there is no subject, | 1855 there is one). If there is no subject, |
1856 feedmail-queue-default-file-slug is consulted Special characters are | 1856 feedmail-queue-default-file-slug is consulted Special characters are |
1857 mapped to mostly alphanumerics for safety." | 1857 mapped to mostly alphanumerics for safety." |
1858 (let ((eoh-marker) (case-fold-search t) (subject "") (s-point)) | 1858 (let ((eoh-marker) (case-fold-search t) (subject "") (s-point)) |
1859 (setq eoh-marker (feedmail-find-eoh)) | 1859 (setq eoh-marker (feedmail-find-eoh)) |
1860 (goto-char (point-min)) | 1860 (goto-char (point-min)) |
1861 ;; get raw subject value (first line, anyhow) | 1861 ;; get raw subject value (first line, anyhow) |
1862 (if (re-search-forward "^SUBJECT:" eoh-marker t) | 1862 (if (re-search-forward "^Subject:" eoh-marker t) |
1863 (progn (setq s-point (point)) | 1863 (progn (setq s-point (point)) |
1864 (end-of-line) | 1864 (end-of-line) |
1865 (setq subject (buffer-substring s-point (point))))) | 1865 (setq subject (buffer-substring s-point (point))))) |
1866 (setq subject (feedmail-tidy-up-slug subject)) | 1866 (setq subject (feedmail-tidy-up-slug subject)) |
1867 (if (zerop (length subject)) | 1867 (if (zerop (length subject)) |
1962 (feedmail-raw-text-buffer (current-buffer)) | 1962 (feedmail-raw-text-buffer (current-buffer)) |
1963 (feedmail-address-list) | 1963 (feedmail-address-list) |
1964 (eoh-marker) | 1964 (eoh-marker) |
1965 (bcc-holder) | 1965 (bcc-holder) |
1966 (resent-bcc-holder) | 1966 (resent-bcc-holder) |
1967 (a-re-rtcb "^RESENT-\\(TO\\|CC\\|BCC\\):") | 1967 (a-re-rtcb "^Resent-\\(To\\|Cc\\|Bcc\\):") |
1968 (a-re-rtc "^RESENT-\\(TO\\|CC\\):") | 1968 (a-re-rtc "^Resent-\\(To\\|Cc\\):") |
1969 (a-re-rb "^RESENT-BCC:") | 1969 (a-re-rb "^Resent-Bcc:") |
1970 (a-re-dtcb "^\\(TO\\|CC\\|BCC\\):") | 1970 (a-re-dtcb "^\\(To\\|Cc\\|Bcc\\):") |
1971 (a-re-dtc "^\\(TO\\|CC\\):") | 1971 (a-re-dtc "^\\(To\\|Cc\\):") |
1972 (a-re-db "^BCC:") | 1972 (a-re-db "^Bcc:") |
1973 ;; to get a temporary changable copy | 1973 ;; to get a temporary changable copy |
1974 (mail-header-separator mail-header-separator) | 1974 (mail-header-separator mail-header-separator) |
1975 ) | 1975 ) |
1976 (unwind-protect | 1976 (unwind-protect |
1977 (save-excursion | 1977 (save-excursion |
2012 ;; use resent-* stuff only if there is at least one non-empty one | 2012 ;; use resent-* stuff only if there is at least one non-empty one |
2013 (setq feedmail-is-a-resend | 2013 (setq feedmail-is-a-resend |
2014 (re-search-forward | 2014 (re-search-forward |
2015 ;; header name, followed by optional whitespace, followed by | 2015 ;; header name, followed by optional whitespace, followed by |
2016 ;; non-whitespace, followed by anything, followed by newline; | 2016 ;; non-whitespace, followed by anything, followed by newline; |
2017 ;; the idea is empty RESENT-* headers are ignored | 2017 ;; the idea is empty Resent-* headers are ignored |
2018 "^\\(RESENT-TO:\\|RESENT-CC:\\|RESENT-BCC:\\)\\s-*\\S-+.*$" | 2018 "^\\(Resent-To:\\|Resent-Cc:\\|Resent-Bcc:\\)\\s-*\\S-+.*$" |
2019 eoh-marker t)) | 2019 eoh-marker t)) |
2020 ;; if we say so, gather the BCC stuff before the main course | 2020 ;; if we say so, gather the Bcc stuff before the main course |
2021 (if (eq feedmail-deduce-bcc-where 'first) | 2021 (if (eq feedmail-deduce-bcc-where 'first) |
2022 (progn (if feedmail-is-a-resend (setq addr-regexp a-re-rb) (setq addr-regexp a-re-db)) | 2022 (progn (if feedmail-is-a-resend (setq addr-regexp a-re-rb) (setq addr-regexp a-re-db)) |
2023 (setq feedmail-address-list (feedmail-deduce-address-list feedmail-prepped-text-buffer (point-min) eoh-marker addr-regexp feedmail-address-list)))) | 2023 (setq feedmail-address-list (feedmail-deduce-address-list feedmail-prepped-text-buffer (point-min) eoh-marker addr-regexp feedmail-address-list)))) |
2024 ;; the main course | 2024 ;; the main course |
2025 (if (or (eq feedmail-deduce-bcc-where 'first) (eq feedmail-deduce-bcc-where 'last)) | 2025 (if (or (eq feedmail-deduce-bcc-where 'first) (eq feedmail-deduce-bcc-where 'last)) |
2026 ;; handled by first or last cases, so don't get BCC stuff | 2026 ;; handled by first or last cases, so don't get Bcc stuff |
2027 (progn (if feedmail-is-a-resend (setq addr-regexp a-re-rtc) (setq addr-regexp a-re-dtc)) | 2027 (progn (if feedmail-is-a-resend (setq addr-regexp a-re-rtc) (setq addr-regexp a-re-dtc)) |
2028 (setq feedmail-address-list (feedmail-deduce-address-list feedmail-prepped-text-buffer (point-min) eoh-marker addr-regexp feedmail-address-list))) | 2028 (setq feedmail-address-list (feedmail-deduce-address-list feedmail-prepped-text-buffer (point-min) eoh-marker addr-regexp feedmail-address-list))) |
2029 ;; not handled by first or last cases, so also get BCC stuff | 2029 ;; not handled by first or last cases, so also get Bcc stuff |
2030 (progn (if feedmail-is-a-resend (setq addr-regexp a-re-rtcb) (setq addr-regexp a-re-dtcb)) | 2030 (progn (if feedmail-is-a-resend (setq addr-regexp a-re-rtcb) (setq addr-regexp a-re-dtcb)) |
2031 (setq feedmail-address-list (feedmail-deduce-address-list feedmail-prepped-text-buffer (point-min) eoh-marker addr-regexp feedmail-address-list)))) | 2031 (setq feedmail-address-list (feedmail-deduce-address-list feedmail-prepped-text-buffer (point-min) eoh-marker addr-regexp feedmail-address-list)))) |
2032 ;; if we say so, gather the BCC stuff after the main course | 2032 ;; if we say so, gather the Bcc stuff after the main course |
2033 (if (eq feedmail-deduce-bcc-where 'last) | 2033 (if (eq feedmail-deduce-bcc-where 'last) |
2034 (progn (if feedmail-is-a-resend (setq addr-regexp a-re-rb) (setq addr-regexp a-re-db)) | 2034 (progn (if feedmail-is-a-resend (setq addr-regexp a-re-rb) (setq addr-regexp a-re-db)) |
2035 (setq feedmail-address-list (feedmail-deduce-address-list feedmail-prepped-text-buffer (point-min) eoh-marker addr-regexp feedmail-address-list)))) | 2035 (setq feedmail-address-list (feedmail-deduce-address-list feedmail-prepped-text-buffer (point-min) eoh-marker addr-regexp feedmail-address-list)))) |
2036 (if (not feedmail-address-list) (error "FQM: Sending...abandoned, no addressees")) | 2036 (if (not feedmail-address-list) (error "FQM: Sending...abandoned, no addressees")) |
2037 ;; not needed, but meets user expectations | 2037 ;; not needed, but meets user expectations |
2038 (setq feedmail-address-list (nreverse feedmail-address-list)) | 2038 (setq feedmail-address-list (nreverse feedmail-address-list)) |
2039 ;; Find and handle any BCC fields. | 2039 ;; Find and handle any Bcc fields. |
2040 (setq bcc-holder (feedmail-accume-n-nuke-header eoh-marker "^BCC:")) | 2040 (setq bcc-holder (feedmail-accume-n-nuke-header eoh-marker "^Bcc:")) |
2041 (setq resent-bcc-holder (feedmail-accume-n-nuke-header eoh-marker "^RESENT-BCC:")) | 2041 (setq resent-bcc-holder (feedmail-accume-n-nuke-header eoh-marker "^Resent-Bcc:")) |
2042 (if (and bcc-holder (not feedmail-nuke-bcc)) | 2042 (if (and bcc-holder (not feedmail-nuke-bcc)) |
2043 (progn (goto-char (point-min)) | 2043 (progn (goto-char (point-min)) |
2044 (insert bcc-holder))) | 2044 (insert bcc-holder))) |
2045 (if (and resent-bcc-holder (not feedmail-nuke-resent-bcc)) | 2045 (if (and resent-bcc-holder (not feedmail-nuke-resent-bcc)) |
2046 (progn (goto-char (point-min)) | 2046 (progn (goto-char (point-min)) |
2064 (while (re-search-forward "^[A-Za-z0-9-]+:[ \t]*\n" eoh-marker t) | 2064 (while (re-search-forward "^[A-Za-z0-9-]+:[ \t]*\n" eoh-marker t) |
2065 (replace-match "")))) | 2065 (replace-match "")))) |
2066 | 2066 |
2067 (run-hooks 'feedmail-last-chance-hook) | 2067 (run-hooks 'feedmail-last-chance-hook) |
2068 | 2068 |
2069 (let ((fcc (feedmail-accume-n-nuke-header eoh-marker "^FCC:")) | 2069 (let ((fcc (feedmail-accume-n-nuke-header eoh-marker "^Fcc:")) |
2070 (also-file) | 2070 (also-file) |
2071 (confirm (cond | 2071 (confirm (cond |
2072 ((eq feedmail-confirm-outgoing 'immediate) | 2072 ((eq feedmail-confirm-outgoing 'immediate) |
2073 (not feedmail-queue-runner-is-active)) | 2073 (not feedmail-queue-runner-is-active)) |
2074 ((eq feedmail-confirm-outgoing 'queued) feedmail-queue-runner-is-active) | 2074 ((eq feedmail-confirm-outgoing 'queued) feedmail-queue-runner-is-active) |
2090 (setq buffer-offer-save nil) | 2090 (setq buffer-offer-save nil) |
2091 (setq buffer-file-name nil) | 2091 (setq buffer-file-name nil) |
2092 ) | 2092 ) |
2093 ))) | 2093 ))) |
2094 (goto-char (point-min)) | 2094 (goto-char (point-min)) |
2095 ;; re-insert and handle any FCC fields (and, optionally, any BCC). | 2095 ;; re-insert and handle any Fcc fields (and, optionally, any Bcc). |
2096 (if fcc (let ((default-buffer-file-type feedmail-force-binary-write)) | 2096 (if fcc (let ((default-buffer-file-type feedmail-force-binary-write)) |
2097 (insert fcc) | 2097 (insert fcc) |
2098 (if (not feedmail-nuke-bcc-in-fcc) | 2098 (if (not feedmail-nuke-bcc-in-fcc) |
2099 (progn (if bcc-holder (insert bcc-holder)) | 2099 (progn (if bcc-holder (insert bcc-holder)) |
2100 (if resent-bcc-holder (insert resent-bcc-holder)))) | 2100 (if resent-bcc-holder (insert resent-bcc-holder)))) |
2205 (erase-buffer) | 2205 (erase-buffer) |
2206 ;; not life's most efficient methodology, but spraying isn't | 2206 ;; not life's most efficient methodology, but spraying isn't |
2207 ;; an every-5-minutes event either | 2207 ;; an every-5-minutes event either |
2208 (insert-buffer feedmail-prepped-text-buffer) | 2208 (insert-buffer feedmail-prepped-text-buffer) |
2209 ;; There's a good case to me made that each separate transmission of | 2209 ;; There's a good case to me made that each separate transmission of |
2210 ;; a message in the spray should have a distinct MESSAGE-ID:. There | 2210 ;; a message in the spray should have a distinct Message-Id:. There |
2211 ;; is also a less compelling argument in the other direction. I think | 2211 ;; is also a less compelling argument in the other direction. I think |
2212 ;; they technically should have distinct MESSAGE-ID:s, but I doubt that | 2212 ;; they technically should have distinct Message-Id:s, but I doubt that |
2213 ;; anyone cares, practically. If someone complains about it, I'll add | 2213 ;; anyone cares, practically. If someone complains about it, I'll add |
2214 ;; it. | 2214 ;; it. |
2215 (feedmail-fiddle-list-of-spray-fiddle-plexes feedmail-spray-address-fiddle-plex-list) | 2215 (feedmail-fiddle-list-of-spray-fiddle-plexes feedmail-spray-address-fiddle-plex-list) |
2216 ;; this (let ) is just in case some buffer eater | 2216 ;; this (let ) is just in case some buffer eater |
2217 ;; is cheating and using the global variable name instead | 2217 ;; is cheating and using the global variable name instead |
2230 feedmail-address-list)))) | 2230 feedmail-address-list)))) |
2231 | 2231 |
2232 | 2232 |
2233 (defun feedmail-envelope-deducer (eoh-marker) | 2233 (defun feedmail-envelope-deducer (eoh-marker) |
2234 "If feedmail-deduce-envelope-from is false, simply return `user-mail-address'. | 2234 "If feedmail-deduce-envelope-from is false, simply return `user-mail-address'. |
2235 Else, look for SENDER: or FROM: (or RESENT-*) and | 2235 Else, look for Sender: or From: (or Resent-*) and |
2236 return that value." | 2236 return that value." |
2237 (if (not feedmail-deduce-envelope-from) | 2237 (if (not feedmail-deduce-envelope-from) |
2238 user-mail-address | 2238 user-mail-address |
2239 (let ((from-list)) | 2239 (let ((from-list)) |
2240 (setq from-list | 2240 (setq from-list |
2241 (feedmail-deduce-address-list | 2241 (feedmail-deduce-address-list |
2242 (current-buffer) (point-min) eoh-marker (if feedmail-is-a-resend "^RESENT-SENDER:" "^SENDER:") | 2242 (current-buffer) (point-min) eoh-marker (if feedmail-is-a-resend "^Resent-Sender:" "^Sender:") |
2243 from-list)) | 2243 from-list)) |
2244 (if (not from-list) | 2244 (if (not from-list) |
2245 (setq from-list | 2245 (setq from-list |
2246 (feedmail-deduce-address-list | 2246 (feedmail-deduce-address-list |
2247 (current-buffer) (point-min) eoh-marker (if feedmail-is-a-resend "^RESENT-FROM:" "^FROM:") | 2247 (current-buffer) (point-min) eoh-marker (if feedmail-is-a-resend "^Resent-From:" "^From:") |
2248 from-list))) | 2248 from-list))) |
2249 (if (and from-list (car from-list)) (car from-list) user-mail-address)))) | 2249 (if (and from-list (car from-list)) (car from-list) user-mail-address)))) |
2250 | 2250 |
2251 | 2251 |
2252 (defun feedmail-fiddle-from () | 2252 (defun feedmail-fiddle-from () |
2253 "Fiddle FROM:." | 2253 "Fiddle From:." |
2254 ;; default is to fall off the end of the list and do nothing | 2254 ;; default is to fall off the end of the list and do nothing |
2255 (cond | 2255 (cond |
2256 ;; nil means do nothing | 2256 ;; nil means do nothing |
2257 ((eq nil feedmail-from-line) nil) | 2257 ((eq nil feedmail-from-line) nil) |
2258 ;; t is the same a using the default computation, so compute it and recurse | 2258 ;; t is the same a using the default computation, so compute it and recurse |
2288 (nth 2 feedmail-from-line) ; action | 2288 (nth 2 feedmail-from-line) ; action |
2289 (nth 3 feedmail-from-line))))) ; folding | 2289 (nth 3 feedmail-from-line))))) ; folding |
2290 | 2290 |
2291 | 2291 |
2292 (defun feedmail-fiddle-sender () | 2292 (defun feedmail-fiddle-sender () |
2293 "Fiddle SENDER:." | 2293 "Fiddle Sender:." |
2294 ;; default is to fall off the end of the list and do nothing | 2294 ;; default is to fall off the end of the list and do nothing |
2295 (cond | 2295 (cond |
2296 ;; nil means do nothing | 2296 ;; nil means do nothing |
2297 ((eq nil feedmail-sender-line) nil) | 2297 ((eq nil feedmail-sender-line) nil) |
2298 ;; t is not allowed, but handled it just to avoid bugs later | 2298 ;; t is not allowed, but handled it just to avoid bugs later |
2316 (nth 2 feedmail-sender-line) ; action | 2316 (nth 2 feedmail-sender-line) ; action |
2317 (nth 3 feedmail-sender-line))))) ; folding | 2317 (nth 3 feedmail-sender-line))))) ; folding |
2318 | 2318 |
2319 | 2319 |
2320 (defun feedmail-default-date-generator (maybe-file) | 2320 (defun feedmail-default-date-generator (maybe-file) |
2321 "Default function for generating DATE: header contents." | 2321 "Default function for generating Date: header contents." |
2322 (let ((date-time)) | 2322 (let ((date-time)) |
2323 (if (and (not feedmail-queue-use-send-time-for-date) maybe-file) | 2323 (if (and (not feedmail-queue-use-send-time-for-date) maybe-file) |
2324 (setq date-time (nth 5 (file-attributes maybe-file)))) | 2324 (setq date-time (nth 5 (file-attributes maybe-file)))) |
2325 (feedmail-rfc822-date date-time)) | 2325 (feedmail-rfc822-date date-time)) |
2326 ) | 2326 ) |
2327 | 2327 |
2328 | 2328 |
2329 (defun feedmail-fiddle-date (maybe-file) | 2329 (defun feedmail-fiddle-date (maybe-file) |
2330 "Fiddle DATE:. See documentation of feedmail-date-generator." | 2330 "Fiddle Date:. See documentation of feedmail-date-generator." |
2331 ;; default is to fall off the end of the list and do nothing | 2331 ;; default is to fall off the end of the list and do nothing |
2332 (cond | 2332 (cond |
2333 ;; nil means do nothing | 2333 ;; nil means do nothing |
2334 ((eq nil feedmail-date-generator) nil) | 2334 ((eq nil feedmail-date-generator) nil) |
2335 ;; t is the same a using the function feedmail-default-date-generator, so let it and recurse | 2335 ;; t is the same a using the function feedmail-default-date-generator, so let it and recurse |
2355 (nth 2 feedmail-date-generator) ; action | 2355 (nth 2 feedmail-date-generator) ; action |
2356 (nth 3 feedmail-date-generator))))) ; folding | 2356 (nth 3 feedmail-date-generator))))) ; folding |
2357 | 2357 |
2358 | 2358 |
2359 (defun feedmail-default-message-id-generator (maybe-file) | 2359 (defun feedmail-default-message-id-generator (maybe-file) |
2360 "Default function for generating MESSAGE-ID: header contents. | 2360 "Default function for generating Message-Id: header contents. |
2361 Based on a date and a sort of random number for tie breaking. Unless | 2361 Based on a date and a sort of random number for tie breaking. Unless |
2362 feedmail-message-id-suffix is defined, uses `user-mail-address', so be | 2362 feedmail-message-id-suffix is defined, uses `user-mail-address', so be |
2363 sure it's set." | 2363 sure it's set." |
2364 (let ((date-time) | 2364 (let ((date-time) |
2365 (end-stuff (if feedmail-message-id-suffix feedmail-message-id-suffix user-mail-address))) | 2365 (end-stuff (if feedmail-message-id-suffix feedmail-message-id-suffix user-mail-address))) |
2375 (feedmail-rfc822-time-zone date-time) | 2375 (feedmail-rfc822-time-zone date-time) |
2376 end-stuff)) | 2376 end-stuff)) |
2377 ) | 2377 ) |
2378 | 2378 |
2379 (defun feedmail-fiddle-message-id (maybe-file) | 2379 (defun feedmail-fiddle-message-id (maybe-file) |
2380 "Fiddle MESSAGE-ID:. See documentation of feedmail-message-id-generator." | 2380 "Fiddle Message-Id:. See documentation of feedmail-message-id-generator." |
2381 ;; default is to fall off the end of the list and do nothing | 2381 ;; default is to fall off the end of the list and do nothing |
2382 (cond | 2382 (cond |
2383 ;; nil means do nothing | 2383 ;; nil means do nothing |
2384 ((eq nil feedmail-message-id-generator) nil) | 2384 ((eq nil feedmail-message-id-generator) nil) |
2385 ;; t is the same a using the function feedmail-default-message-id-generator, so let it and recurse | 2385 ;; t is the same a using the function feedmail-default-message-id-generator, so let it and recurse |
2398 (feedmail-fiddle-message-id maybe-file))) | 2398 (feedmail-fiddle-message-id maybe-file))) |
2399 | 2399 |
2400 ;; if it's a list, it must be a fiddle-plex -- so fiddle, man, fiddle | 2400 ;; if it's a list, it must be a fiddle-plex -- so fiddle, man, fiddle |
2401 ((listp feedmail-message-id-generator) | 2401 ((listp feedmail-message-id-generator) |
2402 (feedmail-fiddle-header | 2402 (feedmail-fiddle-header |
2403 (if feedmail-is-a-resend "Resent-Message-ID" "Message-ID") | 2403 (if feedmail-is-a-resend "Resent-Message-Id" "Message-Id") |
2404 (nth 1 feedmail-message-id-generator) ; value | 2404 (nth 1 feedmail-message-id-generator) ; value |
2405 (nth 2 feedmail-message-id-generator) ; action | 2405 (nth 2 feedmail-message-id-generator) ; action |
2406 (nth 3 feedmail-message-id-generator))))) ; folding | 2406 (nth 3 feedmail-message-id-generator))))) ; folding |
2407 | 2407 |
2408 | 2408 |
2409 (defun feedmail-default-x-mailer-generator () | 2409 (defun feedmail-default-x-mailer-generator () |
2410 "Default function for generating X-MAILER: header contents." | 2410 "Default function for generating X-Mailer: header contents." |
2411 (concat | 2411 (concat |
2412 (let ((case-fold-search t)) (if (string-match "emacs" emacs-version) "" "emacs ")) | 2412 (let ((case-fold-search t)) (if (string-match "emacs" emacs-version) "" "emacs ")) |
2413 emacs-version " (via feedmail " feedmail-patch-level | 2413 emacs-version " (via feedmail " feedmail-patch-level |
2414 (if feedmail-queue-runner-is-active " Q" " I") | 2414 (if feedmail-queue-runner-is-active " Q" " I") |
2415 (if feedmail-enable-spray "S" "") | 2415 (if feedmail-enable-spray "S" "") |
2416 (if feedmail-x-mailer-line-user-appendage ") " ")") | 2416 (if feedmail-x-mailer-line-user-appendage ") " ")") |
2417 feedmail-x-mailer-line-user-appendage)) | 2417 feedmail-x-mailer-line-user-appendage)) |
2418 | 2418 |
2419 | 2419 |
2420 (defun feedmail-fiddle-x-mailer () | 2420 (defun feedmail-fiddle-x-mailer () |
2421 "Fiddle X-MAILER:. See documentation of feedmail-x-mailer-line." | 2421 "Fiddle X-Mailer:. See documentation of feedmail-x-mailer-line." |
2422 ;; default is to fall off the end of the list and do nothing | 2422 ;; default is to fall off the end of the list and do nothing |
2423 (cond | 2423 (cond |
2424 ;; t is the same a using the function feedmail-default-x-mailer-generator, so let it and recurse | 2424 ;; t is the same a using the function feedmail-default-x-mailer-generator, so let it and recurse |
2425 ((eq t feedmail-x-mailer-line) | 2425 ((eq t feedmail-x-mailer-line) |
2426 (let ((feedmail-x-mailer-line (feedmail-default-x-mailer-generator))) | 2426 (let ((feedmail-x-mailer-line (feedmail-default-x-mailer-generator))) |
2449 "Fiddle header for single spray address. Uses feedmail-spray-this-address." | 2449 "Fiddle header for single spray address. Uses feedmail-spray-this-address." |
2450 ;; default is to fall off the end of the list and do nothing | 2450 ;; default is to fall off the end of the list and do nothing |
2451 (cond | 2451 (cond |
2452 ;; nil means do nothing | 2452 ;; nil means do nothing |
2453 ((eq nil addy-plex) nil) | 2453 ((eq nil addy-plex) nil) |
2454 ;; t means the same as using "TO: and unembellished addy | 2454 ;; t means the same as using "To:" and unembellished addy |
2455 ((eq t addy-plex) | 2455 ((eq t addy-plex) |
2456 (let ((addy-plex (list "To" feedmail-spray-this-address))) | 2456 (let ((addy-plex (list "To" feedmail-spray-this-address))) |
2457 (feedmail-fiddle-spray-address addy-plex))) | 2457 (feedmail-fiddle-spray-address addy-plex))) |
2458 | 2458 |
2459 ;; if it's a string, simply make a fiddle-plex out of it and recurse, assuming | 2459 ;; if it's a string, simply make a fiddle-plex out of it and recurse, assuming |
2460 ;; the string names a header field (e.g., "TO") | 2460 ;; the string names a header field (e.g., "To") |
2461 ((stringp addy-plex) | 2461 ((stringp addy-plex) |
2462 (let ((addy-plex (list addy-plex feedmail-spray-this-address))) | 2462 (let ((addy-plex (list addy-plex feedmail-spray-this-address))) |
2463 (feedmail-fiddle-spray-address addy-plex))) | 2463 (feedmail-fiddle-spray-address addy-plex))) |
2464 | 2464 |
2465 ;; if it's a function, call it and recurse with the resulting value | 2465 ;; if it's a function, call it and recurse with the resulting value |
2532 | 2532 |
2533 (defun feedmail-fill-to-cc-function (header-end) | 2533 (defun feedmail-fill-to-cc-function (header-end) |
2534 "Smart filling of address headers (don't be fooled by the name). | 2534 "Smart filling of address headers (don't be fooled by the name). |
2535 The filling tries to avoid splitting lines except at commas. This | 2535 The filling tries to avoid splitting lines except at commas. This |
2536 avoids, in particular, splitting within parenthesized comments in | 2536 avoids, in particular, splitting within parenthesized comments in |
2537 addresses. Headers filled include FROM:, REPLY-TO:, TO:, CC:, BCC:, | 2537 addresses. Headers filled include From:, Reply-To:, To:, Cc:, Bcc:, |
2538 RESENT-TO:, RESENT-CC:, and RESENT-BCC:." | 2538 Resent-To:, Resent-Cc:, and Resent-Bcc:." |
2539 (let ((case-fold-search t) | 2539 (let ((case-fold-search t) |
2540 this-line | 2540 this-line |
2541 this-line-end) | 2541 this-line-end) |
2542 (save-excursion | 2542 (save-excursion |
2543 (goto-char (point-min)) | 2543 (goto-char (point-min)) |
2544 ;; iterate over all TO:/CC:, etc, lines | 2544 ;; iterate over all To:/Cc:, etc, lines |
2545 (while | 2545 (while |
2546 (re-search-forward | 2546 (re-search-forward |
2547 "^\\(FROM:\\|REPLY-TO:\\|TO:\\|CC:\\|BCC:\\|RESENT-TO:\\|RESENT-CC:\\|RESENT-BCC:\\)" | 2547 "^\\(From:\\|Reply-To:\\|To:\\|Cc:\\|Bcc:\\|Resent-To:\\|Resent-Cc:\\|Resent-Bcc:\\)" |
2548 header-end t) | 2548 header-end t) |
2549 (setq this-line (match-beginning 0)) | 2549 (setq this-line (match-beginning 0)) |
2550 ;; replace 0 or more leading spaces with a single space | 2550 ;; replace 0 or more leading spaces with a single space |
2551 (and (looking-at "[ \t]*") (replace-match " ")) | 2551 (and (looking-at "[ \t]*") (replace-match " ")) |
2552 (forward-line 1) | 2552 (forward-line 1) |