Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Setting Return-Path to From address
@ 2009-06-04  6:59 Mark Nyqvist Hjarding
  2009-06-06 16:20 ` David Engster
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Nyqvist Hjarding @ 2009-06-04  6:59 UTC (permalink / raw)
  To: info-gnus-english

Hello,

Here is a glance of my posting styles:
  (".*"
    (name "Mark Nyqvist Hjarding")
  )
  ("^[a-z]+\\+hjarding\\.dk"
    (address "spam@hjarding.dk")
    ("X-Homepage" "http://www.hjarding.dk")
    (eval (setq message-sendmail-extra-arguments '("-a" "hjarding")))
    (message-mail-p)
  )

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? 

/Mark

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Setting Return-Path to From address
  2009-06-04  6:59 Setting Return-Path to From address Mark Nyqvist Hjarding
@ 2009-06-06 16:20 ` David Engster
  0 siblings, 0 replies; 2+ messages in thread
From: David Engster @ 2009-06-06 16:20 UTC (permalink / raw)
  To: info-gnus-english

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-06-06 16:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-04  6:59 Setting Return-Path to From address Mark Nyqvist Hjarding
2009-06-06 16:20 ` David Engster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).