* [sup-talk] Email extensions/alternate emails
@ 2007-11-30 12:05 Marcus Williams
2007-12-08 22:00 ` William Morgan
0 siblings, 1 reply; 12+ messages in thread
From: Marcus Williams @ 2007-11-30 12:05 UTC (permalink / raw)
Hi -
I've never quite figured out why I'd add alternate emails to my
config/accounts. Last time I used them it appeared that emails coming
into an alternate address used the default email address on that
account to reply with - is this still the case?
I ask because I'm trying to implement support for email extensions
basically an email address like name-someotherid at domain.tld where
-someotherid is the extension. I added an "extensions" config option
that allowed me to add regexes for my extensions. I then extended
account_for to return the correct account given an email that matched
one of these extensions.
But... what I really wanted sup to do then was what I expected it to
do with alternates, is to reply to an email that came in on one of
these extensions with the same email address, not with the account
email address.
What else do I need to do? Is it just a matter of extending the reply
mode code? To do this should I have to create a dummy account/person
object for the extension address to be able to use it (this seems to
be the case)? Is there a better way to handle extensions?
Thanks
Marcus
^ permalink raw reply [flat|nested] 12+ messages in thread
* [sup-talk] Email extensions/alternate emails
2007-11-30 12:05 [sup-talk] Email extensions/alternate emails Marcus Williams
@ 2007-12-08 22:00 ` William Morgan
2007-12-09 21:18 ` Marcus Williams
0 siblings, 1 reply; 12+ messages in thread
From: William Morgan @ 2007-12-08 22:00 UTC (permalink / raw)
Hi Marcus,
Great questions and sorry for the delay in replying.
Excerpts from Marcus Williams's message of Fri Nov 30 04:05:27 -0800 2007:
> I've never quite figured out why I'd add alternate emails to my
> config/accounts. Last time I used them it appeared that emails coming
> into an alternate address used the default email address on that
> account to reply with - is this still the case?
I believe it was this way for a while, but only because of a bug. The
current behavior (reply-mode.rb circa line 144) is a sequence of three
steps:
1. First, if the message contains an Envelope-To, X-Original-To, or
Delivered-To header (in that order of precedence), the address
in that header is used.
2. If not, if any of the addresses in To: or Cc: are an "account
address", the DEFAULT address for that account is used.
3. Failing either of those options, the default address of the default
account is used.
Step #1 is the most important, and I think it should capture what you
describe below. But that particular selection and sequence of headers
was determinted empirically, by me, so it may need adjustment.
So the alternate emails on an account aren't directly useful for
replies, since they won't ever be used as a From: unless they happen to
have come in on a Delivered-To/Envelope-To/etc header, in which case the
fact that they're an alternate email is irrelevant.
But they are used to determine when a message is to or cc you (the ">"
and "+" widgets you see in thread-index-mode).
> I ask because I'm trying to implement support for email extensions
> basically an email address like name-someotherid at domain.tld where
> -someotherid is the extension. I added an "extensions" config option
> that allowed me to add regexes for my extensions. I then extended
> account_for to return the correct account given an email that matched
> one of these extensions.
An excellent idea. There actually was something like that in Sup
much earlier, but was the victim of a refactor at some point.
> But... what I really wanted sup to do then was what I expected it to
> do with alternates, is to reply to an email that came in on one of
> these extensions with the same email address, not with the account
> email address.
Does it not do this in recent SVN checkouts? If not, is there a header
like Delivered-To: in the incoming email that contains the address?
--
William <wmorgan-sup at masanjin.net>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [sup-talk] Email extensions/alternate emails
2007-12-08 22:00 ` William Morgan
@ 2007-12-09 21:18 ` Marcus Williams
2007-12-09 21:42 ` William Morgan
0 siblings, 1 reply; 12+ messages in thread
From: Marcus Williams @ 2007-12-09 21:18 UTC (permalink / raw)
On 8.12.2007, William Morgan wrote:
> 1. First, if the message contains an Envelope-To, X-Original-To, or
> Delivered-To header (in that order of precedence), the address
> in that header is used.
Ah. That might be all I needed to know. I'll make sure I'm getting one
of these headers and see if that makes the difference. That also
explains why some of my mail goes out from the wrong address even when
I have got an account set up for it.
Will update once I've played a bit more.
Marcus
^ permalink raw reply [flat|nested] 12+ messages in thread
* [sup-talk] Email extensions/alternate emails
2007-12-09 21:18 ` Marcus Williams
@ 2007-12-09 21:42 ` William Morgan
2007-12-10 15:28 ` Marcus Williams
0 siblings, 1 reply; 12+ messages in thread
From: William Morgan @ 2007-12-09 21:42 UTC (permalink / raw)
Excerpts from Marcus Williams's message of Sun Dec 09 13:18:34 -0800 2007:
> On 8.12.2007, William Morgan wrote:
> > 1. First, if the message contains an Envelope-To, X-Original-To, or
> > Delivered-To header (in that order of precedence), the address
> > in that header is used.
>
> Ah. That might be all I needed to know. I'll make sure I'm getting one
> of these headers and see if that makes the difference. That also
> explains why some of my mail goes out from the wrong address even when
> I have got an account set up for it.
Yeah, I don't think the current behavior is 100% correct, yet, so I'm
open to suggestions.
--
William <wmorgan-sup at masanjin.net>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [sup-talk] Email extensions/alternate emails
2007-12-09 21:42 ` William Morgan
@ 2007-12-10 15:28 ` Marcus Williams
2007-12-10 17:37 ` William Morgan
0 siblings, 1 reply; 12+ messages in thread
From: Marcus Williams @ 2007-12-10 15:28 UTC (permalink / raw)
On 9.12.2007, William Morgan wrote:
> Excerpts from Marcus Williams's message of Sun Dec 09 13:18:34 -0800 2007:
> > On 8.12.2007, William Morgan wrote:
> > > 1. First, if the message contains an Envelope-To, X-Original-To, or
> > > Delivered-To header (in that order of precedence), the address
> > > in that header is used.
> >
> > Ah. That might be all I needed to know. I'll make sure I'm getting one
> > of these headers and see if that makes the difference. That also
> > explains why some of my mail goes out from the wrong address even when
> > I have got an account set up for it.
>
> Yeah, I don't think the current behavior is 100% correct, yet, so I'm
> open to suggestions.
I added an envelope-to header but that hasnt changed its current
behaviour. Where in the code does this checking (or is it via
RubyMail)? Have searched code for envelope-to and have only found
mention of it in mbox.rb
If I can figure out why its going wrong I'll have a go at fixing it
even if its just for my case (which will mean for qmail+vpopmail).
Marcus
^ permalink raw reply [flat|nested] 12+ messages in thread
* [sup-talk] Email extensions/alternate emails
2007-12-10 15:28 ` Marcus Williams
@ 2007-12-10 17:37 ` William Morgan
2007-12-10 22:28 ` Marcus Williams
0 siblings, 1 reply; 12+ messages in thread
From: William Morgan @ 2007-12-10 17:37 UTC (permalink / raw)
Excerpts from Marcus Williams's message of Mon Dec 10 07:28:23 -0800 2007:
> I added an envelope-to header but that hasnt changed its current
> behaviour. Where in the code does this checking (or is it via
> RubyMail)? Have searched code for envelope-to and have only found
> mention of it in mbox.rb
reply-mode.rb line 23, and message.rb line 112.
--
William <wmorgan-sup at masanjin.net>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [sup-talk] Email extensions/alternate emails
2007-12-10 17:37 ` William Morgan
@ 2007-12-10 22:28 ` Marcus Williams
2007-12-10 22:36 ` Marcus Williams
2008-01-06 19:46 ` William Morgan
0 siblings, 2 replies; 12+ messages in thread
From: Marcus Williams @ 2007-12-10 22:28 UTC (permalink / raw)
On 10.12.2007, William Morgan wrote:
> Excerpts from Marcus Williams's message of Mon Dec 10 07:28:23 -0800 2007:
> > I added an envelope-to header but that hasnt changed its current
> > behaviour. Where in the code does this checking (or is it via
> > RubyMail)? Have searched code for envelope-to and have only found
> > mention of it in mbox.rb
>
> reply-mode.rb line 23, and message.rb line 112.
Not sure how I missed that, but there we go. Attached is a patch to
allow for mail extensions via regexes. This adds a :extensions: option
to the config.yaml something like:
:extensions:
- marcus-sites-\*@domain.com
- marcus-lists-\*@domain.com
Which makes sup recognise addresses such as
marcus-sites-amazon at domain.com and marcus-lists-sup at domain.com as
account addresses.
Marcus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: extensions-diff
Type: application/octet-stream
Size: 1231 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/sup-talk/attachments/20071210/5ab6176d/attachment.obj
^ permalink raw reply [flat|nested] 12+ messages in thread
* [sup-talk] Email extensions/alternate emails
2007-12-10 22:28 ` Marcus Williams
@ 2007-12-10 22:36 ` Marcus Williams
2007-12-14 1:03 ` William Morgan
2008-01-06 19:46 ` William Morgan
1 sibling, 1 reply; 12+ messages in thread
From: Marcus Williams @ 2007-12-10 22:36 UTC (permalink / raw)
On 10.12.2007, Marcus Williams wrote:
> Which makes sup recognise addresses such as
> marcus-sites-amazon at domain.com and marcus-lists-sup at domain.com as
> account addresses.
... forgot to add - by adding the Envelope-To in my setup I get the
correct reply addresses elsewhere as well. My aliases/extensions are a
bit strange in that they dont create delivered-to/env-to/x-orig-to in
a way that is sensible (this is a bug in vpopmail in my view, but
other people disagree) - for now, /usr/bin/formail is my friend!.
Marcus
^ permalink raw reply [flat|nested] 12+ messages in thread
* [sup-talk] Email extensions/alternate emails
2007-12-10 22:36 ` Marcus Williams
@ 2007-12-14 1:03 ` William Morgan
2007-12-14 10:10 ` Marcus Williams
0 siblings, 1 reply; 12+ messages in thread
From: William Morgan @ 2007-12-14 1:03 UTC (permalink / raw)
Excerpts from Marcus Williams's message of Mon Dec 10 14:36:03 -0800 2007:
> ... forgot to add - by adding the Envelope-To in my setup I get the
> correct reply addresses elsewhere as well.
Just curious---what do you mean by adding Envelope-To to your setup? Did
you patch Sup to add this header, or is it added elsewhere in the
process?
--
William <wmorgan-sup at masanjin.net>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [sup-talk] Email extensions/alternate emails
2007-12-14 1:03 ` William Morgan
@ 2007-12-14 10:10 ` Marcus Williams
0 siblings, 0 replies; 12+ messages in thread
From: Marcus Williams @ 2007-12-14 10:10 UTC (permalink / raw)
On 14.12.2007, William Morgan wrote:
> Excerpts from Marcus Williams's message of Mon Dec 10 14:36:03 -0800 2007:
> > ... forgot to add - by adding the Envelope-To in my setup I get the
> > correct reply addresses elsewhere as well.
>
> Just curious---what do you mean by adding Envelope-To to your setup? Did
> you patch Sup to add this header, or is it added elsewhere in the
> process?
Added it at the MTA level on my server.
Marcus
^ permalink raw reply [flat|nested] 12+ messages in thread
* [sup-talk] Email extensions/alternate emails
2007-12-10 22:28 ` Marcus Williams
2007-12-10 22:36 ` Marcus Williams
@ 2008-01-06 19:46 ` William Morgan
2008-01-07 12:35 ` Marcus Williams
1 sibling, 1 reply; 12+ messages in thread
From: William Morgan @ 2008-01-06 19:46 UTC (permalink / raw)
Hi Marcus,
Excerpts from Marcus Williams's message of Mon Dec 10 14:28:18 -0800 2007:
> Not sure how I missed that, but there we go. Attached is a patch to
> allow for mail extensions via regexes. This adds a :extensions: option
> to the config.yaml something like:
>
> :extensions:
> - marcus-sites-\*@domain.com
> - marcus-lists-\*@domain.com
I've added your patch to git after a few tweaks. I renamed "extensions"
to "regexen" since really it does a full regex match against the entire
email address. Hope you don't mind. :) Try it and let me know if it
works for your current setup.
Thanks!
--
William <wmorgan-sup at masanjin.net>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [sup-talk] Email extensions/alternate emails
2008-01-06 19:46 ` William Morgan
@ 2008-01-07 12:35 ` Marcus Williams
0 siblings, 0 replies; 12+ messages in thread
From: Marcus Williams @ 2008-01-07 12:35 UTC (permalink / raw)
Excerpts from William Morgan's message of Sun Jan 06 19:46:44 +0000 2008:
> I've added your patch to git after a few tweaks. I renamed "extensions"
> to "regexen" since really it does a full regex match against the entire
> email address. Hope you don't mind. :) Try it and let me know if it
> works for your current setup.
Nice :) Works here anyway!
Marcus
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2008-01-07 12:35 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-30 12:05 [sup-talk] Email extensions/alternate emails Marcus Williams
2007-12-08 22:00 ` William Morgan
2007-12-09 21:18 ` Marcus Williams
2007-12-09 21:42 ` William Morgan
2007-12-10 15:28 ` Marcus Williams
2007-12-10 17:37 ` William Morgan
2007-12-10 22:28 ` Marcus Williams
2007-12-10 22:36 ` Marcus Williams
2007-12-14 1:03 ` William Morgan
2007-12-14 10:10 ` Marcus Williams
2008-01-06 19:46 ` William Morgan
2008-01-07 12:35 ` Marcus Williams
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox