Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: marianne.promberger+sup-talk@gmail.com (Marianne)
Subject: [sup-talk] questions about reply-from & before-edit hooks and accounts
Date: Tue, 06 Jan 2009 15:49:07 +0100	[thread overview]
Message-ID: <1231252310-sup-6112@audrey> (raw)

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/
                           "my.name+sup-talk at gmail.com"
                         end
before-edit.rb:

if header["To"] =~ /rubyforge/
  header["From"] = "Marianne <my.name+sup-talk at gmail.com>"
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 <myprivate at address.com>"
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


             reply	other threads:[~2009-01-06 14:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-06 14:49 Marianne [this message]
2009-01-06 20:13 ` Marcus Williams
2009-01-14 18:34   ` Marianne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1231252310-sup-6112@audrey \
    --to=marianne.promberger+sup-talk@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox