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

Re: [sup-talk] choosing signatures



Excerpts from Daniel Goldin's message of Tue Jun 08 01:16:25 -0400 2010:
> Thanks so much, works like a charm. But is there a way to change the
> "From:" and "In-reply-to:" and "Reply-to:" headers without having to add
> the config option ":ask_for_from: true"?

You may use the before-edit and reply-from hooks.  Here are scrubbed 
versions of mine:

before-edit.rb:
if header["To"] =~ /megacorp|ultramegacorp|alternacorp|minicorp|othercorp/
  header["From"] = "me <me@ultramegacorp.com>"
elsif header["To"] =~ /somelist|alternalist|otherlist/
  header["From"] = "me <me@nerdylistemail.org>"
end
header["Bcc"] = header["From"]

reply-from.rb:
val = case [message.recipient_email, message.to, message.cc, message.from].flatten.to_s
      when /megacorp|ultramegacorp|alternacorp|minicorp|othercorp/ then "me <me@ultramegacorp.com>"
      when /personal.org/ then "me <me@personal.org>"
      when /nerdylistemail.org|somelist|alternalist|otherlist/ then "me <me@nerdylistemail.org>"
      when /newemail/ then "me <me@newemail.com>"
      when /oldemail/ then "me <me@newemail.com>"
      end
Person.from_address val
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk