Mark Nyqvist Hjarding <[email protected]> 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



_______________________________________________
info-gnus-english mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/info-gnus-english

Reply via email to