From: marc.hartstein@alum.vassar.edu (Marc Hartstein)
Subject: [sup-talk] [PATCH] Config control over how From address is generated when replying.
Date: Wed, 23 Apr 2008 17:02:50 -0400 [thread overview]
Message-ID: <1208984570-24674-1-git-send-email-marc.hartstein@alum.vassar.edu> (raw)
Two new boolean options are now recognized in .sup/config.yaml
:reply_from_recipient: Check headers for the real email address the message
ultimately arrived at, and use it if it's one of
your accounts (or an alternate/regexp for such).
:reply_from_tocc: Check To and CC for an address which matches one of
your accounts and use the first such found.
Both options default to true if missing, preserving the traditional sup
behavior.
Setting ...recipient to false and ...tocc to true will emulate mutt's behavior
with reverse_name=true
Setting both to false will always reply from your default account.
---
lib/sup/modes/reply-mode.rb | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/sup/modes/reply-mode.rb b/lib/sup/modes/reply-mode.rb
index e7b2929..82ce912 100644
--- a/lib/sup/modes/reply-mode.rb
+++ b/lib/sup/modes/reply-mode.rb
@@ -29,10 +29,12 @@ EOS
## first, determine the address at which we received this email. this will
## become our From: address in the reply.
+ check_recipient = $config[:reply_from_recipient].nil? || $config[:reply_from_recipient]
+ check_tocc = $config[:reply_from_tocc].nil? || $config[:reply_from_tocc]
from =
- if @m.recipient_email && AccountManager.is_account_email?(@m.recipient_email)
+ if check_recipient && @m.recipient_email && AccountManager.is_account_email?(@m.recipient_email)
PersonManager.person_for(@m.recipient_email)
- elsif(b = (@m.to + @m.cc).find { |p| AccountManager.is_account? p })
+ elsif check_tocc && (b = (@m.to + @m.cc).find { |p| AccountManager.is_account? p })
b
else
AccountManager.default_account
--
1.5.3.7
next reply other threads:[~2008-04-23 21:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-23 21:02 Marc Hartstein [this message]
2008-04-27 6:49 William Morgan
2008-04-28 4:11 ` Marc Hartstein
2008-04-29 16:19 ` William Morgan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1208984570-24674-1-git-send-email-marc.hartstein@alum.vassar.edu \
--to=marc.hartstein@alum.vassar.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox