[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sup-talk] [PATCH] Fix problem with account selector
I should probably explain the rationale behind this patch.
For a couple of years I used a single instance of sup to handle email
for two different accounts: one for personal email, and the other for
work email. When I sent a message to somebody at work, I wanted the
From: address to be set automatically to my work email address.
Otherwise I wanted the From: address to be set to my personal email
address. To do this I wrote a before-edit hook that looked like this
(with my company name changed to "widgets"):
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
But the hook didn't work; the account selector was changing the From:
address back to marka@pobox.com even after the hook had set it to
marka@widgets.com. The fix was to run the hook before the account
selector was initialized.
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk