Subject: [sup-talk] Multiple email accounts

From: [email-masked] (Edward Z. Yang)
Date: Sat, 23 May 2009 19:32:32 -0400

Hello all,

Does Sup have any built-in support for multiple sending email accounts, i.e.
using the source to determine what the "From" header should be, and swapping
SMTP servers accordingly?

Cheers,
Edward

---

From: [email-masked] (Iain)
Date: Sun, 24 May 2009 00:57:36 +0100

> SMTP servers accordingly?

Yes. See
<http://sup.rubyforge.org/wiki/wiki.pl?MultipleAccountsAndReply> and
<http://sup.rubyforge.org/wiki/wiki.pl?Msmtp>.

Cheers,
~Iain

---

From: [email-masked] (Edward Z. Yang)
Date: Mon, 25 May 2009 14:18:51 -0400

> <http://sup.rubyforge.org/wiki/wiki.pl?Msmtp>.

Great, that's 99% of what I need. The last 1% is, can Sup auto-detect
what From line to send based on the source of the message, if the
To: header is not intact? (This is commonly the case for mailing lists.

Cheers,
Edward

---

From: [email-masked] (William Morgan)
Date: Wed, 27 May 2009 09:22:54 -0700

Reformatted excerpts from Edward Z. Yang's message of 2009-05-25:
> what From line to send based on the source of the message, if the To:
> header is not intact? (This is commonly the case for mailing lists.

You can use the reply-from hook to set it automatically however you
want. Try adding something like the following (completely untested!) to
~/.sup/hooks/reply-from.rb:

  case message.from.email
  when /sup-talk at rubyforge.org/i
    Person.from_address "Edward Z. Yang <ezy+i-love-sup at mit.edu>"
  end

If the hook returns nil, Sup does the default computation.
-- 
William <wmorgan-sup at masanjin.net>

---

From: [email-masked] (Marcus Williams)
Date: Wed, 27 May 2009 19:51:06 +0100

> ~/.sup/hooks/reply-from.rb:
[snip]

Note also that you might be able to do what you want with the regexen
options in config.yaml - so for instance Sup works out that I reply to
the sup talk mail list with marcus-sup at .... It uses the envelope-to
header to figure this out I seem to remember (coupled with the regexen
settings).

So under one of my accounts I have:

 :regexen:
   - marcus-.*(at)mydomain.com

(where (at) is replaced with @, and mydomain.com is replaced with the
obvious).

This make sup recognise all incoming emails to my email extensions
that all begin with "marcus-" and unlike the :alternative: settings
are used by sup to figure out what address to reply with. Works well
for all the mailing lists I'm using.

The only problem is they dont get used for sending new addresses (but
I recently sent an email about how I get around that).

HTH

Marcus