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

Re: [sup-devel] [sup-talk] Preparing for sup 0.13



Excerpts from Hamish D's message of Sun Oct 16 08:09:41 -0400 2011:
> * added an account selector when composing email for those who have
> multiple possible from addresses

I'm having a problem with this feature, too.

I have two main email accounts, one for personal email and one for
work email.  My before-edit.rb hook figures out which account to use
as the sender (the "From" header) by looking at the recipients (the
"To" header).  This worked with sup 0.12, but with 0.13 the sender is
changed back to the default as soon as I exit the editor.

I see that Sascha Silbe said something about this seven months ago:

> This one would possibly break my workflow. My From address is chosen in
> the before-edit hook based on the set of recipients. Since you only
> call before-edit once with headers_full as headers, whatever From
> address gets chosen for the initial reply mode will "stick".

Here's the sanitized before-edit.rb hook, in case that helps:

unless header["In-reply-to"]
  if header["To"] =~ /widgets/
    to = header["To"]
    info "Sending as widgets, to = #{to}"
    header["From"] = "Mark Alexander <marka@widgets.com>"
  else
    to = header["To"]
    info "Sending as pobox, to = #{to}"
    header["From"] = "Mark Alexander <marka@pobox.com>"
  end
end
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel