From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/4323 Path: main.gmane.org!not-for-mail From: dreschs@mpd.tandem.com (Sten Drescher) Newsgroups: gmane.emacs.gnus.general Subject: Re: Handling Resent-CC and -BCC in sendmail.el Date: 08 Dec 1995 17:48:33 -0600 Organization: Tandem Computers Sender: dreschs@mpd.tandem.com Message-ID: <55pwdzf772.fsf@galil.austnsc.tandem.com> References: <199512082151.WAA22197@tina.lysator.liu.se> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1035145084 29176 80.91.224.250 (20 Oct 2002 20:18:04 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 20:18:04 +0000 (UTC) Return-Path: ding-request@ifi.uio.no Original-Received: from ifi.uio.no (ifi.uio.no [129.240.64.2]) by miranova.com (8.6.11/8.6.9) with ESMTP id QAA24374 for ; Fri, 8 Dec 1995 16:22:13 -0800 Original-Received: from galil.austnsc.tandem.com (argyle.mpd.tandem.com [131.124.250.13]) by ifi.uio.no with ESMTP (8.6.11/ifi2.4) id for ; Sat, 9 Dec 1995 00:47:48 +0100 Original-Received: (from dreschs@localhost) by galil.austnsc.tandem.com (8.7.1/8.7.1) id RAA10057; Fri, 8 Dec 1995 17:48:35 -0600 (CST) Original-To: bug-gnu-emacs@prep.ai.mit.edu In-Reply-To: David K}gedal's message of Fri, 8 Dec 1995 22:51:29 +0100 Original-Lines: 133 Xref: main.gmane.org gmane.emacs.gnus.general:4323 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:4323 David K=E5gedal said: DK> In GNU Emacs 19.30.1 (sparc-sun-solaris2.4, X toolkit) of Tue Nov 28 DK> 1995 on tiny configured using `configure --prefix=3D/usr/gnu DK> --with-x-toolkit' DK> When sending mail containing a "Resent-To: foobar" header, the DK> function sendmail-send-it sees that this is a forwarded mail, and DK> makes sure that sendmail is not called with -t, but instead finds DK> the addresses in the "Resent-To:" header and gives them to sendmail. DK> But it doesn't do anything with Resent-CC or Resent-BCC DK> headers. They are equally valid headers, although maybe less likely DK> to appear. But anyway, here is a patch that handles these cases, DK> including removal of any Resent-BCC headers before actual sending. I DK> believe recent versions of sendmail can take care of the last bit DK> itself, but many versions don't. As sendmail 8.7.1 (possibly earlier) can handle Resent-* headers, here is an additional patch (combined with David K=E5gedal's) which allows sendmail to handle the resending. DK> First a changelog entry Fri Dec 8 23:36:46 1995 Sten Drescher * sendmail.el: Added sendmail-resends variable to indicate that sendmail can handle Resent-* headers * sendmail.el (sendmail-send-it): Checks sendmail-resends before doing internal processing of Resent-* headers. Fri Dec 8 22:44:15 1995 David K}gedal * sendmail.el (sendmail-send-it): Added support for Resent-CC and Resent-BCC headers. *** /usr/remote/share/emacs/19.30/lisp/sendmail.el Fri Nov 10 11:23:39 19= 95 --- sendmail.el Fri Dec 8 17:24:39 1995 *************** *** 61,67 **** --- 61,73 ---- The headers should be delimited by a line whose contents match the variable `mail-header-separator'.") =20 + ;; Should be set in site-init.el ;;;###autoload + (defvar sendmail-resends nil "\ + *If t, the sendmail-program will handle Resent messages. + Otherwise, the send-mail-function must.") +=20 + ;;;###autoload (defvar mail-header-separator "--text follows this line--" "\ *Line used to separate headers from text in messages being composed.") =20 *************** *** 492,507 **** (< (point) delimline)) (replace-match "\n")) (let ((case-fold-search t)) ! (goto-char (point-min)) ! (while (re-search-forward "^Resent-to:" delimline t) ! (setq resend-to-addresses ! (save-restriction ! (narrow-to-region (point) ! (save-excursion ! (end-of-line) ! (point))) ! (append (mail-parse-comma-list) ! resend-to-addresses)))) ;;; Apparently this causes a duplicate Sender. ;;; ;; If the From is different than current user, insert Sender. ;;; (goto-char (point-min)) --- 498,520 ---- (< (point) delimline)) (replace-match "\n")) (let ((case-fold-search t)) ! (if (not (eq sendmail-resends t)) ! (progn ! (goto-char (point-min)) ! (while (re-search-forward "^Resent-\\(to\\|cc\\|bcc\\):" delimline = t) ! (setq resend-to-addresses ! (save-restriction ! (narrow-to-region (point) ! (save-excursion ! (end-of-line) ! (point))) ! (append (mail-parse-comma-list) ! resend-to-addresses))) ! ;; Delete Resent-BCC ourselves ! (if (save-excursion (beginning-of-line) ! (looking-at "resent-bcc")) ! (delete-region (save-excursion (beginning-of-line) (point)) ! (save-excursion (end-of-line) (1+ (point)))))))) ;;; Apparently this causes a duplicate Sender. ;;; ;; If the From is different than current user, insert Sender. ;;; (goto-char (point-min)) *************** *** 599,609 **** ;; and "deliver in background". (if (null mail-interactive) '("-oem" "-odb")) ;; Get the addresses from the message ! ;; unless this is a resend. ;; We must not do that for a resend ;; because we would find the original addresses. ;; For a resend, include the specific addresses. ! (or resend-to-addresses '("-t"))))) (if mail-interactive (save-excursion --- 612,624 ---- ;; and "deliver in background". (if (null mail-interactive) '("-oem" "-odb")) ;; Get the addresses from the message ! ;; unless this is a resend and sendmail-resends ! ;; is not t. ;; We must not do that for a resend ;; because we would find the original addresses. ;; For a resend, include the specific addresses. ! (or (if (not (eq sendmail-resends t))=20 ! resend-to-addresses) '("-t"))))) (if mail-interactive (save-excursion -- DK> David K=E5gedal Lysator Academic Computer Society davidk@lysator.liu.= se DK> http://www.lysator.liu.se/~davidk/ +46-13 17 65 8= 9 --=20 #include /* Sten Drescher */ To get my PGP public key, send me email with your public key and Subject: PGP key exchange Key fingerprint =3D 90 5F 1D FD A6 7C 84 5E A9 D3 90 16 B2 44 C4 F3