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

Re: [sup-talk] reply-from.rb troubles



Excerpts from William Morgan's message of Sun Jan 17 21:36:01 +0100 2010:
> Reformatted excerpts from Philipp Überbacher's message of 2010-01-17:
> > Now that you say this is impossible, I had a look at my before-edit.rb
> > and suspect it to be the culprit, since it ends with:
> > else
> >   header["From"] = "Philipp Überbacher <murks@lavabit.com>"
> > end
> 
> Hah, nice catch. That would do it.
> 
> > Now how can one do both without trouble, replying sanely and using a
> > sane address for new messages?
> 
> I think the proper answer is to change reply-mode, so that any addresses
> set by the reply-* hooks overrides anything set by the before-edit hook.
> 
> In the mean time, you can probably work around this with a nasty hack: in
> before-edit hook, if the "In-reply-to" header is set, don't set the From
> address (because it is a reply, and will have been set by the reply-from
> hook).

It took me a while to get to it since I was kind of afraid of ruby, but
I tried today and it seems to work like this:

if header["In-reply-to"] = nil
        if header["To"] =~ /talk|list|lists|linux|devel|user|daw/
                header["From"] = "Philipp Überbacher <hollunder@lavabit.com>"
        else
                header["From"] = "Philipp Überbacher <murks@lavabit.com>"
        end
end

Thanks a lot. I recommended sup today on my distros mailinglist and briefly showed it to some colleagues who had never seen something like it.

Regards,
Philipp

_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk