Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] choosing signatures
@ 2010-06-06 19:00 Daniel Goldin
  2010-06-07  4:36 ` Richard Heycock
  0 siblings, 1 reply; 10+ messages in thread
From: Daniel Goldin @ 2010-06-06 19:00 UTC (permalink / raw)
  To: sup-talk

What an amazing and blazingly fast program sup is! But how does one choose
between different signatures when sending an email?  I couldn't find
anything on the wiki.

Non-programmer-type here -- so keep it easy, please.

d.

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [sup-talk] choosing signatures
  2010-06-06 19:00 [sup-talk] choosing signatures Daniel Goldin
@ 2010-06-07  4:36 ` Richard Heycock
  2010-06-08  5:16   ` Daniel Goldin
  0 siblings, 1 reply; 10+ messages in thread
From: Richard Heycock @ 2010-06-07  4:36 UTC (permalink / raw)
  To: sup-talk

Excerpts from Daniel Goldin's message of 2010-06-07 05:00:33 +1000:
> What an amazing and blazingly fast program sup is! But how does one choose
> between different signatures when sending an email?  I couldn't find
> anything on the wiki.
> 
> Non-programmer-type here -- so keep it easy, please.
> 
> d.
> 

Just replace :default with a name and repeat that block:

edit $HOME/.sup/config.yaml

  ...

  :accounts:
    :default:
      :sendmail: /usr/sbin/sendmail -oem -ti
      :name: <name>
      :email: <email address>
      :signature: <path to signature file>
    :<name>:
      :sendmail: /usr/sbin/sendmail -oem -ti
      :name: <name>
      :email: <email address>
      :signature: <path to signature file>

  ...

You can have as many account entries as you like.

Also See:
    http://sup.rubyforge.org/wiki/wiki.pl?MultipleAccountsAndReply

rgh
-- 
Richard Heycock

http://topikality.com

+61 (0) 410 646 369
[e]:  rgh@topikality.com
[im]: rgh@topikality.com
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [sup-talk] choosing signatures
  2010-06-07  4:36 ` Richard Heycock
@ 2010-06-08  5:16   ` Daniel Goldin
  2010-06-08 11:57     ` Eric Sherman
  0 siblings, 1 reply; 10+ messages in thread
From: Daniel Goldin @ 2010-06-08  5:16 UTC (permalink / raw)
  To: Richard Heycock; +Cc: sup-talk

Thanks so much, works like a charm. But is there a way to change the
"From:" and "In-reply-to:" and "Reply-to:" headers without having to add
the config option ":ask_for_from: true"?

Excerpts from Richard Heycock's message of Sun Jun 06 21:36:02 -0700 2010:
> Excerpts from Daniel Goldin's message of 2010-06-07 05:00:33 +1000:
> > What an amazing and blazingly fast program sup is! But how does one choose
> > between different signatures when sending an email?  I couldn't find
> > anything on the wiki.
> > 
> > Non-programmer-type here -- so keep it easy, please.
> > 
> > d.
> > 
> 
> Just replace :default with a name and repeat that block:
> 
> edit $HOME/.sup/config.yaml
> 
>   ...
> 
>   :accounts:
>     :default:
>       :sendmail: /usr/sbin/sendmail -oem -ti
>       :name: <name>
>       :email: <email address>
>       :signature: <path to signature file>
>     :<name>:
>       :sendmail: /usr/sbin/sendmail -oem -ti
>       :name: <name>
>       :email: <email address>
>       :signature: <path to signature file>
> 
>   ...
> 
> You can have as many account entries as you like.
> 
> Also See:
>     http://sup.rubyforge.org/wiki/wiki.pl?MultipleAccountsAndReply
> 
> rgh
-- 
Daniel Goldin 
213.926.1960
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [sup-talk] choosing signatures
  2010-06-08  5:16   ` Daniel Goldin
@ 2010-06-08 11:57     ` Eric Sherman
  2010-06-08 16:57       ` Daniel Goldin
  2010-06-10 15:52       ` Gregor Hoffleit
  0 siblings, 2 replies; 10+ messages in thread
From: Eric Sherman @ 2010-06-08 11:57 UTC (permalink / raw)
  To: sup-talk

Excerpts from Daniel Goldin's message of Tue Jun 08 01:16:25 -0400 2010:
> Thanks so much, works like a charm. But is there a way to change the
> "From:" and "In-reply-to:" and "Reply-to:" headers without having to add
> the config option ":ask_for_from: true"?

You may use the before-edit and reply-from hooks.  Here are scrubbed 
versions of mine:

before-edit.rb:
if header["To"] =~ /megacorp|ultramegacorp|alternacorp|minicorp|othercorp/
  header["From"] = "me <me@ultramegacorp.com>"
