annotate lisp/mail/feedmail.el @ 111012:2b6e7f137773

Fix the MSDOS build broken by last revisions. msdos/sed1v2.inp: Use $(..) instead of ${..} in all edit commands. Needed because of changes in revno 101897. msdos/sed6.inp (mkinfodir): Edit to avoid Unix shell-isms. Needed because of changes in revno 101876. src/unexcoff.c (make_hdr): Fix prototype according to changes in revno 101757.
author Eli Zaretskii <eliz@gnu.org>
date Fri, 15 Oct 2010 20:45:12 +0200
parents 7c4da622f181
children ef719132ddfa
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1 ;;; feedmail.el --- assist other email packages to massage outgoing messages
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
2 ;;; This file is in the public domain.
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
3
38436
b174db545cfd Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 35616
diff changeset
4 ;; This file is part of GNU Emacs.
b174db545cfd Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 35616
diff changeset
5
65797
f93aecb355e5 Discard old maintainer email addr.
Richard M. Stallman <rms@gnu.org>
parents: 65587
diff changeset
6 ;; Author: Bill Carpenter <bill@carpenter.ORG>
33424
82e71ffbac94 Fix header,
Dave Love <fx@gnu.org>
parents: 26778
diff changeset
7 ;; Version: 8
82e71ffbac94 Fix header,
Dave Love <fx@gnu.org>
parents: 26778
diff changeset
8 ;; Keywords: email, queue, mail, sendmail, message, spray, smtp, draft
82e71ffbac94 Fix header,
Dave Love <fx@gnu.org>
parents: 26778
diff changeset
9 ;; X-URL: <URL:http://www.carpenter.org/feedmail/feedmail.html>
82e71ffbac94 Fix header,
Dave Love <fx@gnu.org>
parents: 26778
diff changeset
10
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
11 ;;; Commentary:
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
12
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
13 ;; A replacement for parts of Emacs' sendmail.el (specifically,
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
14 ;; it's what handles your outgoing mail after you hit C-c C-c in mail
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
15 ;; mode). See below for a list of additional features, including the
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
16 ;; ability to queue messages for later sending. If you are using
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
17 ;; fakemail as a subprocess, you can switch to feedmail and eliminate
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
18 ;; the use of fakemail. feedmail works with recent versions of
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
19 ;; Emacs (mostly, but not exclusively, tested against 19.34 on
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
20 ;; Win95; some testing on 20.x) and XEmacs (tested with 20.4 and
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
21 ;; later betas). It probably no longer works with Emacs 18,
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
22 ;; though I haven't tried that in a long time. Sorry, no manual yet
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
23 ;; in this release. Look for one with the next release.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
24
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
25 ;; As far as I'm concerned, anyone can do anything they want with
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
26 ;; this specific piece of code. No warranty or promise of support is
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
27 ;; offered. This code is hereby released into the public domain.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
28
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
29 ;; Thanks: My thanks to the many people who have sent me suggestions
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
30 ;; and fixes over time, as well as those who have tested many beta
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
31 ;; iterations. Some are cited in comments in code fragments below,
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
32 ;; but that doesn't correlate well with the list of folks who have
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
33 ;; actually helped me along the way.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
34
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
35 ;; If you use feedmail, I invite you to send me some email about it.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
36 ;; I appreciate feedback about problems you find or suggestions for
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
37 ;; improvements or added features (even though I can't predict when
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
38 ;; I'll incorporate changes). It's also OK with me if you send me a
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
39 ;; note along the lines of "I use feedmail and find it useful" or "I
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
40 ;; tried feedmail and didn't find it useful, so I stopped using it".
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
41 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
42 ;; It is most useful, when sending a bug report, if you tell me what
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
43 ;; version of Emacs you are using, what version of feedmail you are
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
44 ;; using, and what versions of other email-related elisp packages you
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
45 ;; are using. If in doubt about any of that, send the bug report
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
46 ;; anyhow.
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
47 ;;
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
48 ;; =====
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
49 ;; A NOTE TO THOSE WHO WOULD CHANGE THIS CODE... Since it is PD,
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
50 ;; you're within your rights to do whatever you want. If you do
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
51 ;; publish a new version with your changes in it, please (1) insert
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
52 ;; lisp comments describing the changes, (2) insert lisp comments
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
53 ;; that clearly delimit where your changes are, (3) email me a copy
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
54 ;; (I can't always consistently follow the relevant usenet groups),
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
55 ;; and (4) use a version number that is based on the version you're
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
56 ;; changing along with something that indicates you changed it. For
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
57 ;; example,
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
58 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
59 ;; (defconst feedmail-patch-level "123")
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
60 ;; (defconst feedmail-patch-level "123-XYZ-mods")
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
61 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
62 ;; The point of the last item, of course, is to try to minimize
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
63 ;; confusion. Odds are good that if your idea makes sense to me that
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
64 ;; it will show up in some future version of feedmail, though it's
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
65 ;; hard to say when releases will tumble out.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
66 ;; =====
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
67 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
68 ;; This file requires the mail-utils library.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
69 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
70 ;; This file requires the smtpmail library if you use
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
71 ;; feedmail-buffer-to-smtpmail.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
72 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
73 ;; This file requires the custom library. Unfortunately, there are
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
74 ;; two incompatible versions of the custom library. If you don't have
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
75 ;; custom or you have the old version, this file will still load and
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
76 ;; work properly. If you don't know what custom is all about and want
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
77 ;; to edit your user option elisp variables the old fashioned way,
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
78 ;; just imagine that all the "defcustom" stuff you see below is really
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
79 ;; "defvar", and ignore everthing else. For info about custom, see
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
80 ;; <URL:http://www.dina.kvl.dk/~abraham/custom/>.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
81 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
82 ;; This code does in elisp a superset of the stuff that used to be done
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
83 ;; by the separate program "fakemail" for processing outbound email.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
84 ;; In other words, it takes over after you hit "C-c C-c" in mail mode.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
85 ;; By appropriate setting of options, you can still use "fakemail",
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
86 ;; or you can even revert to sendmail (which is not too popular
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
87 ;; locally). See the variables at the top of the elisp for how to
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
88 ;; achieve these effects (there are more features than in this bullet
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
89 ;; list, so trolling through the variable and function doc strings may
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
90 ;; be worth your while):
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
91 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
92 ;; --- you can park outgoing messages into a disk-based queue and
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
93 ;; stimulate sending them all later (handy for laptop users);
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
94 ;; there is also a queue for draft messages
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
95 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
96 ;; --- you can get one last look at the prepped outbound message and
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
97 ;; be prompted for confirmation
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
98 ;;
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
99 ;; --- removes Bcc:/Resent-Bcc: headers after getting address info
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
100 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
101 ;; --- does smart filling of address headers
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
102 ;;
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
103 ;; --- calls a routine to process Fcc: lines and removes them
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
104 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
105 ;; --- empty headers are removed
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
106 ;;
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
107 ;; --- can force From: or Sender: line
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
108 ;;
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
109 ;; --- can generate a Message-Id: line
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
110 ;;
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
111 ;; --- can generate a Date: line; the date can be the time the
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
112 ;; message was written or the time it is being sent
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
113 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
114 ;; --- strips comments from address info (both "()" and "<>" are
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
115 ;; handled via a call to mail-strip-quoted-names); the
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
116 ;; comments are stripped in the simplified address list given
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
117 ;; to a subprocess, not in the headers in the mail itself
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
118 ;; (they are left unchanged, modulo smart filling)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
119 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
120 ;; --- error info is pumped into a normal buffer instead of the
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
121 ;; minibuffer
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
122 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
123 ;; --- just before the optional prompt for confirmation, lets you
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
124 ;; run a hook on the prepped message and simplified address
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
125 ;; list
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
126 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
127 ;; --- you can specify something other than /bin/mail for the
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
128 ;; subprocess
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
129 ;;
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
130 ;; --- you can generate/modify an X-Mailer: message header
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
131 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
132 ;; After a long list of options below, you will find the function
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
133 ;; feedmail-send-it. Hers's the best way to use the stuff in this
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
134 ;; file:
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
135 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
136 ;; Save this file as feedmail.el somewhere on your elisp
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
137 ;; loadpath; byte-compile it. Put the following lines somewhere in
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
138 ;; your ~/.emacs stuff:
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
139 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
140 ;; (setq send-mail-function 'feedmail-send-it)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
141 ;; (autoload 'feedmail-send-it "feedmail")
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
142 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
143 ;; If you plan to use the queue stuff, also use this:
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
144 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
145 ;; (setq feedmail-enable-queue t)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
146 ;; (autoload 'feedmail-run-the-queue "feedmail")
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
147 ;; (autoload 'feedmail-run-the-queue-no-prompts "feedmail")
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
148 ;; (setq auto-mode-alist (cons '("\\.fqm$" . mail-mode) auto-mode-alist))
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
149 ;;
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
150 ;; If you are using the desktop.el library to restore your sessions, you might
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
151 ;; like to add the suffix ".fqm" to the list of non-saved things via the variable
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
152 ;; desktop-files-not-to-save.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
153 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
154 ;; If you are planning to call feedmail-queue-reminder from your .emacs or
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
155 ;; something similar, you might need this:
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
156 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
157 ;; (autoload 'feedmail-queue-reminder "feedmail")
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
158 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
159 ;; If you ever use rmail-resend and queue messages, you should do this:
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
160 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
161 ;; (setq feedmail-queue-alternative-mail-header-separator "")
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
162 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
163 ;; If you want to automatically spell-check messages, but not when sending
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
164 ;; them from the queue, you could do something like this:
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
165 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
166 ;; (autoload 'feedmail-mail-send-hook-splitter "feedmail")
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
167 ;; (add-hook 'mail-send-hook 'feedmail-mail-send-hook-splitter)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
168 ;; (add-hook 'feedmail-mail-send-hook 'ispell-message)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
169 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
170 ;; If you are using message-mode to compose and send mail, feedmail will
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
171 ;; probably work fine with that (someone else tested it and told me it worked).
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
172 ;; Follow the directions above, but make these adjustments instead:
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
173 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
174 ;; (setq message-send-mail-function 'feedmail-send-it)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
175 ;; (add-hook 'message-mail-send-hook 'feedmail-mail-send-hook-splitter)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
176 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
177 ;; I think the LCD is no longer being updated, but if it were, this
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
178 ;; would be a proper LCD record. There is an old version of
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
179 ;; feedmail.el in the LCD archive. It works but is missing a lot of
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
180 ;; features.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
181 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
182 ;; LCD record:
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
183 ;; feedmail|Bill Carpenter|bill@bubblegum.net,bill@carpenter.ORG|Outbound mail queue handling|98-06-15|8|feedmail.el
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
184 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
185 ;; Change log:
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
186 ;; original, 31 March 1991
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
187 ;; patchlevel 1, 5 April 1991
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
188 ;; patchlevel 2, 24 May 1991
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
189 ;; 5-may-92 jwz Conditionalized calling expand-mail-aliases, since that
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
190 ;; function doesn't exist in Lucid Emacs or when using
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
191 ;; mail-abbrevs.el.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
192 ;; patchlevel 3, 3 October 1996
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
193 ;; added queue stuff; still works in v18
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
194 ;; patchlevel 4, issued by someone else
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
195 ;; patchlevel 5, issued by someone else
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
196 ;; patchlevel 6, not issued as far as I know
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
197 ;; patchlevel 7, 20 May 1997
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
198 ;; abandon futile support of Emacs 18 (sorry if that hurts you)
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
199 ;; provide a Date: header by default
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
200 ;; provide a default for generating Message-Id: header contents
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
201 ;; and use it by default (slightly changed API)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
202 ;; return value from feedmail-run-the-queue
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
203 ;; new wrapper function feedmail-run-the-queue-no-prompts
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
204 ;; user-mail-address as default for From:
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
205 ;; properly deal with Resent-{To,Cc,Bcc}
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
206 ;; Bcc and Resent-* now included in smart filling
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
207 ;; limited support for a "drafts" directory
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
208 ;; user-configurable default message action
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
209 ;; allow timeout for confirmation prompt (where available)
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
210 ;; move Fcc handling to as late as possible to get max
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
211 ;; header munging in the saved file
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
212 ;; work around sendmail.el's prompts when working from queue
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
213 ;; more reliably detect voluntary user bailouts
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
214 ;; offer to save modified buffers visiting queue files
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
215 ;; offer to delete old file copies of messages being queued
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
216 ;; offer to delete queue files when sending immediately
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
217 ;; queue filename convention preserves queue order
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
218 ;; default queue and draft directory names that work on VMS
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
219 ;; deduced address list now really a list, not a string (API change)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
220 ;; no more address buffer
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
221 ;; when sending immediately, brief reminder of queue/draft counts
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
222 ;; copy trace of smtpmail stuff to feedmail error buffer on no-go
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
223 ;; more granularity on when to confirm sending
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
224 ;; pause a bit for errors while running queue
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
225 ;; try to clean up some pesky auto-save files from the
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
226 ;; queue/draft directories
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
227 ;; feedmail-force-expand-mail-aliases in case you can't figure
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
228 ;; any other way
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
229 ;; cleanup some of my sloppiness about case-fold-search (a strange
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
230 ;; variable)
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
231 ;; best effort following coding conventions from Emacs
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
232 ;; elisp manual appendix
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
233 ;; "customize" (see custom.el)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
234 ;; when user selects "immediate send", clear action prompt since
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
235 ;; hooks may take a while to operate, and user may think the
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
236 ;; response didn't take
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
237 ;; fixes to the argument conventions for the
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
238 ;; feedmail-queue-runner-* functions; allows
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
239 ;; feedmail-run-the-queue[-no-prompts] to properly be called
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
240 ;; non-interactively
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
241 ;; eliminate reliance on directory-sep-char and feedmail-sep-thing
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
242 ;; tweak smart filling (reminded of comma problem by levitte@lp.se)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
243 ;; option to control writing in text vs binary mode
22552
c9dbdcb10fdf entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 22513
diff changeset
244 ;; patchlevel 8, 15 June 1998
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
245 ;; reliable re-editing of text-mode (vs binary) queued messages
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
246 ;; user option to keep Bcc: in Fcc: copy (keep by default)
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
247 ;; user option to delete body from Fcc: copy (keep by default)
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
248 ;; feedmail-deduce-bcc-where for envelope (API change for
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
249 ;; feedmail-deduce-address list)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
250 ;; feedmail-queue-alternative-mail-header-separator
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
251 ;; at message action prompt, "I"/"S" bypass message confirmation prompt
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
252 ;; feedmail-mail-send-hook-splitter, feedmail-mail-send-hook,
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
253 ;; feedmail-mail-send-hook-queued
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
254 ;; user can supply stuff for message action prompt
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
255 ;; variable feedmail-queue-runner-confirm-global, function feedmail-run-the-queue-global-prompt
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
256 ;; bugfix: absolute argument to directory-files (tracked down for me
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
257 ;; by gray@austin.apc.slb.com (Douglas Gray Stephens)); relative
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
258 ;; pathnames can tickle stuff in ange-ftp remote directories
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
259 ;; (perhaps because feedmail is careless about its working
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
260 ;; directory)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
261 ;; feedmail-deduce-envelope-from
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
262 ;; always supply envelope "from" (user-mail-address) to sendmail
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
263 ;; feedmail-message-id-suffix
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
264 ;; feedmail-queue-reminder, feedmail-queue-reminder-alist (after suggestions
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
265 ;; and/or code fragments from tonyl@Eng.Sun.COM (Tony Lam) and
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
266 ;; burge@newvision.com (Shane Burgess); bumped up the default value of
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
267 ;; feedmail-queue-chatty-sit-for since info is more complex sometimes
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
268 ;; feedmail-enable-spray (individual transmissions, crude mailmerge)
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
269 ;; blank Subject: no longer a special case; see feedmail-nuke-empty-headers
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
270 ;; fiddle-plexes data structure used lots of places; see feedmail-fiddle-plex-blurb
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
271 ;; feedmail-fiddle-plex-user-list
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
272 ;; feedmail-is-a-resend
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
273 ;; honor mail-from-style in constructing default for feedmail-from-line
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
274 ;; re-implement feedmail-from-line and feedmail-sender-line with
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
275 ;; fiddle-plexes; slightly modified semantics for feedmail-sender-line
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
276 ;; feedmail-queue-default-file-slug; tidy up some other slug details
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
277 ;; feedmail-queue-auto-file-nuke
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
278 ;; feedmail-queue-express-to-queue and feedmail-queue-express-to-draft
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
279 ;; strong versions of "q"ueue and "d"raft answers (always make a new file)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
280 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
281 ;; todo (probably in patchlevel 9):
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
282 ;; write texinfo manual
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
283 ;; maybe partition into multiple files, including files of examples
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
284 ;;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
285 ;;; Code:
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
286
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
287 (defconst feedmail-patch-level "8")
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
288
106518
c22556bde650 (top-level): Move require 'mail-utils to start.
Glenn Morris <rgm@gnu.org>
parents: 105829
diff changeset
289 (require 'mail-utils) ; pick up mail-strip-quoted-names
c22556bde650 (top-level): Move require 'mail-utils to start.
Glenn Morris <rgm@gnu.org>
parents: 105829
diff changeset
290
c22556bde650 (top-level): Move require 'mail-utils to start.
Glenn Morris <rgm@gnu.org>
parents: 105829
diff changeset
291 (eval-when-compile
c22556bde650 (top-level): Move require 'mail-utils to start.
Glenn Morris <rgm@gnu.org>
parents: 105829
diff changeset
292 (require 'smtpmail)
c22556bde650 (top-level): Move require 'mail-utils to start.
Glenn Morris <rgm@gnu.org>
parents: 105829
diff changeset
293 (require 'cl))
c22556bde650 (top-level): Move require 'mail-utils to start.
Glenn Morris <rgm@gnu.org>
parents: 105829
diff changeset
294
33984
d81160aa663f Require smtpmail when compiling.
Dave Love <fx@gnu.org>
parents: 33424
diff changeset
295 (autoload 'mail-do-fcc "sendmail")
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
296
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
297 (defgroup feedmail nil
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
298 "Assist other email packages to massage outgoing messages."
33984
d81160aa663f Require smtpmail when compiling.
Dave Love <fx@gnu.org>
parents: 33424
diff changeset
299 :link '(url-link "http://www.carpenter.org/feedmail/feedmail.html")
42787
b61ebf167ba0 (feedmail): Fix :link spec.
Andreas Schwab <schwab@suse.de>
parents: 42706
diff changeset
300 :link '(emacs-commentary-link "feedmail")
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
301 :group 'mail)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
302
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
303 (defgroup feedmail-misc nil
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
304 "Miscellaneous feedmail options that don't fit in other groups."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
305 :group 'feedmail)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
306
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
307 (defgroup feedmail-headers nil
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
308 "Options related to manipulating specific headers or types of headers."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
309 :group 'feedmail)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
310
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
311 (defgroup feedmail-queue nil
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
312 "Options related to queuing messages for later sending."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
313 :group 'feedmail)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
314
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
315
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
316 (defcustom feedmail-confirm-outgoing nil
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
317 "If non-nil, give a y-or-n confirmation prompt before sending mail.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
318 This is done after the message is completely prepped, and you'll be
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
319 looking at the top of the message in a buffer when you get the prompt.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
320 If set to the symbol 'queued, give the confirmation prompt only while
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
321 running the queue (however, the prompt is always suppressed if you are
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
322 processing the queue via `feedmail-run-the-queue-no-prompts'). If set
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
323 to the symbol 'immediate, give the confirmation prompt only when
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
324 sending immediately. For any other non-nil value, prompt in both
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
325 cases. You can give a timeout for the prompt; see variable
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
326 `feedmail-confirm-outgoing-timeout'."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
327 :group 'feedmail-misc
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
328 :type 'boolean
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
329 )
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
330
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
331
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
332 (defcustom feedmail-confirm-outgoing-timeout nil
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
333 "If non-nil, a timeout in seconds at the send confirmation prompt.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
334 If a positive number, it's a timeout before sending. If a negative
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
335 number, it's a timeout before not sending. This will not work if your
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
336 version of Emacs doesn't include the function `y-or-n-p-with-timeout'
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
337 \(e.g., some versions of XEmacs\)."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
338 :group 'feedmail-misc
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
339 :type '(choice (const nil) integer)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
340 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
341
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
342
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
343 (defcustom feedmail-nuke-bcc t
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
344 "If non-nil remove Bcc: lines from the message headers.
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
345 In any case, the Bcc: lines do participate in the composed address
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
346 list. You may want to leave them in if you're using sendmail
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
347 \(see `feedmail-buffer-eating-function'\)."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
348 :group 'feedmail-headers
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
349 :type 'boolean
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
350 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
351
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
352
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
353 (defcustom feedmail-nuke-resent-bcc t
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
354 "If non-nil remove Resent-Bcc: lines from the message headers.
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
355 In any case, the Resent-Bcc: lines do participate in the composed
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
356 address list. You may want to leave them in if you're using sendmail
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
357 \(see `feedmail-buffer-eating-function'\)."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
358 :group 'feedmail-headers
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
359 :type 'boolean
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
360 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
361
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
362
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
363 (defcustom feedmail-deduce-bcc-where nil
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
364 "Where Bcc:/Resent-Bcc: addresses should appear in the envelope list.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
365 Addresses for the message envelope are deduced by examining
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
366 appropriate address headers in the message. Generally, they will show
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
367 up in the list of deduced addresses in the order that the headers
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
368 happen to appear (duplicate addresses are eliminated in any case).
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
369 This variable can be set to the symbol 'first, in which case the
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
370 Bcc:/Resent-Bcc: addresses will appear at the beginning in the list;
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
371 or, it can be set to the symbol 'last, in which case they will appear
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
372 at the end of the list.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
373
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
374 Why should you care? Well, maybe you don't, and certainly the same
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
375 things could be accomplished by affecting the order of message headers
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
376 in the outgoing message. Some people use Bcc: as a way of getting
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
377 their own \"come back\" copy of each message they send. If Bcc:
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
378 addresses are not handled first, there can be substantial delays in
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
379 seeing the message again. Some configurations of sendmail, for example,
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
380 seem to try to deliver to each addressee at least once, immediately
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
381 and serially, so slow SMTP conversations can add up to a delay. There
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
382 is an option for either 'first or 'last because you might have a
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
383 delivery agent that processes the addresses backwards."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
384 :group 'feedmail-headers
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
385 :type 'boolean
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
386 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
387
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
388
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
389 (defcustom feedmail-fill-to-cc t
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
390 "If non-nil do smart filling of addressee header lines.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
391 Smart filling means breaking long lines at appropriate points and
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
392 making continuation lines. Despite the function name, it includes
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
393 To:, Cc:, Bcc: (and their Resent-* forms), as well as From: and
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
394 Reply-To: (though they seldom need it). If nil, the lines are left
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
395 as-is. The filling is done after mail address alias expansion."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
396 :group 'feedmail-headers
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
397 :type 'boolean
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
398 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
399
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
400
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
401 (defcustom feedmail-fill-to-cc-fill-column default-fill-column
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
402 "Fill column used by `feedmail-fill-to-cc'."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
403 :group 'feedmail-headers
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
404 :type 'integer
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
405 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
406
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
407
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
408 (defcustom feedmail-nuke-bcc-in-fcc nil
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
409 "If non-nil remove [Resent-]Bcc: lines in message copies saved via Fcc:.
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
410 This is independent of whether the Bcc: header lines are actually sent
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
411 with the message (see feedmail-nuke-bcc). Though not implied in the name,
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
412 the same Fcc: treatment applies to both Bcc: and Resent-Bcc: lines."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
413 :group 'feedmail-headers
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
414 :type 'boolean
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
415 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
416
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
417
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
418 (defcustom feedmail-nuke-body-in-fcc nil
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
419 "If non-nil remove body of message in copies saved via Fcc:.
47926
5e18e835d9fa (feedmail-nuke-body-in-fcc, feedmail-queue-draft-directory): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents: 42787
diff changeset
420 If a positive integer value, leave (up to) that many lines of the
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
421 beginning of the body intact. The result is that the Fcc: copy will
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
422 consist only of the message headers, serving as a sort of an outgoing
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
423 message log."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
424 :group 'feedmail-headers
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
425 :type '(choice (const nil) (const t) integer)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
426 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
427
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
428
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
429 (defcustom feedmail-force-expand-mail-aliases nil
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
430 "If non-nil, force the calling of `expand-mail-aliases'.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
431 Normally, feedmail tries to figure out if you're using mailalias or
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
432 mailabbrevs and only calls `expand-mail-aliases' if it thinks you're
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
433 using the mailalias package. This user option can be used to force
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
434 the issue since there are configurations which fool the figuring
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
435 out."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
436 :group 'feedmail-headers
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
437 :type 'boolean
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
438 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
439
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
440
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
441 (defcustom feedmail-nuke-empty-headers t
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
442 "If non-nil, remove header lines which have no contents.
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
443 A completely empty Subject: header is always removed, regardless of
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
444 the setting of this variable. The only time you would want them left
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
445 in would be if you used some headers whose presence indicated
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
446 something rather than their contents. This is rare in Internet email
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
447 but common in some proprietary systems."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
448 :group 'feedmail-headers
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
449 :type 'boolean
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
450 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
451
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
452 ;; wjc sez: I think the use of the Sender: line is pretty pointless,
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
453 ;; but I left it in to be compatible with sendmail.el and because
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
454 ;; maybe some distant mail system needs it. Really, though, if you
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
455 ;; want a sender line in your mail, just put one in there and don't
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
456 ;; wait for feedmail to do it for you. (Yes, I know all about
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
457 ;; RFC-822 and RFC-1123, but are you *really* one of those cases
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
458 ;; they're talking about? I doubt it.)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
459 (defcustom feedmail-sender-line nil
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
460 "If non-nil and the email has no Sender: header, use this value.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
461 May be nil, in which case nothing in particular is done with respect
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
462 to Sender: lines. By design, will not replace an existing Sender:
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
463 line, but you can achieve that with a fiddle-plex 'replace action.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
464 NB: it makes no sense to use the value t since there is no sensible
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
465 default for Sender:.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
466
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
467 If not nil, it may be a string, a fiddle-plex, or a function which
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
468 returns either nil, t, a string, or a fiddle-plex (or, in fact,
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
469 another function, but let's not be ridiculous). If a string, it
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
470 should be just the contents of the header, not the name of the header
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
471 itself nor the trailing newline. If a function, it will be called
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
472 with no arguments. For an explanation of fiddle-plexes, see the
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
473 documentation for the variable `feedmail-fiddle-plex-blurb'. In all
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
474 cases the name element of the fiddle-plex is ignored and is hardwired
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
475 by feedmail to either \"X-Sender\" or \"X-Resent-Sender\".
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
476
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
477 You can probably leave this nil, but if you feel like using it, a good
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
478 value would be a string of a fully-qualified domain name form of your
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
479 address. For example, \"bill@bubblegum.net (WJCarpenter)\". The Sender:
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
480 header is fiddled after the From: header is fiddled."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
481 :group 'feedmail-headers
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
482 :type '(choice (const nil) string)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
483 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
484
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
485
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
486 (defcustom feedmail-force-binary-write t
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
487 "If non-nil, force writing file as binary (this applies to queues and Fcc:).
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
488 On systems where there is a difference between binary and text files,
104662
790bd85e4cb0 * mail/feedmail.el: Use CL macros.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 97142
diff changeset
489 feedmail will temporarily manipulate the value of `buffer-file-type'
790bd85e4cb0 * mail/feedmail.el: Use CL macros.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 97142
diff changeset
490 to make the writing as binary. If nil, writing will be in text mode.
790bd85e4cb0 * mail/feedmail.el: Use CL macros.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 97142
diff changeset
491 On systems where there is no distinction or where it is controlled by other
790bd85e4cb0 * mail/feedmail.el: Use CL macros.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 97142
diff changeset
492 variables or other means, this option has no effect."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
493 :group 'feedmail-misc
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
494 :type 'boolean
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
495 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
496
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
497
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
498 (defcustom feedmail-from-line t
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
499 "If non-nil and the email has no From: header, use this value.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
500 May be t, in which case a default is computed (and you probably won't
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
501 be happy with it). May be nil, in which case nothing in particular is
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
502 done with respect to From: lines. By design, will not replace an
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
503 existing From: line, but you can achieve that with a fiddle-plex 'replace
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
504 action.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
505
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
506 If neither nil nor t, it may be a string, a fiddle-plex, or a function
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
507 which returns either nil, t, a string, or a fiddle-plex (or, in fact,
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
508 another function, but let's not be ridiculous). If a string, it
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
509 should be just the contents of the header, not the name of the header
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
510 itself nor the trailing newline. If a function, it will be called
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
511 with no arguments. For an explanation of fiddle-plexes, see the
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
512 documentation for the variable `feedmail-fiddle-plex-blurb'. In all
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
513 cases the name element of the fiddle-plex is ignored and is hardwired
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
514 by feedmail to either \"X-From\" or \"X-Resent-From\".
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
515
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
516 A good value would be a string fully-qualified domain name form of
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
517 your address. For example, \"bill@bubblegum.net (WJCarpenter)\". The
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
518 default value of this variable uses the standard elisp variable
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
519 `user-mail-address' which should be set on every system but has a decent
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
520 chance of being wrong. It also honors `mail-from-style'. Better to set
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
521 this variable explicitly to the string you want or find some other way
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
522 to arrange for the message to get a From: line."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
523 :group 'feedmail-headers
23222
dbd281c0a5bf (feedmail-from-line): Allow t.
Karl Heuer <kwzh@gnu.org>
parents: 22801
diff changeset
524 :type '(choice (const t) (const nil) string)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
525 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
526
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
527
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
528 (defcustom feedmail-deduce-envelope-from t
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
529 "If non-nil, deduce message envelope \"from\" from header From: or Sender:.
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
530 In other words, if there is a Sender: header in the message, temporarily
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
531 change the value of `user-mail-address' to be the same while the message
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
532 is being sent. If there is no Sender: header, use the From: header,
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
533 if any. Address values are taken from the actual message just before
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
534 it is sent, and the process is independent of the values of
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
535 `feedmail-from-line' and/or `feedmail-sender-line'.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
536
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
537 There are many and good reasons for having the message header
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
538 From:/Sender: be different from the message envelope \"from\"
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
539 information. However, for most people and for most circumstances, it
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
540 is usual for them to be the same (this is probably especially true for
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
541 the case where the user doesn't understand the difference between the
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
542 two in the first place).
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
543
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
544 The idea behind this feature is that you can have everything set up
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
545 some normal way for yourself. If for some reason you want to send a
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
546 message with another From: line, you can just type it at the top of
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
547 the message, and feedmail will take care of \"fixing up\" the envelope
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
548 \"from\". This only works for mail senders which make use of
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
549 `user-mail-address' as the envelope \"from\" value. For some mail
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
550 senders (e.g., feedmail-buffer-to-bin-mail), there is no simple way to
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
551 influence what they will use as the envelope."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
552 :group 'feedmail-headers
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
553 :type 'boolean
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
554 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
555
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
556
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
557 (defcustom feedmail-x-mailer-line-user-appendage nil
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
558 "See feedmail-x-mailer-line."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
559 :group 'feedmail-headers
23265
92177ff080cc (feedmail-x-mailer-line-user-appendage,
Andreas Schwab <schwab@suse.de>
parents: 23222
diff changeset
560 :type '(choice (const nil) (const t) string)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
561 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
562
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
563
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
564 (defcustom feedmail-x-mailer-line t
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
565 "Control the form of an X-Mailer: header in an outgoing message.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
566 Moderately useful for debugging, keeping track of your correspondents'
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
567 mailer preferences, or just wearing your MUA on your sleeve. You
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
568 should probably know that some people are fairly emotional about the
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
569 presence of X-Mailer: lines in email.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
570
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
571 If nil, nothing is done about X-Mailer:.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
572
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
573 If t, an X-Mailer: header of a predetermined format is produced,
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
574 combining its efforts with any existing X-Mailer: header. If you want
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
575 to take the default construct and just add a little blob of your own
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
576 at the end, define the variable feedmail-x-mailer-line-user-appendage
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
577 as that blob string. A value of t is equivalent to using the function
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
578 feedmail-default-x-mailer-generator.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
579
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
580 If neither nil nor t, it may be a string, a fiddle-plex, or a function
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
581 which returns either nil, t, a string, or a fiddle-plex (or, in fact,
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
582 another function, but let's not be ridiculous). If a string, it
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
583 should be just the contents of the header, not the name of the header
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
584 itself nor the trailing newline. If a function, it will be called
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
585 with no arguments. For an explanation of fiddle-plexes, see the
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
586 documentation for the variable `feedmail-fiddle-plex-blurb'. In all
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
587 cases the name element of the fiddle-plex is ignored and is hardwired
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
588 by feedmail to either \"X-Mailer\" or \"X-Resent-Mailer\"."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
589 :group 'feedmail-headers
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
590 :type '(choice (const t) (const nil) string function)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
591 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
592
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
593
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
594 (defcustom feedmail-message-id-generator t
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
595 "Specifies the creation of a Message-Id: header field.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
596
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
597 If nil, nothing is done about Message-Id:.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
598
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
599 If t, a Message-Id: header of a predetermined format is produced, but
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
600 only if there is not already a Message-Id: in the message. A value of
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
601 t is equivalent to using the function feedmail-default-message-id-generator.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
602
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
603 If neither nil nor t, it may be a string, a fiddle-plex, or a function
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
604 which returns either nil, t, a string, or a fiddle-plex (or, in fact,
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
605 another function, but let's not be ridiculous). If a string, it
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
606 should be just the contents of the header, not the name of the header
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
607 itself nor the trailing newline. If a function, it will be called
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
608 with one argument: the possibly-nil name of the file associated with
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
609 the message buffer. For an explanation of fiddle-plexes, see the
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
610 documentation for the variable `feedmail-fiddle-plex-blurb'. In all
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
611 cases the name element of the fiddle-plex is ignored and is hardwired
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
612 by feedmail to either \"Message-Id\" or \"Resent-Message-Id\".
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
613
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
614 You should let feedmail generate a Message-Id: for you unless you are sure
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
615 that whatever you give your messages to will do it for you (e.g., most
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
616 configurations of sendmail). Even if the latter case is true, it
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
617 probably won't hurt you to generate your own, and it will then show up
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
618 in the saved message if you use Fcc:."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
619 :group 'feedmail-headers
76123
49ec84aacf0b (feedmail-message-id-generator, feedmail-date-generator): Fix custom types.
John Paul Wallington <jpw@pobox.com>
parents: 73728
diff changeset
620 :type '(choice (const t) (const nil) function)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
621 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
622
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
623
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
624 (defcustom feedmail-message-id-suffix nil
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
625 "If non-nil, used as a suffix for generating unique Message-Id: headers.
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
626 The function `feedmail-default-message-id-generator' creates its work based
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
627 on a formatted date-time string, a random number, and a domain-looking suffix.
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
628 You can control the suffix used by assigning a string value to this variable.
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
629 If you don't supply one, the value of the variable `user-mail-address' will be
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
630 used. If the value of `feedmail-message-id-suffix' contains an \"@\" character,
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
631 the string will be used verbatim, else an \"@\" character will be prepended
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
632 automatically."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
633 :group 'feedmail-headers
23222
dbd281c0a5bf (feedmail-from-line): Allow t.
Karl Heuer <kwzh@gnu.org>
parents: 22801
diff changeset
634 :type '(choice (const nil) string)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
635 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
636
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
637 ;; this was suggested in various forms by several people; first was
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
638 ;; Tony DeSimone in Oct 1992; sorry to be so tardy
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
639 (defcustom feedmail-date-generator t
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
640 "Specifies the creation of a Date: header field.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
641
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
642 If nil, nothing is done about Date:.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
643
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
644 If t, a Date: header of a predetermined format is produced, but only
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
645 if there is not already a Date: in the message. A value of t is
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
646 equivalent to using the function `feedmail-default-date-generator'.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
647
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
648 If neither nil nor t, it may be a string, a fiddle-plex, or a function
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
649 which returns either nil, t, a string, or a fiddle-plex (or, in fact,
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
650 another function, but let's not be ridiculous). If a string, it
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
651 should be just the contents of the header, not the name of the header
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
652 itself nor the trailing newline. If a function, it will be called
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
653 with one argument: the possibly-nil name of the file associated with
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
654 the message buffer. For an explanation of fiddle-plexes, see the
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
655 documentation for the variable `feedmail-fiddle-plex-blurb'. In all
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
656 cases the name element of the fiddle-plex is ignored and is hardwired
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
657 by feedmail to either \"Date\" or \"Resent-Date\".
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
658
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
659 If you decide to format your own date field, do us all a favor and know
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
660 what you're doing. Study the relevant parts of RFC-822 and RFC-1123.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
661 Don't make me come up there!
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
662
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
663 You should let feedmail generate a Date: for you unless you are sure
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
664 that whatever you give your messages to will do it for you (e.g., most
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
665 configurations of sendmail). Even if the latter case is true, it
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
666 probably won't hurt you to generate your own, and it will then show up
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
667 in the saved message if you use Fcc:."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
668 :group 'feedmail-headers
76123
49ec84aacf0b (feedmail-message-id-generator, feedmail-date-generator): Fix custom types.
John Paul Wallington <jpw@pobox.com>
parents: 73728
diff changeset
669 :type '(choice (const t) (const nil) function)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
670 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
671
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
672
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
673 (defcustom feedmail-fiddle-headers-upwardly t
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
674 "Non-nil means fiddled header fields should go at the top of the header.
42206
0f4506820432 Doc fix.
Pavel Janík <Pavel@Janik.cz>
parents: 41608
diff changeset
675 nil means insert them at the bottom. This is mostly a novelty issue since
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
676 the standards define the ordering of header fields to be immaterial and it's
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
677 fairly likely that some MTA along the way will have its own idea of what the
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
678 order should be, regardless of what you specify."
48378
f5dd8ebce303 (feedmail-fiddle-headers-upwardly,feedmail-fiddle-plex-user-list):
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47926
diff changeset
679 :group 'feedmail-headers
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
680 :type 'boolean
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
681 )
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
682
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
683
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
684 (defcustom feedmail-fiddle-plex-user-list nil
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
685 "If non-nil, should be a list of one or more fiddle-plexes.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
686 Each element of the list can also be a function which returns a
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
687 fiddle-plex.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
688
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
689 feedmail will use this list of fiddle-plexes to manipulate user-specified
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
690 message header fields. It does this after it has completed all normal
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
691 message header field manipulation and before calling `feedmail-last-chance-hook'.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
692
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
693 For an explanation of fiddle-plexes, see the documentation for the
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
694 variable `feedmail-fiddle-plex-blurb'. In contrast to some other fiddle-plex
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
695 manipulation functions, in this context, it makes no sense to have an element
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
696 which is nil, t, or a simple string."
48378
f5dd8ebce303 (feedmail-fiddle-headers-upwardly,feedmail-fiddle-plex-user-list):
Markus Rost <rost@math.uni-bielefeld.de>
parents: 47926
diff changeset
697 :group 'feedmail-headers
23265
92177ff080cc (feedmail-x-mailer-line-user-appendage,
Andreas Schwab <schwab@suse.de>
parents: 23222
diff changeset
698 :type '(repeat (choice function)
92177ff080cc (feedmail-x-mailer-line-user-appendage,
Andreas Schwab <schwab@suse.de>
parents: 23222
diff changeset
699 sexp) ; too complex to be described accurately
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
700 )
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
701
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
702
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
703 (defcustom feedmail-enable-spray nil
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
704 "If non-nil, transmit message separately to each addressee.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
705 feedmail normally accumulates a list of addressees and passes the message
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
706 along with that list to a buffer-eating function which expects any number
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
707 of addressees. If this variable is non-nil, however, feedmail will
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
708 repeatedly call the same buffer-eating function. Each time, the list of
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
709 addressees will be just one item from the original list. This only affects
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
710 the message envelope addresses and doesn't affect what appears in the
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
711 message headers except as noted.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
712
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
713 Spray mode is usually pointless, and if you can't think of a good reason for
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
714 it, you should avoid it since it is inherently less efficient than normal
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
715 multiple delivery. One reason to use it is to overcome mis-featured mail
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
716 transports which betray your trust by revealing Bcc: addressees in the
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
717 headers of a message. Another use is to do a crude form of mailmerge, for
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
718 which see `feedmail-spray-address-fiddle-plex-list'.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
719
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
720 If one of the calls to the buffer-eating function results in an error,
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
721 what happens next is carelessly defined, so beware."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
722 :group 'feedmail-spray
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
723 :type 'boolean
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
724 )
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
725
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
726 (defvar feedmail-spray-this-address nil
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
727 "Do not set or change this variable. See `feedmail-spray-address-fiddle-plex-list'.")
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
728
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
729 (defcustom feedmail-spray-address-fiddle-plex-list nil
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
730 "User-supplied specification for a crude form of mailmerge capability.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
731 When spraying is enabled, feedmail composes a list of envelope addresses.
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
732 In turn, `feedmail-spray-this-address' is temporarily set to each address
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
733 \(stripped of any comments and angle brackets\) and calls a function which
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
734 fiddles message headers according to this variable. See the documentation for
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
735 `feedmail-fiddle-plex-blurb', for an overview of fiddle-plex data structures.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
736
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
737 May be nil, in which case nothing in particular is done about message
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
738 headers for specific addresses.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
739
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
740 May be t, in which case a \"To:\" header is added to the message with
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
741 the stripped address as the header contents. The fiddle-plex operator
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
742 is 'supplement.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
743
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
744 May be a string, in which case the string is assumed to be the name of
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
745 a message header field with the stripped address serving as the value.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
746 The fiddle-plex operator is 'supplement.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
747
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
748 May be a function, in which case it is called with no arguments and is
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
749 expected to return nil, t, a string, another function, or a fiddle-plex.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
750 The result is used recursively.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
751
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
752 May be a list of any combination of the foregoing and fiddle-plexes. (A
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
753 value for this variable which consists of a single fiddle-plex must be
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
754 nested inside another list to avoid ambiguity.) If a list, each item
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
755 is acted on in turn as described above.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
756
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
757 For example,
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
758
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
759 (setq feedmail-spray-address-fiddle-plex-list 'my-address-embellisher)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
760
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
761 The idea of the example is that, during spray mode, as each message is
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
762 about to be transmitted to an individual address, the function will be
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
763 called and will consult `feedmail-spray-this-address' to find the
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
764 stripped envelope email address (no comments or angle brackets). The
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
765 function should return an embellished form of the address.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
766
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
767 The recipe for sending form letters is: (1) create a message with all
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
768 addressees on Bcc: headers; (2) tell feedmail to remove Bcc: headers
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
769 before sending the message; (3) create a function which will embellish
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
770 stripped addresses, if desired; (4) define `feedmail-spray-address-fiddle-plex-list'
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
771 appropriately; (5) send the message with `feedmail-enable-spray' set
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
772 non-nil; (6) stand back and watch co-workers wonder at how efficient
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
773 you are at accomplishing inherently inefficient things."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
774 :group 'feedmail-spray
23265
92177ff080cc (feedmail-x-mailer-line-user-appendage,
Andreas Schwab <schwab@suse.de>
parents: 23222
diff changeset
775 :type 'sexp ; too complex to be described accurately
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
776 )
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
777
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
778
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
779 (defcustom feedmail-enable-queue nil
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
780 "If non-nil, provide for stashing outgoing messages in a queue.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
781 This is the master on/off switch for feedmail message queuing.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
782 Queuing is quite handy for laptop-based users. It's also handy if you
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
783 get a lot of mail and process it more or less sequentially. For
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
784 example, you might change your mind about contents of a reply based on
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
785 a message you see a bit later.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
786
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
787 There is a separate queue for draft messages, intended to prevent
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
788 you from accidentally sending incomplete messages. The queues are
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
789 disk-based and intended for later transmission. The messages are
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
790 queued in their raw state as they appear in the mail-mode buffer and
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
791 can be arbitrarily edited later, before sending, by visiting the
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
792 appropriate file in the queue directory (and setting the buffer to
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
793 mail-mode or whatever). If you visit a file in the queue directory
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
794 and try to queue it again, it will just get saved in its existing file
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
795 name. You can move a message from the draft to the main queue or vice
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
796 versa by pretending to send it and then selecting whichever queue
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
797 directory you want at the prompt. The right thing will happen.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
798
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
799 To transmit all the messages in the queue, invoke the command
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
800 `feedmail-run-the-queue' or `feedmail-run-the-queue-no-prompts'."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
801 :group 'feedmail-queue
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
802 :type 'boolean
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
803 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
804
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
805
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
806 (defcustom feedmail-queue-runner-confirm-global nil
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
807 "If non-nil, give a y-or-n confirmation prompt before running the queue.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
808 Prompt even if the queue is about to be processed as a result of a call to
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
809 `feedmail-run-the-queue-no-prompts'. This gives you a way to bail out
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
810 without having to answer no to the individual message prompts."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
811 :group 'feedmail-queue
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
812 :type 'boolean)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
813
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
814
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
815 (defcustom feedmail-queue-directory
97142
c3512b2085a0 * bitmaps/README:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93975
diff changeset
816 (concat (getenv "HOME") "/mail/q")
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
817 "Name of a directory where messages will be queued.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
818 Directory will be created if necessary. Should be a string that
97142
c3512b2085a0 * bitmaps/README:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93975
diff changeset
819 doesn't end with a slash. Default is \"$HOME/mail/q\"."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
820 :group 'feedmail-queue
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
821 :type 'string
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
822 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
823
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
824
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
825 (defcustom feedmail-queue-draft-directory
97142
c3512b2085a0 * bitmaps/README:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93975
diff changeset
826 (concat (getenv "HOME") "/mail/draft")
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
827 "Name of a directory where draft messages will be queued.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
828 Directory will be created if necessary. Should be a string that
97142
c3512b2085a0 * bitmaps/README:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 93975
diff changeset
829 doesn't end with a slash. Default is \"$HOME/mail/draft\"."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
830 :group 'feedmail-queue
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
831 :type 'string
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
832 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
833
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
834
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
835 (defcustom feedmail-ask-before-queue t
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
836 "If non-nil, feedmail will ask what you want to do with the message.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
837 Default choices for the message action prompt will include sending it
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
838 immediately, putting it in the main queue, putting it in the draft
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
839 queue, or returning to the buffer to continue editing. Only matters if
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
840 queuing is enabled. If nil, the message is placed in the main queue
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
841 without a prompt."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
842 :group 'feedmail-queue
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
843 :type 'boolean
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
844 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
845
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
846
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
847 (defcustom feedmail-ask-before-queue-prompt "FQM: Message action (q, i, d, e, ?)? [%s]: "
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
848 "A string which will be used for the message action prompt.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
849 If it contains a \"%s\", that will be replaced with the value of
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
850 `feedmail-ask-before-queue-default'."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
851 :group 'feedmail-queue
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
852 :type 'string
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
853 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
854
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
855
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
856 (defcustom feedmail-ask-before-queue-reprompt "FQM: Please type q, i, d, or e; or ? for help [%s]: "
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
857 "A string which will be used for repompting after invalid input.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
858 If it contains a \"%s\", that will be replaced with the value of
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
859 `feedmail-ask-before-queue-default'."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
860 :group 'feedmail-queue
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
861 :type 'string
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
862 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
863
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
864
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
865 (defcustom feedmail-ask-before-queue-default "queue"
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
866 "Meaning if user hits return in response to the message action prompt.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
867 Should be a character or a string; if a string, only the first
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
868 character is significant. Useful values are those described in
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
869 the help for the message action prompt."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
870 :group 'feedmail-queue
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
871 :type '(choice string integer) ;use integer to get char
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
872 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
873
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
874
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
875 (defvar feedmail-prompt-before-queue-standard-alist
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
876 '((?q . feedmail-message-action-queue)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
877 (?Q . feedmail-message-action-queue-strong)
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
878
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
879 (?d . feedmail-message-action-draft)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
880 (?r . feedmail-message-action-draft)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
881 (?D . feedmail-message-action-draft-strong)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
882 (?R . feedmail-message-action-draft-strong)
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
883
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
884 (?e . feedmail-message-action-edit)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
885 (?E . feedmail-message-action-edit)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
886 (?\C-g . feedmail-message-action-edit)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
887 (?n . feedmail-message-action-edit)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
888 (?N . feedmail-message-action-edit)
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
889
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
890 (?i . feedmail-message-action-send)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
891 (?I . feedmail-message-action-send-strong)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
892 (?s . feedmail-message-action-send)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
893 (?S . feedmail-message-action-send-strong)
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
894
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
895 (?* . feedmail-message-action-toggle-spray)
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
896
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
897 (?\C-v . feedmail-message-action-help)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
898 (?? . feedmail-message-action-help))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
899 "An alist of choices for the message action prompt.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
900 All of the values are function names, except help, which is a special
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
901 symbol that calls up help for the prompt (the help describes the
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
902 actions from the standard alist). To customize your own choices,
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
903 define a similar alist called `feedmail-prompt-before-queue-user-alist'.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
904 The actual alist used for message action will be the standard alist
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
905 overlaid with the user-alist. To neutralize an item in the standard
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
906 alist without providing a replacement, define an appropriate element
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
907 in the user alist with a value of nil." )
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
908
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
909
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
910 (defcustom feedmail-prompt-before-queue-user-alist nil
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
911 "See `feedmail-prompt-before-queue-standard-alist'."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
912 :group 'feedmail-queue
23265
92177ff080cc (feedmail-x-mailer-line-user-appendage,
Andreas Schwab <schwab@suse.de>
parents: 23222
diff changeset
913 :type '(repeat (cons character function))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
914 )
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
915
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
916
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
917 (defcustom feedmail-prompt-before-queue-help-supplement nil
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
918 "User-provided supplementary help string for the message action prompt.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
919 When the message action prompt is shown, the user can as for verbose help,
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
920 at which point a buffer pops up describing the meaning of possible
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
921 responses to the prompt. Through various customizations (see, for
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
922 example, `feedmail-prompt-before-queue-user-alist'), the available responses
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
923 and the prompt itself can be changed. If this variable is set to a string
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
924 value, that string is written to the help buffer after the standard info.
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
925 It may contain embedded line breaks. It will be printed via `princ'."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
926 :group 'feedmail-queue
23265
92177ff080cc (feedmail-x-mailer-line-user-appendage,
Andreas Schwab <schwab@suse.de>
parents: 23222
diff changeset
927 :type '(choice (const nil) string)
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
928 )
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
929
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
930
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
931 (defcustom feedmail-queue-reminder-alist
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
932 '((after-immediate . feedmail-queue-reminder-brief)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
933 (after-queue . feedmail-queue-reminder-medium)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
934 (after-draft . feedmail-queue-reminder-medium)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
935 (after-run . feedmail-queue-reminder-brief)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
936 (on-demand . feedmail-run-the-queue-global-prompt))
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
937 "See `feedmail-queue-reminder'."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
938 :group 'feedmail-queue
23265
92177ff080cc (feedmail-x-mailer-line-user-appendage,
Andreas Schwab <schwab@suse.de>
parents: 23222
diff changeset
939 :type '(repeat (cons (choice :tag "Event"
92177ff080cc (feedmail-x-mailer-line-user-appendage,
Andreas Schwab <schwab@suse.de>
parents: 23222
diff changeset
940 (const on-demand)
92177ff080cc (feedmail-x-mailer-line-user-appendage,
Andreas Schwab <schwab@suse.de>
parents: 23222
diff changeset
941 (const after-immediate)
92177ff080cc (feedmail-x-mailer-line-user-appendage,
Andreas Schwab <schwab@suse.de>
parents: 23222
diff changeset
942 (const after-queue)
92177ff080cc (feedmail-x-mailer-line-user-appendage,
Andreas Schwab <schwab@suse.de>
parents: 23222
diff changeset
943 (const after-draft)
92177ff080cc (feedmail-x-mailer-line-user-appendage,
Andreas Schwab <schwab@suse.de>
parents: 23222
diff changeset
944 (const after-run))
92177ff080cc (feedmail-x-mailer-line-user-appendage,
Andreas Schwab <schwab@suse.de>
parents: 23222
diff changeset
945 function))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
946 )
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
947
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
948
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
949 (defcustom feedmail-queue-chatty t
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
950 "If non-nil, blat a few status messages and such in the mini-buffer.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
951 If nil, just do the work and don't pester people about what's going on.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
952 In some cases, though, specific options inspire mini-buffer prompting.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
953 That's not affected by this variable setting. Also does not control
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
954 reporting of error/abnormal conditions."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
955 :group 'feedmail-queue
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
956 :type 'boolean
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
957 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
958
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
959
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
960 (defcustom feedmail-queue-chatty-sit-for 2
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
961 "Duration of pause after most queue-related messages.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
962 After some messages are divulged, it is prudent to pause before
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
963 something else obliterates them. This value controls the duration of
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
964 the pause."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
965 :group 'feedmail-queue
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
966 :type 'integer
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
967 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
968
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
969
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
970 (defcustom feedmail-queue-run-orderer nil
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
971 "If non-nil, name a function which will sort the queued messages.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
972 The function is called during a running of the queue for sending, and
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
973 takes one argument, a list of the files in the queue directory. It
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
974 may contain the names of non-message files, and it's okay to leave
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
975 them in the list when reordering it; they get skipped over later.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
976 When nil, the default action processes the messages in normal sort
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
977 order by queued file name, which will typically result in the order
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
978 they were placed in the queue."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
979 :group 'feedmail-queue
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
980 :type '(choice (const nil) function)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
981 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
982
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
983
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
984 (defcustom feedmail-queue-use-send-time-for-date nil
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
985 "If non-nil, use send time for the Date: header value.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
986 This variable is used by the default date generating function,
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
987 feedmail-default-date-generator. If nil, the default, the
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
988 last-modified timestamp of the queue file is used to create the
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
989 message Date: header; if there is no queue file, the current time is
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
990 used."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
991 :group 'feedmail-queue
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
992 :type 'boolean
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
993 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
994
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
995
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
996 (defcustom feedmail-queue-use-send-time-for-message-id nil
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
997 "If non-nil, use send time for the Message-Id: header value.
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
998 This variable is used by the default Message-Id: generating function,
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
999 `feedmail-default-message-id-generator'. If nil, the default, the
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1000 last-modified timestamp of the queue file is used to create the
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
1001 message Message-Id: header; if there is no queue file, the current time is
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1002 used."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1003 :group 'feedmail-queue
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1004 :type 'boolean
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1005 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1006
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1007
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1008 (defcustom feedmail-ask-for-queue-slug nil
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
1009 "If non-nil, prompt user for part of the queue file name.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1010 The file will automatically get the FQM suffix and an embedded
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1011 sequence number for uniqueness, so don't specify that. feedmail will
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1012 get rid of all characters other than alphanumeric and hyphen in the
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1013 results. If this variable is nil or if you just hit return in
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1014 response to the prompt, feedmail queuing will take care of things
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1015 properly. At the prompt, completion is available if you want to see
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1016 what filenames are already in use, though, as noted, you will not be
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1017 typing a complete file name. You probably don't want to be bothered
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1018 with this prompting since feedmail, by default, uses queue file names
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1019 based on the subjects of the messages."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1020 :group 'feedmail-queue
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1021 :type 'boolean
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1022 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1023
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1024
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1025 (defcustom feedmail-queue-slug-maker 'feedmail-queue-subject-slug-maker
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
1026 "If non-nil, a function which creates part of the queued file name.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1027 Takes a single argument giving the name of the directory into
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1028 which the message will be queued. The returned string should be just
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1029 the non-directory filename part, without FQM suffix or uniquifying
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1030 sequence numbers. The current buffer holds the raw message. The
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1031 default function creates the slug based on the message subject, if
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1032 any."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1033 :group 'feedmail-queue
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1034 :type '(choice (const nil) function)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1035 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1036
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1037
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1038 (defcustom feedmail-queue-default-file-slug t
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
1039 "Indicates what to use for subject-less messages when forming a file name.
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1040 When feedmail queues a message, it creates a unique file name. By default,
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1041 the file name is based in part on the subject of the message being queued.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1042 If there is no subject, consult this variable. See documentation for the
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1043 function `feedmail-queue-subject-slug-maker'.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1044
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1045 If t, an innocuous default is used.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1046
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1047 If a string, it is used directly.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1048
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1049 If a function, it is called with no arguments from the buffer containing the raw
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1050 text of the message. It must return a string (which may be empty).
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1051
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1052 If the symbol 'ask, you will be prompted for a string in the mini-buffer.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1053 Filename completion is available so that you can inspect what's already been
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1054 used, but feedmail will do further manipulation on the string you return, so
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1055 it's not expected to be a complete filename."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1056 :group 'feedmail-queue
23265
92177ff080cc (feedmail-x-mailer-line-user-appendage,
Andreas Schwab <schwab@suse.de>
parents: 23222
diff changeset
1057 :type '(choice (const :tag "Default" t) string function (const ask))
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1058 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1059
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1060
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1061 (defcustom feedmail-queue-fqm-suffix ".fqm"
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
1062 "The FQM suffix used to distinguish feedmail queued message files.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1063 You probably want this to be a period followed by some letters and/or
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1064 digits. The distinction is to be able to tell them from other random
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1065 files that happen to be in the `feedmail-queue-directory' or
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1066 `feedmail-queue-draft-directory'. By the way, FQM stands for feedmail
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1067 queued message."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1068 :group 'feedmail-queue
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1069 :type 'string
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1070 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1071
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1072
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1073 (defcustom feedmail-nuke-buffer-after-queue nil
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
1074 "If non-nil, silently kill the buffer after a message is queued.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1075 You might like that since a side-effect of queueing the message is
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1076 that its buffer name gets changed to the filename. That means that
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1077 the buffer won't be reused for the next message you compose. If you
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1078 are using VM for creating messages, you probably want to leave this
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1079 nil, since VM has its own options for managing the recycling of
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1080 message buffers."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1081 :group 'feedmail-queue
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1082 :type 'boolean
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1083 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1084
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1085
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1086 (defcustom feedmail-queue-auto-file-nuke nil
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
1087 "If non-nil, automatically delete queue files when a message is sent.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1088 Normally, feedmail will notice such files when you send a message in
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1089 immediate mode (i.e., not when you're running the queue) and will ask if
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1090 you want to delete them. Since the answer is usually yes, setting this
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1091 variable to non-nil will tell feedmail to skip the prompt and just delete
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1092 the file without bothering you."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1093 :group 'feedmail-queue
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1094 :type 'boolean
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1095 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1096
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1097
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1098 ;; defvars to make byte-compiler happy(er)
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1099 (defvar feedmail-error-buffer nil)
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1100 (defvar feedmail-prepped-text-buffer nil)
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1101 (defvar feedmail-raw-text-buffer nil)
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1102 (defvar feedmail-address-list nil)
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1103
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1104
23409
b9c1f9b1dac9 (feedmail-queue-runner-is-active): Definition moved.
Richard M. Stallman <rms@gnu.org>
parents: 23265
diff changeset
1105 (defvar feedmail-queue-runner-is-active nil
b9c1f9b1dac9 (feedmail-queue-runner-is-active): Definition moved.
Richard M. Stallman <rms@gnu.org>
parents: 23265
diff changeset
1106 "*Non-nil means we're inside the logic of the queue-running loop.
b9c1f9b1dac9 (feedmail-queue-runner-is-active): Definition moved.
Richard M. Stallman <rms@gnu.org>
parents: 23265
diff changeset
1107 That is, iterating over all messages in the queue to send them. In
b9c1f9b1dac9 (feedmail-queue-runner-is-active): Definition moved.
Richard M. Stallman <rms@gnu.org>
parents: 23265
diff changeset
1108 that case, the value is the name of the queued message file currently
b9c1f9b1dac9 (feedmail-queue-runner-is-active): Definition moved.
Richard M. Stallman <rms@gnu.org>
parents: 23265
diff changeset
1109 being processed. This can be used for differentiating customized code
b9c1f9b1dac9 (feedmail-queue-runner-is-active): Definition moved.
Richard M. Stallman <rms@gnu.org>
parents: 23265
diff changeset
1110 for different scenarios. Users shouldn't set or change this
b9c1f9b1dac9 (feedmail-queue-runner-is-active): Definition moved.
Richard M. Stallman <rms@gnu.org>
parents: 23265
diff changeset
1111 variable, but may depend on its value as described here.")
b9c1f9b1dac9 (feedmail-queue-runner-is-active): Definition moved.
Richard M. Stallman <rms@gnu.org>
parents: 23265
diff changeset
1112
b9c1f9b1dac9 (feedmail-queue-runner-is-active): Definition moved.
Richard M. Stallman <rms@gnu.org>
parents: 23265
diff changeset
1113
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1114 (defun feedmail-mail-send-hook-splitter ()
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1115 "Facilitate dividing `mail-send-hook' things into queued and immediate cases.
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1116 If you have `mail-send-hook' functions that should only be called for sending/
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1117 queueing messages or only be called for the sending of queued messages, this is
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1118 for you. Add this function to `mail-send-hook' with something like this:
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1119
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1120 (add-hook 'mail-send-hook 'feedmail-mail-send-hook-splitter)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1121
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1122 Then add the functions you want called to either `feedmail-mail-send-hook-queued'
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1123 or `feedmail-mail-send-hook', as apprpriate. The distinction is that
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1124 `feedmail-mail-send-hook' will be called when you send mail from a composition
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1125 buffer (typically by typing C-c C-c), whether the message is sent immediately
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1126 or placed in the queue or drafts directory. `feedmail-mail-send-hook-queued' is
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1127 called when messages are being sent from the queue directory, typically via a
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1128 call to `feedmail-run-the-queue'."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1129 (if feedmail-queue-runner-is-active
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1130 (run-hooks 'feedmail-mail-send-hook-queued)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1131 (run-hooks 'feedmail-mail-send-hook))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1132 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1133
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1134
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1135 (defvar feedmail-mail-send-hook nil
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1136 "*See documentation for `feedmail-mail-send-hook-splitter'.")
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1137
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1138
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1139 (defvar feedmail-mail-send-hook-queued nil
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1140 "*See documentation for `feedmail-mail-send-hook-splitter'.")
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1141
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1142
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1143 (defun feedmail-confirm-addresses-hook-example ()
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1144 "An example of a `feedmail-last-chance-hook'.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1145 It shows the simple addresses and gets a confirmation. Use as:
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1146 (setq feedmail-last-chance-hook 'feedmail-confirm-addresses-hook-example)."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1147 (save-window-excursion
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1148 (display-buffer (set-buffer (get-buffer-create " F-C-A-H-E")))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1149 (erase-buffer)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1150 (insert (mapconcat 'identity feedmail-address-list " "))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1151 (if (not (y-or-n-p "How do you like them apples? "))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1152 (error "FQM: Sending...gave up in last chance hook")
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1153 )))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1154
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1155
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1156 (defcustom feedmail-last-chance-hook nil
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
1157 "User's last opportunity to modify the message on its way out.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1158 It has already had all the header prepping from the standard package.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1159 The next step after running the hook will be to push the buffer into a
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1160 subprocess that mails the mail. The hook might be interested in
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1161 these: (1) `feedmail-prepped-text-buffer' contains the header and body
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1162 of the message, ready to go; (2) `feedmail-address-list' contains a list
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1163 of simplified recipients of addresses which are to be given to the
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1164 subprocess (the hook may change the list); (3) `feedmail-error-buffer'
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1165 is an empty buffer intended to soak up errors for display to the user.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1166 If the hook allows interactive activity, the user should not send more
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1167 mail while in the hook since some of the internal buffers will be
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1168 reused and things will get confused."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1169 :group 'feedmail-misc
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1170 :type 'hook
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1171 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1172
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1173
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1174 (defcustom feedmail-before-fcc-hook nil
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
1175 "User's last opportunity to modify the message before Fcc action.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1176 It has already had all the header prepping from the standard package.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1177 The next step after running the hook will be to save the message via
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
1178 Fcc: processing. The hook might be interested in these: (1)
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1179 `feedmail-prepped-text-buffer' contains the header and body of the
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1180 message, ready to go; (2) `feedmail-address-list' contains a list of
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1181 simplified recipients of addressees to whom the message was sent (3)
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1182 `feedmail-error-buffer' is an empty buffer intended to soak up errors
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1183 for display to the user. If the hook allows interactive activity, the
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1184 user should not send more mail while in the hook since some of the
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1185 internal buffers will be reused and things will get confused."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1186 :group 'feedmail-misc
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1187 :type 'hook
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1188 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1189
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1190 (defcustom feedmail-queue-runner-mode-setter
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1191 '(lambda (&optional arg) (mail-mode))
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
1192 "A function to set the proper mode of a message file.
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1193 Called when the message is read back out of the queue directory with a single
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1194 argument, the optional argument used in the call to
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1195 `feedmail-run-the-queue' or `feedmail-run-the-queue-no-prompts'.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1196
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1197 Most people want `mail-mode', so the default value is an anonymous
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1198 function which is just a wrapper to ignore the supplied argument when
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1199 calling it, but here's your chance to have something different.
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1200 Called with funcall, not `call-interactively'."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1201 :group 'feedmail-queue
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1202 :type 'function
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1203 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1204
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1205
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1206 (defcustom feedmail-queue-alternative-mail-header-separator nil
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
1207 "Alternative header demarcation for queued messages.
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1208 If you sometimes get alternative values for `mail-header-separator' in
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1209 queued messages, set the value of this variable to whatever it is.
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1210 For example, `rmail-resend' uses a `mail-header-separator' value of empty
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1211 string (\"\") when you send/queue a message.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1212
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1213 When trying to send a queued message, if the value of this variable is
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1214 non-nil, feedmail will first try to send the message using the value
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1215 of `mail-header-separator'. If it can't find that, it will temporarily
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1216 set `mail-header-separator' to the value of
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1217 `feedmail-queue-alternative-mail-header-separator' and try again."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1218 :group 'feedmail-queue
23265
92177ff080cc (feedmail-x-mailer-line-user-appendage,
Andreas Schwab <schwab@suse.de>
parents: 23222
diff changeset
1219 :type '(choice (const nil) string)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1220 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1221
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1222
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1223 (defcustom feedmail-queue-runner-message-sender 'mail-send-and-exit
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
1224 "Function to initiate sending a message file.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1225 Called for each message read back out of the queue directory with a
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1226 single argument, the optional argument used in the call to
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1227 `feedmail-run-the-queue' or `feedmail-run-the-queue-no-prompts'.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1228 Interactively, that argument will be the prefix argument. Most people
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1229 want `mail-send-and-exit' (bound to C-c C-c in mail-mode), but here's
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1230 your chance to have something different. Called with `funcall', not
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1231 `call-interactively'."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1232 :group 'feedmail-queue
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1233 :type 'function
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1234 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1235
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1236
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1237 (defcustom feedmail-queue-runner-cleaner-upper
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1238 '(lambda (fqm-file &optional arg)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1239 (delete-file fqm-file)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1240 (if (and arg feedmail-queue-chatty) (message "FQM: Nuked %s" fqm-file)))
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
1241 "Function that will be called after a message has been sent.
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1242 Not called in the case of errors. This function is called with two
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1243 arguments: the name of the message queue file for the message just sent,
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1244 and the optional argument used in the call to `feedmail-run-the-queue'
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1245 or `feedmail-run-the-queue-no-prompts' (prefix arg if interactive).
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1246 In any case, the affiliated buffer is killed elsewhere, so don't do that
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1247 inside this function. Return value is ignored.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1248
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1249 The default action is an anonymous function which gets rid of the file
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1250 from the queue directory. With a non-nil second argument, a brief
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1251 message is give for each file deleted. You could replace this
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1252 function, for example, to archive all of your sent messages someplace
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1253 \(though there are better ways to get that particular result\)."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1254 :group 'feedmail-queue
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1255 :type 'function
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1256 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1257
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1258
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1259 (defvar feedmail-is-a-resend nil
42706
be541feb06cc Fix typo.
Pavel Janík <Pavel@Janik.cz>
parents: 42206
diff changeset
1260 "*Non-nil means the message is a Resend (in the RFC-822 sense).
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1261 This affects the composition of certain headers. feedmail sets this
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1262 variable as soon as it starts prepping the message text buffer, so any
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1263 user-supplied functions can rely on it. Users shouldn't set or change this
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1264 variable, but may depend on its value as described here.")
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1265
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1266
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1267 (defcustom feedmail-buffer-eating-function 'feedmail-buffer-to-binmail
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
1268 "Function used to send the prepped buffer to a subprocess.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1269 The function's three (mandatory) arguments are: (1) the buffer
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1270 containing the prepped message; (2) a buffer where errors should be
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1271 directed; and (3) a list containing the addresses individually as
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1272 strings. Three popular choices for this are
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1273 `feedmail-buffer-to-binmail', `feedmail-buffer-to-smtpmail', and
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1274 `feedmail-buffer-to-sendmail'. If you use the sendmail form, you
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1275 probably want to set `feedmail-nuke-bcc' and/or `feedmail-nuke-resent-bcc'
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1276 to nil. If you use the binmail form, check the value of
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1277 `feedmail-binmail-template'."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1278 :group 'feedmail-misc
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1279 :type 'function
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1280 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1281
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1282
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1283 (defcustom feedmail-binmail-template (if mail-interactive "/bin/mail %s" "/bin/rmail %s")
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
1284 "Command template for the subprocess which will get rid of the mail.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1285 It can result in any command understandable by /bin/sh. Might not
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
1286 work at all in non-Unix environments. The single '%s', if present,
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1287 gets replaced by the space-separated, simplified list of addressees.
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1288 Used in `feedmail-buffer-to-binmail' to form the shell command which
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1289 will receive the contents of the prepped buffer as stdin. If you'd
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1290 like your errors to come back as mail instead of immediately in a
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1291 buffer, try /bin/rmail instead of /bin/mail (this can be accomplished
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1292 by keeping the default nil setting of `mail-interactive'). You might
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1293 also like to consult local mail experts for any other interesting
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1294 command line possibilities."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1295 :group 'feedmail-misc
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1296 :type 'string
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1297 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1298
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1299
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1300 ;; feedmail-buffer-to-binmail, feedmail-buffer-to-sendmail, and
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1301 ;; feedmail-buffer-to-smptmail are the only things provided for values
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1302 ;; for the variable feedmail-buffer-eating-function. It's pretty easy
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1303 ;; to write your own, though.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1304 (defun feedmail-buffer-to-binmail (prepped errors-to addr-listoid)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1305 "Function which actually calls /bin/mail as a subprocess.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1306 Feeds the buffer to it."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1307 (set-buffer prepped)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1308 (apply
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1309 'call-process-region
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1310 (append (list (point-min) (point-max) "/bin/sh" nil errors-to nil "-c"
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1311 (format feedmail-binmail-template
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1312 (mapconcat 'identity addr-listoid " "))))))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1313
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1314
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1315 (defun feedmail-buffer-to-sendmail (prepped errors-to addr-listoid)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1316 "Function which actually calls sendmail as a subprocess.
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
1317 Feeds the buffer to it. Probably has some flaws for Resent-* and other
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1318 complicated cases."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1319 (set-buffer prepped)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1320 (apply 'call-process-region
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1321 (append (list (point-min) (point-max)
72635
e4183d5068ec * mail/feedmail.el (feedmail-buffer-to-sendmail): Look for
Chong Yidong <cyd@stupidchicken.com>
parents: 66668
diff changeset
1322 (cond ((boundp 'sendmail-program)
e4183d5068ec * mail/feedmail.el (feedmail-buffer-to-sendmail): Look for
Chong Yidong <cyd@stupidchicken.com>
parents: 66668
diff changeset
1323 sendmail-program)
e4183d5068ec * mail/feedmail.el (feedmail-buffer-to-sendmail): Look for
Chong Yidong <cyd@stupidchicken.com>
parents: 66668
diff changeset
1324 ((file-exists-p "/usr/sbin/sendmail")
e4183d5068ec * mail/feedmail.el (feedmail-buffer-to-sendmail): Look for
Chong Yidong <cyd@stupidchicken.com>
parents: 66668
diff changeset
1325 "/usr/sbin/sendmail")
e4183d5068ec * mail/feedmail.el (feedmail-buffer-to-sendmail): Look for
Chong Yidong <cyd@stupidchicken.com>
parents: 66668
diff changeset
1326 ((file-exists-p "/usr/lib/sendmail")
e4183d5068ec * mail/feedmail.el (feedmail-buffer-to-sendmail): Look for
Chong Yidong <cyd@stupidchicken.com>
parents: 66668
diff changeset
1327 "/usr/lib/sendmail")
e4183d5068ec * mail/feedmail.el (feedmail-buffer-to-sendmail): Look for
Chong Yidong <cyd@stupidchicken.com>
parents: 66668
diff changeset
1328 ((file-exists-p "/usr/ucblib/sendmail")
e4183d5068ec * mail/feedmail.el (feedmail-buffer-to-sendmail): Look for
Chong Yidong <cyd@stupidchicken.com>
parents: 66668
diff changeset
1329 "/usr/ucblib/sendmail")
e4183d5068ec * mail/feedmail.el (feedmail-buffer-to-sendmail): Look for
Chong Yidong <cyd@stupidchicken.com>
parents: 66668
diff changeset
1330 (t "fakemail"))
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1331 nil errors-to nil "-oi" "-t")
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1332 ;; provide envelope "from" to sendmail; results will vary
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1333 (list "-f" user-mail-address)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1334 ;; These mean "report errors by mail" and "deliver in background".
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1335 (if (null mail-interactive) '("-oem" "-odb")))))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1336
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1337 ;; provided by jam@austin.asc.slb.com (James A. McLaughlin);
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1338 ;; simplified by WJC after more feedmail development;
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1339 ;; idea (but not implementation) of copying smtpmail trace buffer to
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1340 ;; feedmail error buffer from:
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1341 ;; Mon 14-Oct-1996; Douglas Gray Stephens
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1342 ;; modified to insert error for displaying
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1343 (defun feedmail-buffer-to-smtpmail (prepped errors-to addr-listoid)
33984
d81160aa663f Require smtpmail when compiling.
Dave Love <fx@gnu.org>
parents: 33424
diff changeset
1344 "Function which actually calls `smtpmail-via-smtp' to send buffer as e-mail."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1345 ;; I'm not sure smtpmail.el is careful about the following
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1346 ;; return value, but it also uses it internally, so I will fear
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1347 ;; no evil.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1348 (require 'smtpmail)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1349 (if (not (smtpmail-via-smtp addr-listoid prepped))
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1350 (progn
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1351 (set-buffer errors-to)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1352 (insert "Send via smtpmail failed. Probable SMTP protocol error.\n")
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1353 (insert "Look for details below or in the *Messages* buffer.\n\n")
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1354 (let ((case-fold-search t)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1355 ;; don't be overconfident about the name of the trace buffer
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1356 (tracer (concat "trace.*smtp.*" (regexp-quote smtpmail-smtp-server))))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1357 (mapcar
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1358 '(lambda (buffy)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1359 (if (string-match tracer (buffer-name buffy))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1360 (progn
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1361 (insert "SMTP Trace from " (buffer-name buffy) "\n---------------")
66668
857eb702a3f1 Use insert-buffer-substring, not insert-buffer.
Richard M. Stallman <rms@gnu.org>
parents: 65797
diff changeset
1362 (insert-buffer-substring buffy)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1363 (insert "\n\n"))))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1364 (buffer-list))))))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1365
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1366
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1367 ;; just a place to park a docstring
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1368 (defconst feedmail-fiddle-plex-blurb nil
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1369 "A fiddle-plex is a concise way of specifying header field fiddling.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1370 It is a list of up to 4 elements: NAME, VALUE, ACTION, FOLDING. The element
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1371 VALUE can also be a list sometimes.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1372
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1373 NAME is the name of the header field to be fiddled with. Although case
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1374 doesn't matter in looking for headers, case of NAME is preserved when a header
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1375 is inserted via fiddling. It shouldn't include the trailing colon.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1376
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1377 VALUE is either nil, a simple string, a function returning nil or a string, or,
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1378 as described below for ACTION `combine', a list of up to three values.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1379
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1380 ACTION describes the nature of the fiddling to be done. Possibilities
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1381 for ACTION (default is `supplement'):
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1382
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1383 `supplement' Leave other like fields as-is, insert this one.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1384
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1385 `replace' Delete other like fields, if any, and insert this one.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1386
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1387 `create' Insert this one only if no like field exists.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1388
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1389 `combine' Combine aggregate values of like fields with this one.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1390 In this case, VALUE has a special form. It is a list
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1391 of three items: VAL-PRE, VAL-LIKE, and VAL-POST.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1392 VAL-PRE and VAL-POST are strings or nil. VAL-LIKE may
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1393 be either a string or a function (it may also be nil,
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1394 but there's not much point to that).
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1395
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1396 Values of like header fields are aggregated, leading and
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1397 trailing whitespace is removed, and embedded
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1398 whitespace is left as-is. If there are no like
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1399 fields, or the aggregate value is an empty string,
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1400 VAL-LIKE is not used. Else, if VAL-LIKE is a function,
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1401 it is called with two arguments: NAME and the
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1402 aggregate like values. Else, if VAL-LIKE is a string, it is
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1403 used as a format string where a single \%s will be
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1404 replaced by the aggregate values of like fields.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1405
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1406 VAL-PRE, the results of using VAL-LIKE, and VAL-POST
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1407 are concatenated, and the result, if not nil and not
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1408 an empty string, is used as the new value for the
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1409 field. Although this description sounds a bit
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1410 complicated, the idea is to provide a mechanism for
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1411 combining the old value with a new value in a flexible
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1412 way. For example, if you wanted to add a new value to
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1413 an existing header field by adding a semi-colon and
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1414 then starting the new value on a continuation line,
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1415 you might specify this:
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1416
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1417 (nil \"%s;\\n\\t\" \"This is my new value\")
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1418
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1419 FOLDING can be nil, in which case VALUE is used as-is. If FOLDING is
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1420 non-nil, feedmail \"smart filling\" is done on VALUE just before
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1421 insertion.")
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1422
33984
d81160aa663f Require smtpmail when compiling.
Dave Love <fx@gnu.org>
parents: 33424
diff changeset
1423 ;;;###autoload
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1424 (defun feedmail-send-it ()
35616
47f26b110f6b (feedmail): Add :link.
Dave Love <fx@gnu.org>
parents: 33984
diff changeset
1425 "Send the current mail buffer using the Feedmail package.
47f26b110f6b (feedmail): Add :link.
Dave Love <fx@gnu.org>
parents: 33984
diff changeset
1426 This is a suitable value for `send-mail-function'. It can be used
47f26b110f6b (feedmail): Add :link.
Dave Love <fx@gnu.org>
parents: 33984
diff changeset
1427 with various lower-level mechanisms to provide features such as queueing."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1428
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1429 ;; avoid matching trouble over slash vs backslash by getting canonical
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1430 (if feedmail-queue-directory
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1431 (setq feedmail-queue-directory (expand-file-name feedmail-queue-directory)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1432 (if feedmail-queue-draft-directory
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1433 (setq feedmail-queue-draft-directory (expand-file-name feedmail-queue-draft-directory)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1434 (if (not feedmail-enable-queue) (feedmail-send-it-immediately)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1435 ;; else, queuing is enabled, should we ask about it or just do it?
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1436 (if feedmail-ask-before-queue
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1437 (funcall (feedmail-queue-send-edit-prompt))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1438 (feedmail-dump-message-to-queue feedmail-queue-directory 'after-queue))))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1439
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1440
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1441 (defun feedmail-message-action-send ()
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1442 ;; hooks can make this take a while so clear the prompt
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1443 (message "FQM: Immediate send...")
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1444 (feedmail-send-it-immediately))
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1445
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1446
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1447 ;; From a VM mailing list discussion and some suggestions from Samuel Mikes <smikes@alumni.hmc.edu>
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1448 (defun feedmail-queue-express-to-queue ()
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
1449 "Send message directly to the queue, with a minimum of fuss and bother."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1450 (interactive)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1451 (let ((feedmail-enable-queue t)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1452 (feedmail-ask-before-queue nil)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1453 (feedmail-queue-reminder-alist nil)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1454 (feedmail-queue-chatty-sit-for 0))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1455 (feedmail-send-it)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1456 )
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1457 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1458
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1459
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1460 (defun feedmail-queue-express-to-draft ()
110494
7c4da622f181 Remove leading `*' from docs of some defcustoms etc.
Glenn Morris <rgm@gnu.org>
parents: 106518
diff changeset
1461 "Send message directly to the draft queue, with a minimum of fuss and bother."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1462 (interactive)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1463 (let ((feedmail-queue-directory feedmail-queue-draft-directory))
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1464 (feedmail-queue-express-to-queue)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1465 )
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1466 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1467
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1468
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1469 (defun feedmail-message-action-send-strong ()
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1470 (let ((feedmail-confirm-outgoing nil)) (feedmail-message-action-send)))
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1471
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1472
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1473 (defun feedmail-message-action-edit ()
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1474 (error "FQM: Message not queued; returning to edit"))
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1475
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1476
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1477 (defun feedmail-message-action-draft ()
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1478 (feedmail-dump-message-to-queue feedmail-queue-draft-directory 'after-draft))
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1479
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1480
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1481 (defun feedmail-message-action-draft-strong ()
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1482 (let ((buffer-file-name nil))
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1483 (feedmail-message-action-draft)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1484
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1485
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1486 (defun feedmail-message-action-queue ()
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1487 (feedmail-dump-message-to-queue feedmail-queue-directory 'after-queue))
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1488
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1489
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1490 (defun feedmail-message-action-queue-strong ()
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1491 (let ((buffer-file-name nil))
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1492 (feedmail-message-action-queue)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1493
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1494
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1495 (defun feedmail-message-action-toggle-spray ()
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1496 (let ((feedmail-enable-spray (not feedmail-enable-spray)))
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1497 (if feedmail-enable-spray
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1498 (message "FQM: For this message, spray toggled ON")
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1499 (message "FQM: For this message, spray toggled OFF"))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1500 (sit-for 3)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1501 ;; recursion, but harmless
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1502 (feedmail-send-it)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1503
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1504
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1505 (defun feedmail-message-action-help ()
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1506 (let ((d-string " "))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1507 (if (stringp feedmail-ask-before-queue-default)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1508 (setq d-string feedmail-ask-before-queue-default)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1509 (setq d-string (char-to-string feedmail-ask-before-queue-default)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1510 (feedmail-queue-send-edit-prompt-help d-string)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1511 ;; recursive, but no worries (it goes deeper on user action)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1512 (feedmail-send-it)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1514
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1515 ;;;###autoload
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1516 (defun feedmail-run-the-queue-no-prompts (&optional arg)
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1517 "Like `feedmail-run-the-queue', but suppress confirmation prompts."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1518 (interactive "p")
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1519 (let ((feedmail-confirm-outgoing nil)) (feedmail-run-the-queue arg)))
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1520
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1521 ;;;###autoload
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1522 (defun feedmail-run-the-queue-global-prompt (&optional arg)
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1523 "Like `feedmail-run-the-queue', but with a global confirmation prompt.
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1524 This is generally most useful if run non-interactively, since you can
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1525 bail out with an appropriate answer to the global confirmation prompt."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1526 (interactive "p")
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1527 (let ((feedmail-queue-runner-confirm-global t)) (feedmail-run-the-queue arg)))
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1528
104775
21469025a673 (file-name-buffer-file-type-alist): Define for compiler.
Glenn Morris <rgm@gnu.org>
parents: 104662
diff changeset
1529 ;; letf fools the byte-compiler.
21469025a673 (file-name-buffer-file-type-alist): Define for compiler.
Glenn Morris <rgm@gnu.org>
parents: 104662
diff changeset
1530 (defvar file-name-buffer-file-type-alist)
21469025a673 (file-name-buffer-file-type-alist): Define for compiler.
Glenn Morris <rgm@gnu.org>
parents: 104662
diff changeset
1531
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1532 ;;;###autoload
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1533 (defun feedmail-run-the-queue (&optional arg)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1534 "Visit each message in the feedmail queue directory and send it out.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1535 Return value is a list of three things: number of messages sent, number of
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1536 messages skipped, and number of non-message things in the queue (commonly
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1537 backup file names and the like)."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1538 (interactive "p")
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1539 ;; avoid matching trouble over slash vs backslash by getting canonical
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1540 (if feedmail-queue-directory
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1541 (setq feedmail-queue-directory (expand-file-name feedmail-queue-directory)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1542 (if feedmail-queue-draft-directory
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1543 (setq feedmail-queue-draft-directory (expand-file-name feedmail-queue-draft-directory)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1544 (let* ((maybe-file)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1545 (qlist (feedmail-look-at-queue-directory feedmail-queue-directory))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1546 (dlist (feedmail-look-at-queue-directory feedmail-queue-draft-directory))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1547 (q-cnt (nth 0 qlist))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1548 (q-oth (nth 1 qlist))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1549 (d-cnt (nth 0 dlist))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1550 (d-oth (nth 1 dlist))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1551 (messages-sent 0)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1552 (messages-skipped 0)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1553 (blobby-buffer)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1554 (already-buffer)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1555 (this-mhsep)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1556 (do-the-run t)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1557 (list-of-possible-fqms))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1558 (if (and (> q-cnt 0) feedmail-queue-runner-confirm-global)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1559 (setq do-the-run
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1560 (if (fboundp 'y-or-n-p-with-timeout)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1561 (y-or-n-p-with-timeout (format "FQM: Draft: %dm+%d, Queue: %dm+%d; run the queue? "
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1562 d-cnt d-oth q-cnt q-oth)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1563 5 nil)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1564 (y-or-n-p (format "FQM: Draft: %dm+%d, Queue: %dm+%d; run the queue? "
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1565 d-cnt d-oth q-cnt q-oth))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1566 )))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1567 (if (not do-the-run)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1568 (setq messages-skipped q-cnt)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1569 (save-window-excursion
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1570 (setq list-of-possible-fqms (directory-files feedmail-queue-directory t))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1571 (if feedmail-queue-run-orderer
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1572 (setq list-of-possible-fqms (funcall feedmail-queue-run-orderer list-of-possible-fqms)))
85232
d473c33347de (feedmail-run-the-queue)
Glenn Morris <rgm@gnu.org>
parents: 76123
diff changeset
1573 (mapc
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1574 '(lambda (blobby)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1575 (setq maybe-file (expand-file-name blobby feedmail-queue-directory))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1576 (cond
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1577 ((file-directory-p maybe-file) nil) ; don't care about subdirs
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1578 ((feedmail-fqm-p blobby)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1579 (setq blobby-buffer (generate-new-buffer (concat "FQM " blobby)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1580 (setq already-buffer
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1581 (if (fboundp 'find-buffer-visiting) ; missing from XEmacs
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1582 (find-buffer-visiting maybe-file)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1583 (get-file-buffer maybe-file)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1584 (if (and already-buffer (buffer-modified-p already-buffer))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1585 (save-window-excursion
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1586 (display-buffer (set-buffer already-buffer))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1587 (if (fboundp 'y-or-n-p-with-timeout)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1588 ;; make a guess that the user just forgot to save
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1589 (if (y-or-n-p-with-timeout (format "FQM: Visiting %s; save before send? " blobby) 10 t)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1590 (save-buffer))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1591 (if (y-or-n-p (format "FQM: Visiting %s; save before send? " blobby))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1592 (save-buffer))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1593 )))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1594
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1595 (set-buffer blobby-buffer)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1596 (setq buffer-offer-save nil)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1597 (buffer-disable-undo blobby-buffer)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1598 (insert-file-contents-literally maybe-file)
22800
125816f37462 (feedmail-queue-send-edit-prompt-help-first):
Karl Heuer <kwzh@gnu.org>
parents: 22799
diff changeset
1599 ;; work around text-vs-binary weirdness and also around rmail-resend's creative
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1600 ;; manipulation of mail-header-separator
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1601 ;;
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1602 ;; if we don't find the normal M-H-S, and the alternative is defined but also
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1603 ;; not found, try reading the file a different way
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1604 ;;
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1605 ;; if M-H-S not found and (a-M-H-S is nil or not found)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1606 (if (and (not (feedmail-find-eoh t))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1607 (or (not feedmail-queue-alternative-mail-header-separator)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1608 (not
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1609 (let ((mail-header-separator feedmail-queue-alternative-mail-header-separator))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1610 (feedmail-find-eoh t)))))
104662
790bd85e4cb0 * mail/feedmail.el: Use CL macros.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 97142
diff changeset
1611 (letf ((file-name-buffer-file-type-alist nil)
790bd85e4cb0 * mail/feedmail.el: Use CL macros.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 97142
diff changeset
1612 ((default-value 'buffer-file-type) nil))
790bd85e4cb0 * mail/feedmail.el: Use CL macros.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 97142
diff changeset
1613 (erase-buffer) (insert-file-contents maybe-file)))
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1614 ;; if M-H-S not found and (a-M-H-S is non-nil and is found)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1615 ;; temporarily set M-H-S to the value of a-M-H-S
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1616 (if (and (not (feedmail-find-eoh t))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1617 feedmail-queue-alternative-mail-header-separator
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1618 (let ((mail-header-separator feedmail-queue-alternative-mail-header-separator))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1619 (feedmail-find-eoh t)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1620 (setq this-mhsep feedmail-queue-alternative-mail-header-separator)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1621 (setq this-mhsep mail-header-separator))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1622 (funcall feedmail-queue-runner-mode-setter arg)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1623 (condition-case nil ; don't give up the loop if user skips some
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1624 (let ((feedmail-enable-queue nil)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1625 (mail-header-separator this-mhsep)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1626 (feedmail-queue-runner-is-active maybe-file))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1627 (funcall feedmail-queue-runner-message-sender arg)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1628 (set-buffer blobby-buffer)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1629 (if (buffer-modified-p) ; still modified, means wasn't sent
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1630 (setq messages-skipped (1+ messages-skipped))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1631 (setq messages-sent (1+ messages-sent))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1632 (funcall feedmail-queue-runner-cleaner-upper maybe-file arg)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1633 (if (and already-buffer (not (file-exists-p maybe-file)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1634 ;; we have gotten rid of the file associated with the
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1635 ;; buffer, so update the buffer's notion of that
105829
328150f0cf76 * url-util.el (url-insert-entities-in-string):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104775
diff changeset
1636 (with-current-buffer already-buffer
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1637 (setq buffer-file-name nil)))))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1638 (error (setq messages-skipped (1+ messages-skipped))))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1639 (kill-buffer blobby-buffer)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1640 (if feedmail-queue-chatty
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1641 (progn
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1642 (message "FQM: %d to go, %d sent, %d skipped (%d other files ignored)"
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1643 (- q-cnt messages-sent messages-skipped)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1644 messages-sent messages-skipped q-oth)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1645 (sit-for feedmail-queue-chatty-sit-for))))))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1646 list-of-possible-fqms)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1647 (if feedmail-queue-chatty
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1648 (progn
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1649 (message "FQM: %d sent, %d skipped (%d other files ignored)"
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1650 messages-sent messages-skipped q-oth)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1651 (sit-for feedmail-queue-chatty-sit-for)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1652 (feedmail-queue-reminder 'after-run)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1653 (sit-for feedmail-queue-chatty-sit-for)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1654 (list messages-sent messages-skipped q-oth)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1655
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1656
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1657 ;;;###autoload
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1658 (defun feedmail-queue-reminder (&optional what-event)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1659 "Perform some kind of reminder activity about queued and draft messages.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1660 Called with an optional symbol argument which says what kind of event
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1661 is triggering the reminder activity. The default is 'on-demand, which
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1662 is what you typically would use if you were putting this in your Emacs start-up
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1663 or mail hook code. Other recognized values for WHAT-EVENT (these are passed
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1664 internally by feedmail):
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1665
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1666 after-immediate (a message has just been sent in immediate mode)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1667 after-queue (a message has just been queued)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1668 after-draft (a message has just been placed in the draft directory)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1669 after-run (the queue has just been run, possibly sending messages)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1670
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1671 WHAT-EVENT is used as a key into the table `feedmail-queue-reminder-alist'. If
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1672 the associated value is a function, it is called without arguments and is expected
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1673 to perform the reminder activity. You can supply your own reminder functions
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1674 by redefining `feedmail-queue-reminder-alist'. If you don't want any reminders,
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1675 you can set `feedmail-queue-reminder-alist' to nil."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1676 (interactive "p")
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1677 (let ((key (if (and what-event (symbolp what-event)) what-event 'on-demand)) entry reminder)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1678 (setq entry (assoc key feedmail-queue-reminder-alist))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1679 (setq reminder (cdr entry))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1680 (if (fboundp reminder) (funcall reminder)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1681 )
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1682
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1683
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1684 (defun feedmail-queue-reminder-brief ()
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1685 "Brief display of draft and queued message counts in modeline."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1686 (interactive)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1687 (let (q-cnt d-cnt q-lis d-lis)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1688 (setq q-lis (feedmail-look-at-queue-directory feedmail-queue-directory))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1689 (setq d-lis (feedmail-look-at-queue-directory feedmail-queue-draft-directory))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1690 (setq q-cnt (car q-lis))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1691 (setq d-cnt (car d-lis))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1692 (if (or (> q-cnt 0) (> d-cnt 0))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1693 (progn
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1694 (message "FQM: [D: %d, Q: %d]" d-cnt q-cnt))))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1695 )
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1696
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1697
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1698 (defun feedmail-queue-reminder-medium ()
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1699 "Verbose display of draft and queued message counts in modeline."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1700 (interactive)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1701 (let (q-cnt d-cnt q-oth d-oth q-lis d-lis)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1702 (setq q-lis (feedmail-look-at-queue-directory feedmail-queue-directory))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1703 (setq d-lis (feedmail-look-at-queue-directory feedmail-queue-draft-directory))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1704 (setq q-cnt (car q-lis))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1705 (setq d-cnt (car d-lis))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1706 (setq q-oth (nth 1 q-lis))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1707 (setq d-oth (nth 1 d-lis))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1708 (if (or (> q-cnt 0) (> d-cnt 0))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1709 (progn
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1710 (message "FQM: Draft: %dm+%d in \"%s\", Queue: %dm+%d in \"%s\""
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1711 d-cnt d-oth (file-name-nondirectory feedmail-queue-draft-directory)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1712 q-cnt q-oth (file-name-nondirectory feedmail-queue-directory)))))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1713 )
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1714
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1715
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1716 (defun feedmail-queue-send-edit-prompt ()
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1717 "Ask whether to queue, send immediately, or return to editing a message."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1718 ;; Some implementation ideas here came from the userlock.el code
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1719 (discard-input)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1720 (save-window-excursion
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1721 (let ((answer) (d-char) (d-string " "))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1722 (if (stringp feedmail-ask-before-queue-default)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1723 (progn
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1724 (setq d-char (string-to-char feedmail-ask-before-queue-default))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1725 (setq d-string feedmail-ask-before-queue-default))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1726 (setq d-string (char-to-string feedmail-ask-before-queue-default))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1727 (setq d-char feedmail-ask-before-queue-default)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1728 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1729 (while (null answer)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1730 (message feedmail-ask-before-queue-prompt d-string)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1731 (let ((user-sez
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1732 (let ((inhibit-quit t) (cursor-in-echo-area t) (echo-keystrokes 0))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1733 (read-char-exclusive))))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1734 (if (= user-sez help-char)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1735 (setq answer '(^ . feedmail-message-action-help))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1736 (if (or (eq user-sez ?\C-m) (eq user-sez ?\C-j) (eq user-sez ?y))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1737 (setq user-sez d-char))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1738 ;; these char-to-int things are because of some
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1739 ;; incomprensible difference between the two in
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1740 ;; byte-compiled stuff between Emacs and XEmacs
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1741 ;; (well, I'm sure someone could comprehend it,
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1742 ;; but I say 'uncle')
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1743 (setq answer (or (assoc user-sez feedmail-prompt-before-queue-user-alist)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1744 (and (fboundp 'char-to-int)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1745 (assoc (char-to-int user-sez) feedmail-prompt-before-queue-user-alist))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1746 (assoc user-sez feedmail-prompt-before-queue-standard-alist)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1747 (and (fboundp 'char-to-int)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1748 (assoc (char-to-int user-sez) feedmail-prompt-before-queue-standard-alist))))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1749 (if (or (null answer) (null (cdr answer)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1750 (progn
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1751 (beep)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1752 (message feedmail-ask-before-queue-reprompt d-string)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1753 (sit-for 3)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1754 )))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1755 (cdr answer)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1756 )))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1757
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1758 (defconst feedmail-p-h-b-n "*FQM Help*")
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1759
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1760 (defun feedmail-queue-send-edit-prompt-help (d-string)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1761 (let ((fqm-help (get-buffer feedmail-p-h-b-n)))
39477
7ff02d7c4baf (feedmail-queue-send-edit-prompt-help):
Gerd Moellmann <gerd@gnu.org>
parents: 38436
diff changeset
1762 (if (and fqm-help (get-buffer-window fqm-help 'visible))
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1763 (feedmail-queue-send-edit-prompt-help-later fqm-help d-string)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1764 (feedmail-queue-send-edit-prompt-help-first d-string))))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1765
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1766 (defun feedmail-queue-send-edit-prompt-help-later (fqm-help d-string)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1767 ;; scrolling fun
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1768 (save-selected-window
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1769 (let ((signal-error-on-buffer-boundary nil)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1770 (fqm-window (display-buffer fqm-help)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1771 (select-window fqm-window)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1772 (if (pos-visible-in-window-p (point-max) fqm-window)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1773 (feedmail-queue-send-edit-prompt-help-first d-string)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1774 ;;(goto-char (point-min))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1775 (scroll-up nil)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1776 ))))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1777
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1778 (defun feedmail-queue-send-edit-prompt-help-first (d-string)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1779 (with-output-to-temp-buffer feedmail-p-h-b-n
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1780 (princ "You're dispatching a message and feedmail queuing is enabled.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1781 Typing ? or C-v will normally scroll this help buffer.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1782
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1783 Choices:
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1784 q QUEUE for later sending (via feedmail-run-the-queue)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1785 Q QUEUE! like \"q\", but always make a new file
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1786 i IMMEDIATELY send this (but not the other queued messages)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1787 I IMMEDIATELY! like \"i\", but skip following confirmation prompt
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1788 d DRAFT queue in the draft directory
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1789 D DRAFT! like \"d\", but always make a new file
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1790 e EDIT return to the message edit buffer (don't send or queue)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1791 * SPRAY toggle spray mode (individual message transmissions)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1792
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1793 Synonyms:
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1794 s SEND immediately (same as \"i\")
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1795 S SEND! immediately (same as \"I\")
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1796 r ROUGH draft (same as \"d\")
22800
125816f37462 (feedmail-queue-send-edit-prompt-help-first):
Karl Heuer <kwzh@gnu.org>
parents: 22799
diff changeset
1797 R ROUGH! draft (same as \"D\")
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1798 n NOPE didn't mean it (same as \"e\")
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1799 y YUP do the default behavior (same as \"C-m\")
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1800
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1801 The user-configurable default is currently \"")
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1802 (princ d-string)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1803 (princ "\". For other possibilities,
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1804 see the variable feedmail-prompt-before-queue-user-alist.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1805 ")
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1806 (and (stringp feedmail-prompt-before-queue-help-supplement)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1807 (princ feedmail-prompt-before-queue-help-supplement))
105829
328150f0cf76 * url-util.el (url-insert-entities-in-string):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104775
diff changeset
1808 (with-current-buffer standard-output
328150f0cf76 * url-util.el (url-insert-entities-in-string):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104775
diff changeset
1809 (if (fboundp 'help-mode) (help-mode)))))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1810
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1811 (defun feedmail-look-at-queue-directory (queue-directory)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1812 "Find out some things about a queue directory.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1813 Result is a list containing a count of queued messages in the
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1814 directory, a count of other files in the directory, and a high water
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1815 mark for prefix sequence numbers. Subdirectories are not included in
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1816 the counts."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1817 (let ((q-cnt 0) (q-oth 0) (high-water 0) (blobbet))
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1818 ;; iterate, counting things we find along the way in the directory
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1819 (if (file-directory-p queue-directory)
85232
d473c33347de (feedmail-run-the-queue)
Glenn Morris <rgm@gnu.org>
parents: 76123
diff changeset
1820 (mapc
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1821 '(lambda (blobby)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1822 (cond
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1823 ((file-directory-p blobby) nil) ; don't care about subdirs
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1824 ((feedmail-fqm-p blobby)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1825 (setq blobbet (file-name-nondirectory blobby))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1826 (if (string-match "^[0-9][0-9][0-9]-" blobbet)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1827 (let ((water-mark))
62402
a7e02ef1e3d6 Replace `string-to-int' by `string-to-number'.
Juanma Barranquero <lekktu@gmail.com>
parents: 52401
diff changeset
1828 (setq water-mark (string-to-number (substring blobbet 0 3)))
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1829 (if (> water-mark high-water) (setq high-water water-mark))))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1830 (setq q-cnt (1+ q-cnt)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1831 (t (setq q-oth (1+ q-oth)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1832 ))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1833 (directory-files queue-directory t)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1834 (list q-cnt q-oth high-water)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1835
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1836 (defun feedmail-tidy-up-slug (slug)
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
1837 "Utility for mapping out suspect characters in a potential filename."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1838 ;; even programmers deserve a break sometimes, so cover nil for them
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1839 (if (null slug) (setq slug ""))
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1840 ;; replace all non-alphanumerics with hyphen for safety
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1841 (while (string-match "[^a-z0-9-]+" slug) (setq slug (replace-match "-" nil nil slug)))
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1842 ;; collapse multiple hyphens to one
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1843 (while (string-match "--+" slug) (setq slug (replace-match "-" nil nil slug)))
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1844 ;; for tidyness, peel off leading hyphens
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1845 (if (string-match "^-*" slug) (setq slug (replace-match "" nil nil slug)))
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1846 ;; for tidyness, peel off trailing hyphens
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1847 (if (string-match "-*$" slug) (setq slug (replace-match "" nil nil slug)))
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1848 slug
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1849 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1850
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1851 (defun feedmail-queue-subject-slug-maker (&optional queue-directory)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1852 "Create a name for storing the message in the queue.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1853 Optional argument QUEUE-DIRECTORY specifies into which directory the
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
1854 file will be placed. The name is based on the Subject: header (if
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1855 there is one). If there is no subject,
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
1856 `feedmail-queue-default-file-slug' is consulted. Special characters are
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1857 mapped to mostly alphanumerics for safety."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1858 (let ((eoh-marker) (case-fold-search t) (subject "") (s-point))
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1859 (setq eoh-marker (feedmail-find-eoh))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1860 (goto-char (point-min))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1861 ;; get raw subject value (first line, anyhow)
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
1862 (if (re-search-forward "^Subject:" eoh-marker t)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1863 (progn (setq s-point (point))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1864 (end-of-line)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1865 (setq subject (buffer-substring s-point (point)))))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1866 (setq subject (feedmail-tidy-up-slug subject))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1867 (if (zerop (length subject))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1868 (setq subject
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1869 (cond
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1870 ((stringp feedmail-queue-default-file-slug) feedmail-queue-default-file-slug)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1871 ((fboundp feedmail-queue-default-file-slug)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1872 (save-excursion (funcall feedmail-queue-default-file-slug)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1873 ((eq feedmail-queue-default-file-slug 'ask)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1874 (file-name-nondirectory
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1875 (read-file-name "FQM: Message filename slug? "
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1876 (file-name-as-directory queue-directory) subject nil subject)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1877 (t "no subject"))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1878 ))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1879 ;; one more time, with feeling
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1880 (feedmail-tidy-up-slug subject)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1881 ))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1882
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1883
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1884 (defun feedmail-create-queue-filename (queue-directory)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1885 (let ((slug "wjc"))
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1886 (cond
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1887 (feedmail-queue-slug-maker
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1888 (save-excursion (setq slug (funcall feedmail-queue-slug-maker queue-directory))))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1889 (feedmail-ask-for-queue-slug
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1890 (setq slug (file-name-nondirectory
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1891 (read-file-name (concat "FQM: Message filename slug? [" slug "]? ")
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1892 (file-name-as-directory queue-directory) slug nil slug))))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1893 )
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1894 (setq slug (feedmail-tidy-up-slug slug))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1895 (setq slug (format "%03d-%s" (1+ (nth 2 (feedmail-look-at-queue-directory queue-directory))) slug))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1896 (concat
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1897 (expand-file-name slug queue-directory)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1898 feedmail-queue-fqm-suffix)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1899 ))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1900
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1901
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1902 (defun feedmail-dump-message-to-queue (queue-directory what-event)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1903 (or (file-accessible-directory-p queue-directory)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1904 ;; progn to get nil result no matter what
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1905 (progn (make-directory queue-directory t) nil)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1906 (file-accessible-directory-p queue-directory)
87169
ac7eee19fc7e Improves calls to `error', per mail from RMS.
Deepak Goel <deego@gnufans.org>
parents: 87141
diff changeset
1907 (error "FQM: Message not queued; trouble with directory %s" queue-directory))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1908 (let ((filename)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1909 (is-fqm)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1910 (is-in-this-dir)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1911 (previous-buffer-file-name buffer-file-name))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1912 (if buffer-file-name
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1913 (progn
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1914 (setq is-fqm (feedmail-fqm-p buffer-file-name))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1915 (setq is-in-this-dir (string-equal
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1916 (directory-file-name queue-directory)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1917 (directory-file-name (expand-file-name (file-name-directory buffer-file-name)))))))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1918 ;; if visiting a queued message, just save
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1919 (if (and is-fqm is-in-this-dir)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1920 (setq filename buffer-file-name)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1921 (setq filename (feedmail-create-queue-filename queue-directory)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1922 ;; make binary file on DOS/Win95/WinNT, etc
104662
790bd85e4cb0 * mail/feedmail.el: Use CL macros.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 97142
diff changeset
1923 (let ((buffer-file-type feedmail-force-binary-write))
790bd85e4cb0 * mail/feedmail.el: Use CL macros.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 97142
diff changeset
1924 (write-file filename))
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1925 ;; convenient for moving from draft to q, for example
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1926 (if (and previous-buffer-file-name (or (not is-fqm) (not is-in-this-dir))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1927 (y-or-n-p (format "FQM: Was previously %s; delete that? " previous-buffer-file-name)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1928 (delete-file previous-buffer-file-name))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1929 (if feedmail-nuke-buffer-after-queue
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1930 (let ((a-s-file-name buffer-auto-save-file-name))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1931 ;; be aggressive in nuking auto-save files
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1932 (and (kill-buffer (current-buffer))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1933 delete-auto-save-files
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1934 (file-exists-p a-s-file-name)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1935 (delete-file a-s-file-name))))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1936 (if feedmail-queue-chatty
65587
4e6c5e8ae4e9 Message format spec fixes (commit 6)
Deepak Goel <deego@gnufans.org>
parents: 62402
diff changeset
1937 (progn (message "%s" (concat "FQM: Queued in " filename))
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1938 (sit-for feedmail-queue-chatty-sit-for)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1939 (if feedmail-queue-chatty
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1940 (progn
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1941 (feedmail-queue-reminder what-event)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1942 (sit-for feedmail-queue-chatty-sit-for)))))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1943
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1944
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1945 ;; from a similar function in mail-utils.el
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1946 (defun feedmail-rfc822-time-zone (time)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1947 (let* ((sec (or (car (current-time-zone time)) 0))
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1948 (absmin (/ (abs sec) 60)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1949 (format "%c%02d%02d" (if (< sec 0) ?- ?+) (/ absmin 60) (% absmin 60))))
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1950
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1951 (defun feedmail-rfc822-date (arg-time)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1952 (let ((time (if arg-time arg-time (current-time))))
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1953 (concat
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1954 (format-time-string "%a, %e %b %Y %T " time)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1955 (feedmail-rfc822-time-zone time)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1956 )))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1957
106518
c22556bde650 (top-level): Move require 'mail-utils to start.
Glenn Morris <rgm@gnu.org>
parents: 105829
diff changeset
1958 (declare-function expand-mail-aliases "mailalias" (beg end &optional exclude))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1959
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1960 (defun feedmail-send-it-immediately ()
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1961 "Handle immediate sending, including during a queue run."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1962 (let* ((feedmail-error-buffer (get-buffer-create " *FQM Outgoing Email Errors*"))
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1963 (feedmail-prepped-text-buffer (get-buffer-create " *FQM Outgoing Email Text*"))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1964 (feedmail-raw-text-buffer (current-buffer))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1965 (feedmail-address-list)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1966 (eoh-marker)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1967 (bcc-holder)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1968 (resent-bcc-holder)
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
1969 (a-re-rtcb "^Resent-\\(To\\|Cc\\|Bcc\\):")
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
1970 (a-re-rtc "^Resent-\\(To\\|Cc\\):")
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
1971 (a-re-rb "^Resent-Bcc:")
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
1972 (a-re-dtcb "^\\(To\\|Cc\\|Bcc\\):")
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
1973 (a-re-dtc "^\\(To\\|Cc\\):")
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
1974 (a-re-db "^Bcc:")
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1975 ;; to get a temporary changable copy
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1976 (mail-header-separator mail-header-separator)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1977 )
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1978 (unwind-protect
105829
328150f0cf76 * url-util.el (url-insert-entities-in-string):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104775
diff changeset
1979 (save-current-buffer
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1980 (set-buffer feedmail-error-buffer) (erase-buffer)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1981 (set-buffer feedmail-prepped-text-buffer) (erase-buffer)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1982
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1983 ;; jam contents of user-supplied mail buffer into our scratch buffer
66668
857eb702a3f1 Use insert-buffer-substring, not insert-buffer.
Richard M. Stallman <rms@gnu.org>
parents: 65797
diff changeset
1984 (insert-buffer-substring feedmail-raw-text-buffer)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1985
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1986 ;; require one newline at the end.
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1987 (goto-char (point-max))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1988 (or (= (preceding-char) ?\n) (insert ?\n))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1989
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1990 (let ((case-fold-search nil))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1991 ;; Change header-delimiter to be what mailers expect (empty line).
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1992 ;; leaves match data in place or signals error
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1993 (setq eoh-marker (feedmail-find-eoh))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1994 (replace-match "\n")
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1995 (setq mail-header-separator ""))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1996
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1997 ;; mail-aliases nil = mail-abbrevs.el
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1998 (if (or feedmail-force-expand-mail-aliases
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
1999 (and (fboundp 'expand-mail-aliases) mail-aliases))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2000 (expand-mail-aliases (point-min) eoh-marker))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2001
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2002 ;; make it pretty
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2003 (if feedmail-fill-to-cc (feedmail-fill-to-cc-function eoh-marker))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2004 ;; ignore any blank lines in the header
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2005 (goto-char (point-min))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2006 (while (and (re-search-forward "\n\n\n*" eoh-marker t) (< (point) eoh-marker))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2007 (replace-match "\n"))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2008
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2009 (let ((case-fold-search t) (addr-regexp))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2010 (goto-char (point-min))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2011 ;; there are some RFC-822 combinations/cases missed here,
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2012 ;; but probably good enough and what users expect
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2013 ;;
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2014 ;; use resent-* stuff only if there is at least one non-empty one
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2015 (setq feedmail-is-a-resend
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2016 (re-search-forward
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2017 ;; header name, followed by optional whitespace, followed by
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2018 ;; non-whitespace, followed by anything, followed by newline;
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
2019 ;; the idea is empty Resent-* headers are ignored
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
2020 "^\\(Resent-To:\\|Resent-Cc:\\|Resent-Bcc:\\)\\s-*\\S-+.*$"
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2021 eoh-marker t))
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
2022 ;; if we say so, gather the Bcc stuff before the main course
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2023 (if (eq feedmail-deduce-bcc-where 'first)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2024 (progn (if feedmail-is-a-resend (setq addr-regexp a-re-rb) (setq addr-regexp a-re-db))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2025 (setq feedmail-address-list (feedmail-deduce-address-list feedmail-prepped-text-buffer (point-min) eoh-marker addr-regexp feedmail-address-list))))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2026 ;; the main course
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2027 (if (or (eq feedmail-deduce-bcc-where 'first) (eq feedmail-deduce-bcc-where 'last))
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
2028 ;; handled by first or last cases, so don't get Bcc stuff
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2029 (progn (if feedmail-is-a-resend (setq addr-regexp a-re-rtc) (setq addr-regexp a-re-dtc))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2030 (setq feedmail-address-list (feedmail-deduce-address-list feedmail-prepped-text-buffer (point-min) eoh-marker addr-regexp feedmail-address-list)))
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
2031 ;; not handled by first or last cases, so also get Bcc stuff
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2032 (progn (if feedmail-is-a-resend (setq addr-regexp a-re-rtcb) (setq addr-regexp a-re-dtcb))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2033 (setq feedmail-address-list (feedmail-deduce-address-list feedmail-prepped-text-buffer (point-min) eoh-marker addr-regexp feedmail-address-list))))
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
2034 ;; if we say so, gather the Bcc stuff after the main course
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2035 (if (eq feedmail-deduce-bcc-where 'last)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2036 (progn (if feedmail-is-a-resend (setq addr-regexp a-re-rb) (setq addr-regexp a-re-db))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2037 (setq feedmail-address-list (feedmail-deduce-address-list feedmail-prepped-text-buffer (point-min) eoh-marker addr-regexp feedmail-address-list))))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2038 (if (not feedmail-address-list) (error "FQM: Sending...abandoned, no addressees"))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2039 ;; not needed, but meets user expectations
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2040 (setq feedmail-address-list (nreverse feedmail-address-list))
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
2041 ;; Find and handle any Bcc fields.
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
2042 (setq bcc-holder (feedmail-accume-n-nuke-header eoh-marker "^Bcc:"))
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
2043 (setq resent-bcc-holder (feedmail-accume-n-nuke-header eoh-marker "^Resent-Bcc:"))
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2044 (if (and bcc-holder (not feedmail-nuke-bcc))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2045 (progn (goto-char (point-min))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2046 (insert bcc-holder)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2047 (if (and resent-bcc-holder (not feedmail-nuke-resent-bcc))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2048 (progn (goto-char (point-min))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2049 (insert resent-bcc-holder)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2050 (goto-char (point-min))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2051
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2052 ;; fiddle about, fiddle about, fiddle about....
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2053 (feedmail-fiddle-from)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2054 (feedmail-fiddle-sender)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2055 (feedmail-fiddle-x-mailer)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2056 (feedmail-fiddle-message-id
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2057 (or feedmail-queue-runner-is-active (buffer-file-name feedmail-raw-text-buffer)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2058 (feedmail-fiddle-date
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2059 (or feedmail-queue-runner-is-active (buffer-file-name feedmail-raw-text-buffer)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2060 (feedmail-fiddle-list-of-fiddle-plexes feedmail-fiddle-plex-user-list)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2061
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2062 ;; don't send out a blank headers of various sorts
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2063 ;; (this loses on continued line with a blank first line)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2064 (goto-char (point-min))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2065 (and feedmail-nuke-empty-headers ; hey, who's an empty-header?
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2066 (while (re-search-forward "^[A-Za-z0-9-]+:[ \t]*\n" eoh-marker t)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2067 (replace-match ""))))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2068
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2069 (run-hooks 'feedmail-last-chance-hook)
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2070
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
2071 (let ((fcc (feedmail-accume-n-nuke-header eoh-marker "^Fcc:"))
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2072 (also-file)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2073 (confirm (cond
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2074 ((eq feedmail-confirm-outgoing 'immediate)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2075 (not feedmail-queue-runner-is-active))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2076 ((eq feedmail-confirm-outgoing 'queued) feedmail-queue-runner-is-active)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2077 (t feedmail-confirm-outgoing))))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2078 (if (or (not confirm) (feedmail-one-last-look feedmail-prepped-text-buffer))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2079 (let ((user-mail-address (feedmail-envelope-deducer eoh-marker)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2080 (feedmail-give-it-to-buffer-eater)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2081 (if (and (not feedmail-queue-runner-is-active) (setq also-file (buffer-file-name feedmail-raw-text-buffer)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2082 (progn ; if a file but not running the queue, offer to delete it
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2083 (setq also-file (expand-file-name also-file))
105829
328150f0cf76 * url-util.el (url-insert-entities-in-string):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104775
diff changeset
2084 (when (or feedmail-queue-auto-file-nuke
328150f0cf76 * url-util.el (url-insert-entities-in-string):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104775
diff changeset
2085 (y-or-n-p
328150f0cf76 * url-util.el (url-insert-entities-in-string):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104775
diff changeset
2086 (format "FQM: Delete message file %s? "
328150f0cf76 * url-util.el (url-insert-entities-in-string):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104775
diff changeset
2087 also-file)))
328150f0cf76 * url-util.el (url-insert-entities-in-string):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104775
diff changeset
2088 ;; if we delete the affiliated file, get rid
328150f0cf76 * url-util.el (url-insert-entities-in-string):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104775
diff changeset
2089 ;; of the file name association and make sure we
328150f0cf76 * url-util.el (url-insert-entities-in-string):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104775
diff changeset
2090 ;; don't annoy people with a prompt on exit
328150f0cf76 * url-util.el (url-insert-entities-in-string):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104775
diff changeset
2091 (delete-file also-file)
328150f0cf76 * url-util.el (url-insert-entities-in-string):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104775
diff changeset
2092 (with-current-buffer feedmail-raw-text-buffer
328150f0cf76 * url-util.el (url-insert-entities-in-string):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104775
diff changeset
2093 (setq buffer-offer-save nil)
328150f0cf76 * url-util.el (url-insert-entities-in-string):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104775
diff changeset
2094 (setq buffer-file-name nil)))))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2095 (goto-char (point-min))
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
2096 ;; re-insert and handle any Fcc fields (and, optionally, any Bcc).
104662
790bd85e4cb0 * mail/feedmail.el: Use CL macros.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 97142
diff changeset
2097 (if fcc (letf (((default-value 'buffer-file-type)
790bd85e4cb0 * mail/feedmail.el: Use CL macros.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 97142
diff changeset
2098 feedmail-force-binary-write))
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2099 (insert fcc)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2100 (if (not feedmail-nuke-bcc-in-fcc)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2101 (progn (if bcc-holder (insert bcc-holder))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2102 (if resent-bcc-holder (insert resent-bcc-holder))))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2103
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2104 (run-hooks 'feedmail-before-fcc-hook)
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2105
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2106 (if feedmail-nuke-body-in-fcc
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2107 (progn (goto-char eoh-marker)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2108 (if (natnump feedmail-nuke-body-in-fcc)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2109 (forward-line feedmail-nuke-body-in-fcc))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2110 (delete-region (point) (point-max))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2111 ))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2112 (mail-do-fcc eoh-marker)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2113 )))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2114 (error "FQM: Sending...abandoned") ; user bailed out of one-last-look
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2115 ))) ; unwind-protect body (save-excursion)
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2116
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2117 ;; unwind-protect cleanup forms
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2118 (kill-buffer feedmail-prepped-text-buffer)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2119 (set-buffer feedmail-error-buffer)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2120 (if (zerop (buffer-size)) (kill-buffer feedmail-error-buffer)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2121 (progn (display-buffer feedmail-error-buffer)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2122 ;; read fast ... the meter is running
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2123 (if (and feedmail-queue-runner-is-active feedmail-queue-chatty)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2124 (progn (message "FQM: Sending...failed") (ding t) (sit-for 3)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2125 (error "FQM: Sending...failed")))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2126 (set-buffer feedmail-raw-text-buffer))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2127 ) ; let
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2128 (if (and feedmail-queue-chatty (not feedmail-queue-runner-is-active))
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2129 (progn
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2130 (feedmail-queue-reminder 'after-immediate)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2131 (sit-for feedmail-queue-chatty-sit-for)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2132 )
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2133
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2134
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2135 (defun feedmail-fiddle-header (name value &optional action folding)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2136 "Internal feedmail function for jamming fields into message header.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2137 NAME, VALUE, ACTION, and FOLDING are the four elements of a
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2138 fiddle-plex, as described in the documentation for the variable
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
2139 `feedmail-fiddle-plex-blurb'."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2140 (let ((case-fold-search t)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2141 (header-colon (concat (regexp-quote name) ":"))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2142 header-regexp eoh-marker has-like ag-like val-like that-point)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2143 (setq header-regexp (concat "^" header-colon))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2144 (setq eoh-marker (feedmail-find-eoh))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2145 (goto-char (point-min))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2146 (setq has-like (re-search-forward header-regexp eoh-marker t))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2147
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2148 (if (not action) (setq action 'supplement))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2149 (cond
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2150 ((eq action 'supplement)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2151 ;; trim leading/trailing whitespace
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2152 (if (string-match "\\`[ \t\n]+" value)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2153 (setq value (substring value (match-end 0))))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2154 (if (string-match "[ \t\n]+\\'" value)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2155 (setq value (substring value 0 (match-beginning 0))))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2156 (if (> (length value) 0)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2157 (progn
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2158 (if feedmail-fiddle-headers-upwardly
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2159 (goto-char (point-min))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2160 (goto-char eoh-marker))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2161 (setq that-point (point))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2162 (insert name ": " value "\n")
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2163 (if folding (feedmail-fill-this-one that-point (point))))))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2164
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2165 ((eq action 'replace)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2166 (if has-like (feedmail-accume-n-nuke-header eoh-marker header-regexp))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2167 (feedmail-fiddle-header name value 'supplement folding))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2168
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2169 ((eq action 'create)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2170 (if (not has-like) (feedmail-fiddle-header name value 'supplement folding)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2171
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2172 ((eq action 'combine)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2173 (setq val-like (nth 1 value))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2174 (setq ag-like (or (feedmail-accume-n-nuke-header eoh-marker header-regexp) ""))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2175 ;; get rid of initial header name from first instance (front of string)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2176 (if (string-match (concat header-regexp "[ \t\n]+") ag-like)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2177 (setq ag-like (replace-match "" t t ag-like)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2178 ;; get rid of embedded header names from subsequent instances
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2179 (while (string-match (concat "\n" header-colon "[ \t\n]+") ag-like)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2180 (setq ag-like (replace-match "\n\t" t t ag-like)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2181 ;; trim leading/trailing whitespace
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2182 (if (string-match "\\`[ \t\n]+" ag-like)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2183 (setq ag-like (substring ag-like (match-end 0))))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2184 (if (string-match "[ \t\n]+\\'" ag-like)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2185 (setq ag-like (substring ag-like 0 (match-beginning 0))))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2186 ;; if ag-like is not nil and not an empty string, transform it via a function
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2187 ;; call or format operation
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2188 (if (> (length ag-like) 0)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2189 (setq ag-like
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2190 (cond
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2191 ((and (symbolp val-like) (fboundp val-like))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2192 (funcall val-like name ag-like))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2193 ((stringp val-like)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2194 (format val-like ag-like))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2195 (t nil))))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2196 (feedmail-fiddle-header name (concat (nth 0 value) ag-like (nth 2 value)) 'supplement folding)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2197 ))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2198
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2199 (defun feedmail-give-it-to-buffer-eater ()
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2200 (save-excursion
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2201 (if feedmail-enable-spray
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2202 (mapcar
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2203 '(lambda (feedmail-spray-this-address)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2204 (let ((spray-buffer (get-buffer-create " *FQM Outgoing Email Spray*")))
105829
328150f0cf76 * url-util.el (url-insert-entities-in-string):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104775
diff changeset
2205 (with-current-buffer spray-buffer
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2206 (erase-buffer)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2207 ;; not life's most efficient methodology, but spraying isn't
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2208 ;; an every-5-minutes event either
66668
857eb702a3f1 Use insert-buffer-substring, not insert-buffer.
Richard M. Stallman <rms@gnu.org>
parents: 65797
diff changeset
2209 (insert-buffer-substring feedmail-prepped-text-buffer)
105829
328150f0cf76 * url-util.el (url-insert-entities-in-string):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104775
diff changeset
2210 ;; There's a good case to me made that each separate
328150f0cf76 * url-util.el (url-insert-entities-in-string):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104775
diff changeset
2211 ;; transmission of a message in the spray should
328150f0cf76 * url-util.el (url-insert-entities-in-string):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104775
diff changeset
2212 ;; have a distinct Message-Id:. There is also a less
328150f0cf76 * url-util.el (url-insert-entities-in-string):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104775
diff changeset
2213 ;; compelling argument in the other direction.
328150f0cf76 * url-util.el (url-insert-entities-in-string):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104775
diff changeset
2214 ;; I think they technically should have distinct
328150f0cf76 * url-util.el (url-insert-entities-in-string):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104775
diff changeset
2215 ;; Message-Id:s, but I doubt that anyone cares,
328150f0cf76 * url-util.el (url-insert-entities-in-string):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104775
diff changeset
2216 ;; practically. If someone complains about it, I'll
328150f0cf76 * url-util.el (url-insert-entities-in-string):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104775
diff changeset
2217 ;; add it.
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2218 (feedmail-fiddle-list-of-spray-fiddle-plexes feedmail-spray-address-fiddle-plex-list)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2219 ;; this (let ) is just in case some buffer eater
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2220 ;; is cheating and using the global variable name instead
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2221 ;; of its argument to find the buffer
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2222 (let ((feedmail-prepped-text-buffer spray-buffer))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2223 (funcall feedmail-buffer-eating-function
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2224 feedmail-prepped-text-buffer
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2225 feedmail-error-buffer
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2226 (list feedmail-spray-this-address))))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2227 (kill-buffer spray-buffer)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2228 ))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2229 feedmail-address-list)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2230 (funcall feedmail-buffer-eating-function
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2231 feedmail-prepped-text-buffer
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2232 feedmail-error-buffer
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2233 feedmail-address-list))))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2234
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2235
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2236 (defun feedmail-envelope-deducer (eoh-marker)
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
2237 "If `feedmail-deduce-envelope-from' is false, simply return `user-mail-address'.
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
2238 Else, look for Sender: or From: (or Resent-*) and
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2239 return that value."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2240 (if (not feedmail-deduce-envelope-from)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2241 user-mail-address
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2242 (let ((from-list))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2243 (setq from-list
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2244 (feedmail-deduce-address-list
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
2245 (current-buffer) (point-min) eoh-marker (if feedmail-is-a-resend "^Resent-Sender:" "^Sender:")
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2246 from-list))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2247 (if (not from-list)
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2248 (setq from-list
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2249 (feedmail-deduce-address-list
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
2250 (current-buffer) (point-min) eoh-marker (if feedmail-is-a-resend "^Resent-From:" "^From:")
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2251 from-list)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2252 (if (and from-list (car from-list)) (car from-list) user-mail-address))))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2253
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2254
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2255 (defun feedmail-fiddle-from ()
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
2256 "Fiddle From:."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2257 ;; default is to fall off the end of the list and do nothing
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2258 (cond
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2259 ;; nil means do nothing
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2260 ((eq nil feedmail-from-line) nil)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2261 ;; t is the same a using the default computation, so compute it and recurse
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2262 ;; user-full-name suggested by kpc@ptolemy.arc.nasa.gov (=Kimball Collins)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2263 ;; improvement using user-mail-address suggested by
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2264 ;; gray@austin.apc.slb.com (Douglas Gray Stephens)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2265 ((eq t feedmail-from-line)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2266 (let ((feedmail-from-line
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2267 (let ((at-stuff
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2268 (if user-mail-address user-mail-address (concat (user-login-name) "@" (system-name)))))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2269 (cond
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2270 ((eq mail-from-style nil) at-stuff)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2271 ((eq mail-from-style 'parens) (concat at-stuff " (" (user-full-name) ")"))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2272 ((eq mail-from-style 'angles) (concat "\"" (user-full-name) "\" <" at-stuff ">"))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2273 ))))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2274 (feedmail-fiddle-from)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2275
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2276 ;; if it's a string, simply make a fiddle-plex out of it and recurse
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2277 ((stringp feedmail-from-line)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2278 (let ((feedmail-from-line (list "ignored" feedmail-from-line 'create)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2279 (feedmail-fiddle-from)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2280
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2281 ;; if it's a function, call it and recurse with the resulting value
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2282 ((and (symbolp feedmail-from-line) (fboundp feedmail-from-line))
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2283 (let ((feedmail-from-line (funcall feedmail-from-line)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2284 (feedmail-fiddle-from)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2285
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2286 ;; if it's a list, it must be a fiddle-plex -- so fiddle, man, fiddle
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2287 ((listp feedmail-from-line)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2288 (feedmail-fiddle-header
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2289 (if feedmail-is-a-resend "Resent-From" "From")
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2290 (nth 1 feedmail-from-line) ; value
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2291 (nth 2 feedmail-from-line) ; action
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2292 (nth 3 feedmail-from-line))))) ; folding
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2293
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2294
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2295 (defun feedmail-fiddle-sender ()
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
2296 "Fiddle Sender:."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2297 ;; default is to fall off the end of the list and do nothing
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2298 (cond
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2299 ;; nil means do nothing
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2300 ((eq nil feedmail-sender-line) nil)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2301 ;; t is not allowed, but handled it just to avoid bugs later
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2302 ((eq t feedmail-sender-line) nil)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2303
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2304 ;; if it's a string, simply make a fiddle-plex out of it and recurse
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2305 ((stringp feedmail-sender-line)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2306 (let ((feedmail-sender-line (list "ignored" feedmail-sender-line 'create)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2307 (feedmail-fiddle-sender)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2308
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2309 ;; if it's a function, call it and recurse with the resulting value
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2310 ((and (symbolp feedmail-sender-line) (fboundp feedmail-sender-line))
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2311 (let ((feedmail-sender-line (funcall feedmail-sender-line)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2312 (feedmail-fiddle-sender)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2313
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2314 ;; if it's a list, it must be a fiddle-plex -- so fiddle, man, fiddle
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2315 ((listp feedmail-sender-line)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2316 (feedmail-fiddle-header
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2317 (if feedmail-is-a-resend "Resent-Sender" "Sender")
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2318 (nth 1 feedmail-sender-line) ; value
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2319 (nth 2 feedmail-sender-line) ; action
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2320 (nth 3 feedmail-sender-line))))) ; folding
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2321
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2322
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2323 (defun feedmail-default-date-generator (maybe-file)
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
2324 "Default function for generating Date: header contents."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2325 (let ((date-time))
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2326 (if (and (not feedmail-queue-use-send-time-for-date) maybe-file)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2327 (setq date-time (nth 5 (file-attributes maybe-file))))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2328 (feedmail-rfc822-date date-time))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2329 )
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2330
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2331
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2332 (defun feedmail-fiddle-date (maybe-file)
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
2333 "Fiddle Date:. See documentation of `feedmail-date-generator'."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2334 ;; default is to fall off the end of the list and do nothing
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2335 (cond
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2336 ;; nil means do nothing
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2337 ((eq nil feedmail-date-generator) nil)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2338 ;; t is the same a using the function feedmail-default-date-generator, so let it and recurse
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2339 ((eq t feedmail-date-generator)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2340 (let ((feedmail-date-generator (feedmail-default-date-generator maybe-file)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2341 (feedmail-fiddle-date maybe-file)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2342
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2343 ;; if it's a string, simply make a fiddle-plex out of it and recurse
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2344 ((stringp feedmail-date-generator)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2345 (let ((feedmail-date-generator (list "ignored" feedmail-date-generator 'create)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2346 (feedmail-fiddle-date maybe-file)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2347
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2348 ;; if it's a function, call it and recurse with the resulting value
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2349 ((and (symbolp feedmail-date-generator) (fboundp feedmail-date-generator))
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2350 (let ((feedmail-date-generator (funcall feedmail-date-generator maybe-file)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2351 (feedmail-fiddle-date maybe-file)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2352
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2353 ;; if it's a list, it must be a fiddle-plex -- so fiddle, man, fiddle
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2354 ((listp feedmail-date-generator)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2355 (feedmail-fiddle-header
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2356 (if feedmail-is-a-resend "Resent-Date" "Date")
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2357 (nth 1 feedmail-date-generator) ; value
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2358 (nth 2 feedmail-date-generator) ; action
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2359 (nth 3 feedmail-date-generator))))) ; folding
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2360
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2361
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2362 (defun feedmail-default-message-id-generator (maybe-file)
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
2363 "Default function for generating Message-Id: header contents.
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2364 Based on a date and a sort of random number for tie breaking. Unless
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
2365 `feedmail-message-id-suffix' is defined, uses `user-mail-address', so be
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2366 sure it's set."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2367 (let ((date-time)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2368 (end-stuff (if feedmail-message-id-suffix feedmail-message-id-suffix user-mail-address)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2369 (if (string-match "^\\(.*\\)@" end-stuff)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2370 (setq end-stuff
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2371 (concat (if (equal (match-beginning 1) (match-end 1)) "" "-") end-stuff))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2372 (setq end-stuff (concat "@" end-stuff)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2373 (if (and (not feedmail-queue-use-send-time-for-message-id) maybe-file)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2374 (setq date-time (nth 5 (file-attributes maybe-file))))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2375 (format "<%d-%s%s%s>"
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2376 (mod (random) 10000)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2377 (format-time-string "%a%d%b%Y%H%M%S" date-time)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2378 (feedmail-rfc822-time-zone date-time)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2379 end-stuff))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2380 )
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2381
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2382 (defun feedmail-fiddle-message-id (maybe-file)
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
2383 "Fiddle Message-Id:. See documentation of `feedmail-message-id-generator'."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2384 ;; default is to fall off the end of the list and do nothing
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2385 (cond
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2386 ;; nil means do nothing
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2387 ((eq nil feedmail-message-id-generator) nil)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2388 ;; t is the same a using the function feedmail-default-message-id-generator, so let it and recurse
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2389 ((eq t feedmail-message-id-generator)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2390 (let ((feedmail-message-id-generator (feedmail-default-message-id-generator maybe-file)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2391 (feedmail-fiddle-message-id maybe-file)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2392
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2393 ;; if it's a string, simply make a fiddle-plex out of it and recurse
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2394 ((stringp feedmail-message-id-generator)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2395 (let ((feedmail-message-id-generator (list "ignored" feedmail-message-id-generator 'create)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2396 (feedmail-fiddle-message-id maybe-file)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2397
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2398 ;; if it's a function, call it and recurse with the resulting value
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2399 ((and (symbolp feedmail-message-id-generator) (fboundp feedmail-message-id-generator))
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2400 (let ((feedmail-message-id-generator (funcall feedmail-message-id-generator maybe-file)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2401 (feedmail-fiddle-message-id maybe-file)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2402
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2403 ;; if it's a list, it must be a fiddle-plex -- so fiddle, man, fiddle
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2404 ((listp feedmail-message-id-generator)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2405 (feedmail-fiddle-header
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
2406 (if feedmail-is-a-resend "Resent-Message-Id" "Message-Id")
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2407 (nth 1 feedmail-message-id-generator) ; value
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2408 (nth 2 feedmail-message-id-generator) ; action
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2409 (nth 3 feedmail-message-id-generator))))) ; folding
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2410
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2411
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2412 (defun feedmail-default-x-mailer-generator ()
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
2413 "Default function for generating X-Mailer: header contents."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2414 (concat
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2415 (let ((case-fold-search t)) (if (string-match "emacs" emacs-version) "" "emacs "))
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2416 emacs-version " (via feedmail " feedmail-patch-level
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2417 (if feedmail-queue-runner-is-active " Q" " I")
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2418 (if feedmail-enable-spray "S" "")
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2419 (if feedmail-x-mailer-line-user-appendage ") " ")")
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2420 feedmail-x-mailer-line-user-appendage))
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2421
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2422
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2423 (defun feedmail-fiddle-x-mailer ()
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
2424 "Fiddle X-Mailer:. See documentation of `feedmail-x-mailer-line'."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2425 ;; default is to fall off the end of the list and do nothing
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2426 (cond
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2427 ;; t is the same a using the function feedmail-default-x-mailer-generator, so let it and recurse
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2428 ((eq t feedmail-x-mailer-line)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2429 (let ((feedmail-x-mailer-line (feedmail-default-x-mailer-generator)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2430 (feedmail-fiddle-x-mailer)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2431
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2432 ;; if it's a string, simply make a fiddle-plex out of it and recurse
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2433 ((stringp feedmail-x-mailer-line)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2434 (let ((feedmail-x-mailer-line (list "ignored" (list feedmail-x-mailer-line ";\n\t%s") 'combine)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2435 (feedmail-fiddle-x-mailer)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2436
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2437 ;; if it's a function, call it and recurse with the resulting value
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2438 ((and (symbolp feedmail-x-mailer-line) (fboundp feedmail-x-mailer-line))
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2439 (let ((feedmail-x-mailer-line (funcall feedmail-x-mailer-line)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2440 (feedmail-fiddle-x-mailer)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2441
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2442 ;; if it's a list, it must be a fiddle-plex -- so fiddle, man, fiddle
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2443 ((listp feedmail-x-mailer-line)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2444 (feedmail-fiddle-header
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2445 (if feedmail-is-a-resend "X-Resent-Mailer" "X-Mailer")
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2446 (nth 1 feedmail-x-mailer-line) ; value
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2447 (nth 2 feedmail-x-mailer-line) ; action
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2448 (nth 3 feedmail-x-mailer-line))))) ; folding
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2449
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2450
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2451 (defun feedmail-fiddle-spray-address (addy-plex)
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
2452 "Fiddle header for single spray address. Uses `feedmail-spray-this-address'."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2453 ;; default is to fall off the end of the list and do nothing
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2454 (cond
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2455 ;; nil means do nothing
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2456 ((eq nil addy-plex) nil)
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
2457 ;; t means the same as using "To:" and unembellished addy
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2458 ((eq t addy-plex)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2459 (let ((addy-plex (list "To" feedmail-spray-this-address)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2460 (feedmail-fiddle-spray-address addy-plex)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2461
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2462 ;; if it's a string, simply make a fiddle-plex out of it and recurse, assuming
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
2463 ;; the string names a header field (e.g., "To")
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2464 ((stringp addy-plex)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2465 (let ((addy-plex (list addy-plex feedmail-spray-this-address)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2466 (feedmail-fiddle-spray-address addy-plex)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2467
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2468 ;; if it's a function, call it and recurse with the resulting value
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2469 ((and (symbolp addy-plex) (fboundp addy-plex))
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2470 (let ((addy-plex (funcall addy-plex)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2471 (feedmail-fiddle-spray-address addy-plex)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2472
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2473 ;; if it's a list, it must be a fiddle-plex -- so fiddle, man, fiddle
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2474 ((listp addy-plex)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2475 (feedmail-fiddle-header
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2476 (nth 0 addy-plex) ; name
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2477 (nth 1 addy-plex) ; value
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2478 (nth 2 addy-plex) ; action
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2479 (nth 3 addy-plex))))) ; folding
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2480
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2481
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2482 (defun feedmail-fiddle-list-of-spray-fiddle-plexes (list-of-fiddle-plexes)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2483 "Fiddling based on a list of fiddle-plexes for spraying."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2484 ;; default is to fall off the end of the list and do nothing
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2485 (let ((lofp list-of-fiddle-plexes) fp)
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
2486 (if (listp lofp)
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
2487 (while lofp
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
2488 (setq fp (car lofp))
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
2489 (setq lofp (cdr lofp))
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
2490 (feedmail-fiddle-spray-address fp))
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
2491 (feedmail-fiddle-spray-address lofp))))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2492
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2493
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2494 (defun feedmail-fiddle-list-of-fiddle-plexes (list-of-fiddle-plexes)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2495 "Fiddling based on a list of fiddle-plexes. Values t, nil, and string are pointless."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2496 ;; default is to fall off the end of the list and do nothing
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2497 (let ((lofp list-of-fiddle-plexes) fp)
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
2498 (while lofp
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
2499 (setq fp (car lofp))
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
2500 (setq lofp (cdr lofp))
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
2501 (cond
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2502
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
2503 ;; if it's a function, call it and recurse with the resulting value
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
2504 ((and (symbolp fp) (fboundp fp))
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
2505 (let ((lofp (list (funcall fp)))) (feedmail-fiddle-list-of-fiddle-plexes lofp)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2506
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
2507 ;; if it's a list, it must be a fiddle-plex -- so fiddle, man, fiddle
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
2508 ((listp fp)
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
2509 (feedmail-fiddle-header
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
2510 (nth 0 fp)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2511 (nth 1 fp) ; value
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2512 (nth 2 fp) ; action
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2513 (nth 3 fp))))))) ; folding
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2514
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2515
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2516 (defun feedmail-accume-n-nuke-header (header-end header-regexp)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2517 "Delete headers matching a regexp and their continuation lines.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2518 There may be multiple such lines, and each may have arbitrarily
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2519 many continuation lines. Return an accumulation of the deleted
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2520 headers, including the intervening newlines."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2521 (let ((case-fold-search t) (dropout))
22609
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
2522 (save-excursion
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
2523 (goto-char (point-min))
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
2524 ;; iterate over all matching lines
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
2525 (while (re-search-forward header-regexp header-end t)
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
2526 (forward-line 1)
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
2527 (setq dropout (concat dropout (buffer-substring (match-beginning 0) (point))))
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
2528 (delete-region (match-beginning 0) (point))
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
2529 ;; get rid of any continuation lines
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
2530 (while (and (looking-at "^[ \t].*\n") (< (point) header-end))
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
2531 (forward-line 1)
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
2532 (setq dropout (concat dropout (buffer-substring (match-beginning 0) (point))))
c2ed862173da Style and doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 22552
diff changeset
2533 (replace-match ""))))
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2534 (identity dropout)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2535
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2536 (defun feedmail-fill-to-cc-function (header-end)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2537 "Smart filling of address headers (don't be fooled by the name).
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2538 The filling tries to avoid splitting lines except at commas. This
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2539 avoids, in particular, splitting within parenthesized comments in
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
2540 addresses. Headers filled include From:, Reply-To:, To:, Cc:, Bcc:,
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
2541 Resent-To:, Resent-Cc:, and Resent-Bcc:."
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2542 (let ((case-fold-search t)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2543 this-line
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2544 this-line-end)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2545 (save-excursion
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2546 (goto-char (point-min))
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
2547 ;; iterate over all To:/Cc:, etc, lines
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2548 (while
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2549 (re-search-forward
22801
e71025b5e000 Avoid using all-caps for non-arguments.
Karl Heuer <kwzh@gnu.org>
parents: 22800
diff changeset
2550 "^\\(From:\\|Reply-To:\\|To:\\|Cc:\\|Bcc:\\|Resent-To:\\|Resent-Cc:\\|Resent-Bcc:\\)"
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2551 header-end t)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2552 (setq this-line (match-beginning 0))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2553 ;; replace 0 or more leading spaces with a single space
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2554 (and (looking-at "[ \t]*") (replace-match " "))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2555 (forward-line 1)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2556 ;; get any continuation lines
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2557 (while (and (looking-at "[ \t]+") (< (point) header-end))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2558 (forward-line 1))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2559 (setq this-line-end (point-marker))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2560 (save-excursion (feedmail-fill-this-one this-line this-line-end))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2561 ))))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2562
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2563
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2564 (defun feedmail-fill-this-one (this-line this-line-end)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2565 "In-place smart filling of the region bounded by the two arguments."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2566 (let ((fill-prefix "\t")
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2567 (fill-column feedmail-fill-to-cc-fill-column))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2568 ;; The general idea is to break only on commas. Collapse
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2569 ;; multiple whitespace to a single blank; change
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2570 ;; all the blanks to something unprintable; change the
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2571 ;; commas to blanks; fill the region; change it back.
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2572 (goto-char this-line)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2573 (while (re-search-forward "\\s-+" (1- this-line-end) t)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2574 (replace-match " "))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2575
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2576 (subst-char-in-region this-line this-line-end ? 2 t) ; blank->C-b
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2577 (subst-char-in-region this-line this-line-end ?, ? t) ; comma->blank
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2578
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2579 (fill-region-as-paragraph this-line this-line-end)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2580
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2581 (subst-char-in-region this-line this-line-end ? ?, t) ; comma<-blank
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2582 (subst-char-in-region this-line this-line-end 2 ? t) ; blank<-C-b
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2583
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2584 ;; look out for missing commas before continuation lines
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2585 (goto-char this-line)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2586 (while (re-search-forward "\\([^,]\\)\n\t[ ]*" this-line-end t)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2587 (replace-match "\\1,\n\t"))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2588 ))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2589
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2590
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2591 (defun feedmail-deduce-address-list (message-buffer header-start header-end addr-regexp address-list)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2592 "Get address list with all comments and other excitement trimmed.
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2593 Addresses are collected only from headers whose names match the fourth
73728
d8a07f1f5442 (feedmail-queue-reminder, feedmail-queue-reminder-alist,
Juanma Barranquero <lekktu@gmail.com>
parents: 72635
diff changeset
2594 argument. Returns a list of strings. Duplicate addresses will have
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2595 been weeded out."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2596 (let ((simple-address)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2597 (address-blob)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2598 (this-line)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2599 (this-line-end))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2600 (unwind-protect
105829
328150f0cf76 * url-util.el (url-insert-entities-in-string):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104775
diff changeset
2601 (with-current-buffer (get-buffer-create " *FQM scratch*")
328150f0cf76 * url-util.el (url-insert-entities-in-string):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104775
diff changeset
2602 (erase-buffer)
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2603 (insert-buffer-substring message-buffer header-start header-end)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2604 (goto-char (point-min))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2605 (let ((case-fold-search t))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2606 (while (re-search-forward addr-regexp (point-max) t)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2607 (replace-match "")
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2608 (setq this-line (match-beginning 0))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2609 (forward-line 1)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2610 ;; get any continuation lines
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2611 (while (and (looking-at "^[ \t]+") (< (point) (point-max)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2612 (forward-line 1))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2613 (setq this-line-end (point-marker))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2614 ;; only keep if we don't have it already
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2615 (setq address-blob
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2616 (mail-strip-quoted-names (buffer-substring this-line this-line-end)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2617 (while (string-match "\\([, \t\n\r]*\\)\\([^, \t\n\r]+\\)" address-blob)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2618 (setq simple-address (substring address-blob (match-beginning 2) (match-end 2)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2619 (setq address-blob (replace-match "" t t address-blob))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2620 (if (not (member simple-address address-list))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2621 (add-to-list 'address-list simple-address)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2622 ))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2623 (kill-buffer nil)))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2624 (identity address-list)))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2625
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2626
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2627 (defun feedmail-one-last-look (feedmail-prepped-text-buffer)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2628 "Offer the user one last chance to give it up."
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2629 (save-excursion
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2630 (save-window-excursion
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2631 (switch-to-buffer feedmail-prepped-text-buffer)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2632 (if (and (fboundp 'y-or-n-p-with-timeout) (numberp feedmail-confirm-outgoing-timeout))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2633 (y-or-n-p-with-timeout
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2634 "FQM: Send this email? "
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2635 (abs feedmail-confirm-outgoing-timeout)
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2636 (> feedmail-confirm-outgoing-timeout 0))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2637 (y-or-n-p "FQM: Send this email? "))
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2638 )))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2639
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2640 (defun feedmail-fqm-p (might-be)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2641 "Internal; does filename end with FQM suffix?"
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2642 (string-match (concat (regexp-quote feedmail-queue-fqm-suffix) "$") might-be))
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2643
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2644
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2645 (defun feedmail-find-eoh (&optional noerror)
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2646 "Internal; finds the end of message header fields, returns mark just before it"
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2647 (save-excursion
22799
81edc8f95cd9 Entire file: Fix indentation.
Karl Heuer <kwzh@gnu.org>
parents: 22609
diff changeset
2648 (goto-char (point-min))
26778
6dc236826c61 (feedmail-find-eoh): Take
Gerd Moellmann <gerd@gnu.org>
parents: 23409
diff changeset
2649 (when (or (re-search-forward (concat "^"
6dc236826c61 (feedmail-find-eoh): Take
Gerd Moellmann <gerd@gnu.org>
parents: 23409
diff changeset
2650 (regexp-quote mail-header-separator)
6dc236826c61 (feedmail-find-eoh): Take
Gerd Moellmann <gerd@gnu.org>
parents: 23409
diff changeset
2651 "\n")
6dc236826c61 (feedmail-find-eoh): Take
Gerd Moellmann <gerd@gnu.org>
parents: 23409
diff changeset
2652 nil noerror)
6dc236826c61 (feedmail-find-eoh): Take
Gerd Moellmann <gerd@gnu.org>
parents: 23409
diff changeset
2653 (and feedmail-queue-alternative-mail-header-separator
6dc236826c61 (feedmail-find-eoh): Take
Gerd Moellmann <gerd@gnu.org>
parents: 23409
diff changeset
2654 (re-search-forward
6dc236826c61 (feedmail-find-eoh): Take
Gerd Moellmann <gerd@gnu.org>
parents: 23409
diff changeset
2655 (concat "^"
6dc236826c61 (feedmail-find-eoh): Take
Gerd Moellmann <gerd@gnu.org>
parents: 23409
diff changeset
2656 (regexp-quote
6dc236826c61 (feedmail-find-eoh): Take
Gerd Moellmann <gerd@gnu.org>
parents: 23409
diff changeset
2657 feedmail-queue-alternative-mail-header-separator)
6dc236826c61 (feedmail-find-eoh): Take
Gerd Moellmann <gerd@gnu.org>
parents: 23409
diff changeset
2658 "\n")
6dc236826c61 (feedmail-find-eoh): Take
Gerd Moellmann <gerd@gnu.org>
parents: 23409
diff changeset
2659 nil noerror)))
6dc236826c61 (feedmail-find-eoh): Take
Gerd Moellmann <gerd@gnu.org>
parents: 23409
diff changeset
2660 (forward-line -1)
6dc236826c61 (feedmail-find-eoh): Take
Gerd Moellmann <gerd@gnu.org>
parents: 23409
diff changeset
2661 (point-marker))))
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2662
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2663 (provide 'feedmail)
38436
b174db545cfd Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 35616
diff changeset
2664
93975
1e3a407766b9 Fix up comment convention on the arch-tag lines.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87384
diff changeset
2665 ;; arch-tag: ec27b380-11c0-4dfd-8436-f636cf2bb992
22513
bbf2827a9356 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2666 ;;; feedmail.el ends here