From owner-freebsd-hackers Mon Feb 16 23:03:48 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id XAA17314 for freebsd-hackers-outgoing; Mon, 16 Feb 1998 23:03:48 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from silvia.HIP.Berkeley.EDU (ala-ca34-51.ix.netcom.com [207.93.143.179]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA17294 for ; Mon, 16 Feb 1998 23:03:41 -0800 (PST) (envelope-from asami@vader.cs.berkeley.edu) Received: (from asami@localhost) by silvia.HIP.Berkeley.EDU (8.8.8/8.6.9) id XAA03396; Mon, 16 Feb 1998 23:03:12 -0800 (PST) Date: Mon, 16 Feb 1998 23:03:12 -0800 (PST) Message-Id: <199802170703.XAA03396@silvia.HIP.Berkeley.EDU> To: Mike Smith Cc: hackers@FreeBSD.ORG Subject: Re: Mailreader with "multiple personalities"? From: asami@FreeBSD.ORG (Satoshi Asami) Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I use emacs/rmail and pop all my mail from various accounts (most notably freebsd.org and cs.berkeley.edu). I just hacked together the following. The code is quite ugly as I just patched it together from various functions (rmail-message-regexp-p, rmail-reply, rmail-output-to-rmail-file), but it seems to work ok. The idea here is that you define a list of (regexp address) pairs in rmail-from-alist, and it will take the address from the first regexp that matches. My sample will match a string in any part of the header but you can further delimit things by using strings like "Sender:.*owner-@freebsd\\.org" to detect mailing list mails, etc. Satoshi ------- (setq rmail-from-alist (list '("freebsd\\.org" "asami@freebsd.org (Satoshi Asami)") '("cvs commit" "asami@freebsd.org (Satoshi Asami)") '("." "asami@cs.berkeley.edu (Satoshi Asami)") )) (defun rmail-reply-with-from (just-sender) "Reply to the current message. Normally include CC: to all other recipients of original message; prefix argument means ignore them. While composing the reply, use \\[mail-yank-original] to yank the original message into it." (interactive "P") (if (and (boundp 'rmail-from-alist) (setq me (let (answer (tail rmail-from-alist)) (while (and tail (not answer)) (if (save-excursion (save-restriction (widen) (goto-char (rmail-msgbeg rmail-current-message)) (let ((end (save-excursion (search-forward "*** EOOH ***" (point-max)) (point)))) (re-search-forward (car (car tail)) end t)))) (setq answer (car (cdr (car tail))))) (setq tail (cdr tail))) answer))) (let ((mail-default-headers (concat "From: " me "\n"))) (rmail-reply just-sender)) (rmail-reply just-sender))) (defun rmail-summary-reply-with-from (just-sender) "Reply to the current message. Normally include CC: to all other recipients of original message; prefix argument means ignore them. While composing the reply, use \\[mail-yank-original] to yank the original message into it." (interactive "P") (set-buffer rmail-buffer) (rmail-reply-with-from just-sender) (use-local-map (copy-keymap (current-local-map))) (define-key (current-local-map) "\C-c\C-c" 'rmail-summary-send-and-exit)) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message