Mercurial > hg > xemacs-beta
comparison lisp/packages/feedmail.el @ 134:34a5b81f86ba r20-2b1
Import from CVS: tag r20-2b1
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:30:11 +0200 |
parents | 376386a54a3c |
children |
comparison
equal
deleted
inserted
replaced
133:b27e67717092 | 134:34a5b81f86ba |
---|---|
96 ;;; | 96 ;;; |
97 ;;; (setq send-mail-function 'feedmail-send-it) | 97 ;;; (setq send-mail-function 'feedmail-send-it) |
98 ;;; (autoload 'feedmail-send-it "feedmail") | 98 ;;; (autoload 'feedmail-send-it "feedmail") |
99 ;;; | 99 ;;; |
100 | 100 |
101 | 101 (defgroup feedmail nil |
102 (defvar feedmail-confirm-outgoing nil | 102 "Outbound mail handling." |
103 :group 'mail) | |
104 | |
105 | |
106 (defcustom feedmail-confirm-outgoing nil | |
103 "*If non-nil, gives a y-or-n confirmation prompt after prepping, | 107 "*If non-nil, gives a y-or-n confirmation prompt after prepping, |
104 before sending mail.") | 108 before sending mail." |
105 | 109 :type 'boolean |
106 | 110 :group 'feedmail) |
107 (defvar feedmail-nuke-bcc t | 111 |
112 | |
113 (defcustom feedmail-nuke-bcc t | |
108 "*Non-nil means get rid of the BCC: lines from the message header | 114 "*Non-nil means get rid of the BCC: lines from the message header |
109 text before sending the mail. In any case, the BCC: lines do | 115 text before sending the mail. In any case, the BCC: lines do |
110 participate in the composed address list. You probably want to keep | 116 participate in the composed address list. You probably want to keep |
111 them if you're using sendmail (see feedmail-buffer-eating-function).") | 117 them if you're using sendmail (see feedmail-buffer-eating-function)." |
112 | 118 :type 'boolean |
113 | 119 :group 'feedmail) |
114 (defvar feedmail-fill-to-cc t | 120 |
121 | |
122 (defcustom feedmail-fill-to-cc t | |
115 "*Non-nil means do smart filling (line-wrapping) of TO: and CC: header | 123 "*Non-nil means do smart filling (line-wrapping) of TO: and CC: header |
116 lines. If nil, the lines are left as-is. The filling is done after | 124 lines. If nil, the lines are left as-is. The filling is done after |
117 mail address alias expansion.") | 125 mail address alias expansion." |
118 | 126 :type 'boolean |
119 | 127 :group 'feedmail) |
120 (defvar feedmail-fill-to-cc-fill-column default-fill-column | 128 |
121 "*Fill column used when wrapping mail TO: and CC: lines.") | 129 |
122 | 130 (defcustom feedmail-fill-to-cc-fill-column default-fill-column |
123 | 131 "*Fill column used when wrapping mail TO: and CC: lines." |
124 (defvar feedmail-nuke-empty-headers t | 132 :type 'integer |
133 :group 'feedmail) | |
134 | |
135 | |
136 (defcustom feedmail-nuke-empty-headers t | |
125 "*If non-nil, headers with no contents are removed from the outgoing | 137 "*If non-nil, headers with no contents are removed from the outgoing |
126 email. A completely empty SUBJECT: header is always removed, | 138 email. A completely empty SUBJECT: header is always removed, |
127 regardless of the setting of this variable. The only time you would | 139 regardless of the setting of this variable. The only time you would |
128 want them left in would be if you used some headers whose presence | 140 want them left in would be if you used some headers whose presence |
129 indicated something rather than their contents.") | 141 indicated something rather than their contents." |
142 :type 'boolean | |
143 :group 'feedmail) | |
130 | 144 |
131 ;;; wjc sez: I think the use of the SENDER: line is pretty pointless, | 145 ;;; wjc sez: I think the use of the SENDER: line is pretty pointless, |
132 ;;; but I left it in to be compatible with sendmail.el and because | 146 ;;; but I left it in to be compatible with sendmail.el and because |
133 ;;; maybe some distant mail system needs it. Really, though, if you | 147 ;;; maybe some distant mail system needs it. Really, though, if you |
134 ;;; want a sender line in your mail, just put one in there and don't | 148 ;;; want a sender line in your mail, just put one in there and don't |
135 ;;; wait for feedmail to do it for you. | 149 ;;; wait for feedmail to do it for you. |
136 | 150 |
137 (defvar feedmail-sender-line nil | 151 (defcustom feedmail-sender-line nil |
138 "*If nil, no SENDER: header is forced. If non-nil and the email | 152 "*If nil, no SENDER: header is forced. If non-nil and the email |
139 already has a FROM: header, a SENDER: header is forced with this as | 153 already has a FROM: header, a SENDER: header is forced with this as |
140 its contents. You can probably leave this nil, but if you feel like | 154 its contents. You can probably leave this nil, but if you feel like |
141 using it, a good value would be a fully-qualified domain name form of | 155 using it, a good value would be a fully-qualified domain name form of |
142 your address. For example, william.j.carpenter@att.com. Don't | 156 your address. For example, william.j.carpenter@att.com. Don't |
143 include a trailing newline or the keyword SENDER:. They're | 157 include a trailing newline or the keyword SENDER:. They're |
144 automatically provided.") | 158 automatically provided." |
159 :type 'boolean | |
160 :group 'feedmail) | |
145 | 161 |
146 | 162 |
147 ;; user-full-name suggested by kpc@ptolemy.arc.nasa.gov (=Kimball Collins) | 163 ;; user-full-name suggested by kpc@ptolemy.arc.nasa.gov (=Kimball Collins) |
148 (defvar feedmail-from-line | 164 (defcustom feedmail-from-line |
149 (concat (user-login-name) "@" (system-name) " (" (user-full-name) ")") | 165 (concat (user-login-name) "@" (system-name) " (" (user-full-name) ")") |
150 "*If non-nil and the email has no FROM: header, one will be forced | 166 "*If non-nil and the email has no FROM: header, one will be forced |
151 with this as its contents. A good value would be a fully-qualified | 167 with this as its contents. A good value would be a fully-qualified |
152 domain name form of your address. For example, william.j.carpenter@att.com. | 168 domain name form of your address. For example, william.j.carpenter@att.com. |
153 (The default value of this variable is probably not very good, since | 169 (The default value of this variable is probably not very good, since |
154 it doesn't have a domain part.) Don't include a trailing newline or | 170 it doesn't have a domain part.) Don't include a trailing newline or |
155 the keyword FROM:. They're automatically provided.") | 171 the keyword FROM:. They're automatically provided." |
172 :type '(choice (const nil) string) | |
173 :group 'feedmail) | |
156 | 174 |
157 | 175 |
158 ;;; Here's how I use the GNUS Message-ID generator for mail but not | 176 ;;; Here's how I use the GNUS Message-ID generator for mail but not |
159 ;;; for news postings: | 177 ;;; for news postings: |
160 ;;; | 178 ;;; |
172 ;;; (defun gnus-inews-date () nil) | 190 ;;; (defun gnus-inews-date () nil) |
173 ;;; (fset 'wjc:gnus-inews-message-id (symbol-function 'gnus-inews-message-id)) | 191 ;;; (fset 'wjc:gnus-inews-message-id (symbol-function 'gnus-inews-message-id)) |
174 ;;; (defun gnus-inews-message-id () nil) | 192 ;;; (defun gnus-inews-message-id () nil) |
175 ;;; )) | 193 ;;; )) |
176 ;;; | 194 ;;; |
177 (defvar feedmail-message-id-generator nil | 195 (defcustom feedmail-message-id-generator nil |
178 "*If non-nil, should be a function (called with no arguments) which | 196 "*If non-nil, should be a function (called with no arguments) which |
179 will generate a unique message ID which will be inserted on a | 197 will generate a unique message ID which will be inserted on a |
180 Message-ID: header. The message ID should be the return value of the | 198 Message-ID: header. The message ID should be the return value of the |
181 function. Don't include trailing newline, leading space, or the | 199 function. Don't include trailing newline, leading space, or the |
182 keyword MESSAGE-ID. They're automatically provided. Do include | 200 keyword MESSAGE-ID. They're automatically provided. Do include |
184 function, you could look at the GNUS function gnus-inews-message-id. | 202 function, you could look at the GNUS function gnus-inews-message-id. |
185 When called, the current buffer is the prepped outgoing mail buffer | 203 When called, the current buffer is the prepped outgoing mail buffer |
186 (the function may inspect it, but shouldn't modify it). If the returned | 204 (the function may inspect it, but shouldn't modify it). If the returned |
187 value doesn't contain any non-whitespace characters, no message ID | 205 value doesn't contain any non-whitespace characters, no message ID |
188 header is generated, so you could generate them conditionally, | 206 header is generated, so you could generate them conditionally, |
189 based on the contents of the mail.") | 207 based on the contents of the mail." |
208 :type 'boolean | |
209 :group 'feedmail) | |
190 | 210 |
191 | 211 |
192 (defun feedmail-confirm-addresses-hook-example () | 212 (defun feedmail-confirm-addresses-hook-example () |
193 "An example of a last chance hook that shows the simple addresses | 213 "An example of a last chance hook that shows the simple addresses |
194 and gets a confirmation. Use as (setq feedmail-last-chance-hook | 214 and gets a confirmation. Use as (setq feedmail-last-chance-hook |
197 (display-buffer feedmail-address-buffer) | 217 (display-buffer feedmail-address-buffer) |
198 (if (not (y-or-n-p "How do you like them apples? ")) | 218 (if (not (y-or-n-p "How do you like them apples? ")) |
199 (error "Sending...gave up in last chance hook")))) | 219 (error "Sending...gave up in last chance hook")))) |
200 | 220 |
201 | 221 |
202 (defvar feedmail-last-chance-hook nil | 222 (defcustom feedmail-last-chance-hook nil |
203 "*User's last opportunity to modify the message on its way out. It | 223 "*User's last opportunity to modify the message on its way out. It |
204 has already had all the header prepping from the standard package. | 224 has already had all the header prepping from the standard package. |
205 The next step after running the hook will be to push the buffer into a | 225 The next step after running the hook will be to push the buffer into a |
206 subprocess that mails the mail. The hook might be interested in these | 226 subprocess that mails the mail. The hook might be interested in these |
207 buffers: (1) feedmail-prepped-text-buffer contains the header and body | 227 buffers: (1) feedmail-prepped-text-buffer contains the header and body |
208 of the message, ready to go; (2) feedmail-address-buffer contains the | 228 of the message, ready to go; (2) feedmail-address-buffer contains the |
209 space-separated, simplified list of addresses which is to be given to | 229 space-separated, simplified list of addresses which is to be given to |
210 the subprocess (the hook may change them). feedmail-error-buffer is | 230 the subprocess (the hook may change them). feedmail-error-buffer is |
211 an empty buffer intended to soak up errors for display to the user. | 231 an empty buffer intended to soak up errors for display to the user. |
212 If the hook allows interactive activity, the user should not send more | 232 If the hook allows interactive activity, the user should not send more |
213 mail while in the hook since some of the internal buffers will be reused.") | 233 mail while in the hook since some of the internal buffers will be reused." |
234 :type 'hook | |
235 :group 'feedmail) | |
214 | 236 |
215 ;; XEmacs change: make the default more sensible. | 237 ;; XEmacs change: make the default more sensible. |
216 (defvar feedmail-buffer-eating-function | 238 (defcustom feedmail-buffer-eating-function |
217 (if (and (boundp 'sendmail-program) | 239 (if (and (boundp 'sendmail-program) |
218 (string-match "sendmail" sendmail-program)) | 240 (string-match "sendmail" sendmail-program)) |
219 'feedmail-buffer-to-sendmail | 241 'feedmail-buffer-to-sendmail |
220 'feedmail-buffer-to-binmail) | 242 'feedmail-buffer-to-binmail) |
221 "*Function used to send the prepped buffer to a subprocess. The | 243 "*Function used to send the prepped buffer to a subprocess. The |
223 the prepped message; (2) a buffer where errors should be directed; and | 245 the prepped message; (2) a buffer where errors should be directed; and |
224 (3) a string containing the space-separated list of simplified | 246 (3) a string containing the space-separated list of simplified |
225 addresses. Two popular choices for this are 'feedmail-buffer-to-binmail | 247 addresses. Two popular choices for this are 'feedmail-buffer-to-binmail |
226 and 'feedmail-buffer-to-sendmail. If you use the sendmail form, you | 248 and 'feedmail-buffer-to-sendmail. If you use the sendmail form, you |
227 probably want to set feedmail-nuke-bcc to nil. If you use the binmail | 249 probably want to set feedmail-nuke-bcc to nil. If you use the binmail |
228 form, check the value of feedmail-binmail-template.") | 250 form, check the value of feedmail-binmail-template." |
229 | 251 :type 'function |
230 | 252 :group 'feedmail) |
231 (defvar feedmail-binmail-template (if mail-interactive "/bin/mail %s" "/bin/rmail %s") | 253 |
254 | |
255 (defcustom feedmail-binmail-template (if mail-interactive "/bin/mail %s" "/bin/rmail %s") | |
232 "*Command template for the subprocess which will get rid of the | 256 "*Command template for the subprocess which will get rid of the |
233 mail. It can result in any command understandable by /bin/sh. The | 257 mail. It can result in any command understandable by /bin/sh. The |
234 single '%s', if present, gets replaced by the space-separated, | 258 single '%s', if present, gets replaced by the space-separated, |
235 simplified list of addressees. Used in feedmail-buffer-to-binmail to | 259 simplified list of addressees. Used in feedmail-buffer-to-binmail to |
236 form the shell command which will receive the contents of the prepped | 260 form the shell command which will receive the contents of the prepped |
237 buffer as stdin. If you'd like your errors to come back as mail | 261 buffer as stdin. If you'd like your errors to come back as mail |
238 instead of immediately in a buffer, try /bin/rmail instead of | 262 instead of immediately in a buffer, try /bin/rmail instead of |
239 /bin/mail (this can be accomplished by keeping the default nil setting | 263 /bin/mail (this can be accomplished by keeping the default nil setting |
240 of mail-interactive). You might also like to consult local mail | 264 of mail-interactive). You might also like to consult local mail |
241 experts for any other interesting command line possibilities.") | 265 experts for any other interesting command line possibilities." |
266 :type 'string | |
267 :group 'feedmail) | |
242 | 268 |
243 | 269 |
244 ;; feedmail-buffer-to-binmail and feedmail-buffer-to-sendmail are the | 270 ;; feedmail-buffer-to-binmail and feedmail-buffer-to-sendmail are the |
245 ;; only things provided for values for the variable | 271 ;; only things provided for values for the variable |
246 ;; feedmail-buffer-eating-function. It's pretty easy to write your | 272 ;; feedmail-buffer-eating-function. It's pretty easy to write your |