Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: sgoldman@tower-research.com (Steve Goldman)
Subject: [sup-talk] Choose "From:" address based on message content?
Date: Wed, 22 Jul 2009 22:51:54 -0400	[thread overview]
Message-ID: <1248317360-sup-4094@sgoldmanlinux.tower-research.com> (raw)
In-Reply-To: <1248311332-sup-1053@sgoldmanlinux.tower-research.com>

Excerpts from Steve Goldman's message of Wed Jul 22 21:10:41 -0400 2009:
> 
> Here's what I want:
> 
> After I compose an email (new or a reply), I want sup to grep the
> entire message (recipients, subject, body, etc.) for a single word and
> choose address A if that word is there and address B otherwise.
> 
> Can sup do it?
> 
> Thanks.
> 

I think I answered my own question.

I added an "after-edit" hook call in edit-message-mode.rb and wrote a
hook that looks like this:


require 'eregex'

r = Regexp.new('word', Regexp::IGNORECASE);
if header.to_s.grep(r).size > 0 or body.to_s.grep(r).size > 0
  header["From"] = "Steve Goldman <sgoldman at other-address.com>"
end
-- 

Steve Goldman
sgoldman at tower-research.com

T: 212.219.6014
F: 212.219.6007

Tower Research Capital, LLC
377 Broadway, 11th Fl.
New York, NY 10013


  reply	other threads:[~2009-07-23  2:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-23  1:10 Steve Goldman
2009-07-23  2:51 ` Steve Goldman [this message]
2009-07-27 16:53   ` William Morgan
2009-07-27 16:52 ` 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=1248317360-sup-4094@sgoldmanlinux.tower-research.com \
    --to=sgoldman@tower-research.com \
    /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