elsif header["To"] =~ /somelist|alternalist|otherlist/
  header["From"] = "me <me@nerdylistemail.org>"
end
header["Bcc"] = header["From"]

reply-from.rb:
val = case [message.recipient_email, message.to, message.cc, message.from].flatten.to_s
      when /megacorp|ultramegacorp|alternacorp|minicorp|othercorp/ then "me <me@ultramegacorp.com>"
      when /personal.org/ then "me <me@personal.org>"
      when /nerdylistemail.org|somelist|alternalist|otherlist/ then "me <me@nerdylistemail.org>"
      when /newemail/ then "me <me@newemail.com>"
      when /oldemail/ then "me <me@newemail.com>"
      end
Person.from_address val
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [sup-talk] choosing signatures
  2010-06-08 11:57     ` Eric Sherman
@ 2010-06-08 16:57       ` Daniel Goldin
  2010-06-10 15:52       ` Gregor Hoffleit
  1 sibling, 0 replies; 10+ messages in thread
From: Daniel Goldin @ 2010-06-08 16:57 UTC (permalink / raw)
  To: Eric Sherman; +Cc: sup-talk

Thank you so much! Works perfectly.

d.

Excerpts from Eric Sherman's message of Tue Jun 08 04:57:54 -0700 2010:
> Excerpts from Daniel Goldin's message of Tue Jun 08 01:16:25 -0400 2010:
> > Thanks so much, works like a charm. But is there a way to change the
> > "From:" and "In-reply-to:" and "Reply-to:" headers without having to add
> > the config option ":ask_for_from: true"?
> 
> You may use the before-edit and reply-from hooks.  Here are scrubbed 
> versions of mine:
> 
> before-edit.rb:
> if header["To"] =~ /megacorp|ultramegacorp|alternacorp|minicorp|othercorp/
>   header["From"] = "me <me@ultramegacorp.com>"
> elsif header["To"] =~ /somelist|alternalist|otherlist/
>   header["From"] = "me <me@nerdylistemail.org>"
> end
> header["Bcc"] = header["From"]
> 
> reply-from.rb:
> val = case [message.recipient_email, message.to, message.cc, message.from].flatten.to_s
>       when /megacorp|ultramegacorp|alternacorp|minicorp|othercorp/ then "me <me@ultramegacorp.com>"
>       when /personal.org/ then "me <me@personal.org>"
>       when /nerdylistemail.org|somelist|alternalist|otherlist/ then "me <me@nerdylistemail.org>"
>       when /newemail/ then "me <me@newemail.com>"
>       when /oldemail/ then "me <me@newemail.com>"
>       end
> Person.from_address val
-- 
Daniel Goldin 
213.926.1960
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [sup-talk] choosing signatures
  2010-06-08 11:57     ` Eric Sherman
  2010-06-08 16:57       ` Daniel Goldin
@ 2010-06-10 15:52       ` Gregor Hoffleit
  2010-06-10 16:01         ` Eric Sherman
  1 sibling, 1 reply; 10+ messages in thread
From: Gregor Hoffleit @ 2010-06-10 15:52 UTC (permalink / raw)
  To: Eric Sherman; +Cc: sup-talk

Eric,

at first, that looks like a duplication of code. Could you elaborate why
you use both of these hooks?

    Gregor


* Eric Sherman <hyperbolist@gmail.com> [Di Jun 08 13:57:54 +0200 2010]
> Excerpts from Daniel Goldin's message of Tue Jun 08 01:16:25 -0400 2010:
> > Thanks so much, works like a charm. But is there a way to change the
> > "From:" and "In-reply-to:" and "Reply-to:" headers without having to add
> > the config option ":ask_for_from: true"?
> 
> You may use the before-edit and reply-from hooks.  Here are scrubbed 
> versions of mine:
> 
> before-edit.rb:
> if header["To"] =~ /megacorp|ultramegacorp|alternacorp|minicorp|othercorp/
>   header["From"] = "me <me@ultramegacorp.com>"
> elsif header["To"] =~ /somelist|alternalist|otherlist/
>   header["From"] = "me <me@nerdylistemail.org>"
> end
> header["Bcc"] = header["From"]
> 
> reply-from.rb:
> val = case [message.recipient_email, message.to, message.cc, message.from].flatten.to_s
>       when /megacorp|ultramegacorp|alternacorp|minicorp|othercorp/ then "me <me@ultramegacorp.com>"
>       when /personal.org/ then "me <me@personal.org>"
>       when /nerdylistemail.org|somelist|alternalist|otherlist/ then "me <me@nerdylistemail.org>"
>       when /newemail/ then "me <me@newemail.com>"
>       when /oldemail/ then "me <me@newemail.com>"
>       end
> Person.from_address val
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [sup-talk] choosing signatures
  2010-06-10 15:52       ` Gregor Hoffleit
