Hi,
I'm now successfully using two hooks to use my sup-talk specific e-mail address
for mail to this list:
reply-from.rb:
PersonManager.person_for case
when message.recipient_email =~ /rubyforge/
"[email protected]"
end
before-edit.rb:
if header["To"] =~ /rubyforge/
header["From"] = "Marianne <[email protected]>"
end
It seems that the "Person" returned by the reply-from hook matches to some
extent, but not completely, an account in my ~/.sup/config.yaml, where I have a
:sup-talk: section with its own e-mail, sendmail, and signature. The hook picks
not just the correct e-mail, but also the corresponding sendmail, but not the
signature of that section.
For before-edit.rb, I have found no way to switch the signature and sendmail
along with the "from" address. I know there is a signature hook which I could
use for the first, but how to do the latter.
Maybe I'm missing something, but ideally, I'd love to see something where I
could define different accounts in the config.yaml, then have a way that works
both for replying and for new mail to pick *all* settings of that account from
config.yaml.
An additional question: For friends & family recipients, I'd like to use my
private settings. I maintain a list of such e-mail addresses in an external text
file, and I think that's neater than listing them all in each hook when needed.
In before-add-message.rb, I use this:
privatfile = File.open("/home/mpromber/.mutt/privataddr","r")
if ! privatfile.grep(/#{message.from.email}/).empty?
message.add_label :privat
end
but it seems "message.from.email" is not available for before-edit.rb.
I'm currently using this as a workaround:
privatfile = File.open("/home/mpromber/.mutt/privataddr","r")
toaddr = header["To"].scan(/[a-z0-9+._...@[a-z0-9.-]+\.[a-z]{2,4}/).join(sep="")
regexaddr = "^" + toaddr + "$"
if ! privatfile.grep(/#{regexaddr}/).empty?
header["From"] = "Marianne <[email protected]>"
end
Is there an easier mail to access the recipient e-mail address? And I also guess
I have to rewrite this to handle the case of several recipients, which
definitely would be easier if there's already and array of recipient addresses I
can refer to.
Thanks,
Marianne
--
Marianne Promberger
PGP/GnuPG public key ID 80AD9916
_______________________________________________
sup-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/sup-talk