info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting Return-Path to From address


From: David Engster
Subject: Re: Setting Return-Path to From address
Date: Sat, 06 Jun 2009 18:20:15 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.93 (gnu/linux)

Mark Nyqvist Hjarding <spam@hjarding.dk> writes:
> Sometimes I would like to change the from address when sending an email
> and this works by just changing it in the Message buffer before sending
> it. The problem is that the Return-Path is still set to the value of
> address. Is there a way to force Return-Path to be the same as From? 

This depends on how you actually send the mail on your system, but the
following snippet might do what you want:

--8<---------------cut here---------------start------------->8---
(defun DE-set-envelope ()
  (let ((from (cadr
                (mail-extract-address-components
                 (message-field-value "from")))))
    (when mail-specify-envelope-from
      (setq mail-envelope-from from))))

(setq mail-specify-envelope-from t)
(add-hook 'message-send-hook 'DE-set-envelope)
--8<---------------cut here---------------end--------------->8---

See also the documentation for mail-specify-envelope-from.

-David





reply via email to

[Prev in Thread] Current Thread [Next in Thread]