@ 2010-06-10 16:01         ` Eric Sherman
  2010-06-10 16:08           ` Gregor Hoffleit
  0 siblings, 1 reply; 10+ messages in thread
From: Eric Sherman @ 2010-06-10 16:01 UTC (permalink / raw)
  To: Gregor Hoffleit; +Cc: sup-talk

Excerpts from Gregor Hoffleit's message of Thu Jun 10 11:52:25 -0400 2010:
> Eric,
> 
> at first, that looks like a duplication of code. Could you elaborate why
> you use both of these hooks?
> 
>     Gregor

Yes.  The reply-from hook only triggers when replying, whereas the 
before-edit hook triggers also when composing a new email.

In this way I can ensure that for instance when I start a new thread to 
recipients at my workplace or its vendors, the correct non-default From 
address (and thusly the correct non-default sup account and signature and 
so on) is selected.
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [sup-talk] choosing signatures
  2010-06-10 16:01         ` Eric Sherman
@ 2010-06-10 16:08           ` Gregor Hoffleit
  2010-06-10 17:02             ` Eric Sherman
  0 siblings, 1 reply; 10+ messages in thread
From: Gregor Hoffleit @ 2010-06-10 16:08 UTC (permalink / raw)
  To: Eric Sherman; +Cc: sup-talk

* Eric Sherman <hyperbolist@gmail.com> [Do Jun 10 18:01:15 +0200 2010]
> Excerpts from Gregor Hoffleit's message of Thu Jun 10 11:52:25 -0400 2010:
> > at first, that looks like a duplication of code. Could you elaborate why
> > you use both of these hooks?
> 
> Yes.  The reply-from hook only triggers when replying, whereas the 
> before-edit hook triggers also when composing a new email.

Wouldn't the before-edit hook work for replying, as well?

    Gregor


> In this way I can ensure that for instance when I start a new thread to 
> recipients at my workplace or its vendors, the correct non-default From 
> address (and thusly the correct non-default sup account and signature and 
> so on) is selected.
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [sup-talk] choosing signatures
  2010-06-10 16:08           ` Gregor Hoffleit
@ 2010-06-10 17:02             ` Eric Sherman
  2010-06-14  9:46               ` Gregor Hoffleit
  0 siblings, 1 reply; 10+ messages in thread
From: Eric Sherman @ 2010-06-10 17:02 UTC (permalink / raw)
  To: Gregor Hoffleit; +Cc: sup-talk

Excerpts from Gregor Hoffleit's message of Thu Jun 10 12:08:34 -0400 2010:
> Wouldn't the before-edit hook work for replying, as well?

I imagine so, and peeking quickly at reply-mode.rb seems to confirm this.  
I probably wrote these way back when starting to use sup when I assumed 
that before-edit only fired on new emails and reply-from only fired on 
replies.  The next time I need to change their behavior I'll probably 
DRY-ify my hooks.  Thanks for pointing this out.
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [sup-talk] choosing signatures
  2010-06-10 17:02             ` Eric Sherman
@ 2010-06-14  9:46               ` Gregor Hoffleit
  0 siblings, 0 replies; 10+ messages in thread
From: Gregor Hoffleit @ 2010-06-14  9:46 UTC (permalink / raw)
  To: Eric Sherman; +Cc: sup-talk

* Eric Sherman <hyperbolist@gmail.com> [Do Jun 10 19:02:45 +0200 2010]
> Excerpts from Gregor Hoffleit's message of Thu Jun 10 12:08:34 -0400 2010:
> > Wouldn't the before-edit hook work for replying, as well?
> 
> I imagine so, and peeking quickly at reply-mode.rb seems to confirm this.  
> I probably wrote these way back when starting to use sup when I assumed 
> that before-edit only fired on new emails and reply-from only fired on 
> replies.  The next time I need to change their behavior I'll probably 
> DRY-ify my hooks.  Thanks for pointing this out.

Short update: When I tried your code, I couldn't get before-edit work as
expected. Appearently, the before-edit hook is called multiple times in
reply-mode, with varying headers, which broke my naive transformations:
Subsequent calls reverted/overwrote changes made in earlier calls.

I haven't looked in depth at this, though.

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-06-14  9:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-06 19:00 [sup-talk] choosing signatures Daniel Goldin
2010-06-07  4:36 ` Richard Heycock
2010-06-08  5:16   ` Daniel Goldin
2010-06-08 11:57     ` Eric Sherman
2010-06-08 16:57       ` Daniel Goldin
2010-06-10 15:52       ` Gregor Hoffleit
2010-06-10 16:01         ` Eric Sherman
2010-06-10 16:08           ` Gregor Hoffleit
2010-06-10 17:02             ` Eric Sherman
2010-06-14  9:46               ` Gregor Hoffleit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox