Excerpts from Jim Cheetham's message of Wed Jul 01 22:30:25 -0400 2009:
> On Thu, Jul 2, 2009 at 7:39 AM, Ben Walton<[email protected]> wrote:
> > Excerpts from Jim Cheetham's message of Wed Jul 01 05:48:30 -0400 2009:
> >> I'd like to be able to save outgoing email into the mailstore for the
> >> matching account; can anyone suggest some way to do this? Hacking code
> >> is an option, although I'd appreciate some pointers ...
> >
> > This is an interesting idea.  I think the best way to do it might be
> > to implement a sent_source hook that can override the global default.
>
> 'best' or 'simplest'?

Both?

> There already exists logic for determining which account a given
> outgoing message belongs to, because that's how the :sendmail:
> target is being used.
>
> If you are arguing that having a different sent_source per (outgoing)
> message is useful, then perhaps a hook makes sense; but the simpler
> case probably doesn't need it.

I'm not arguing anything, and perhaps using sent_source as the
(hypothetical) hook name was a bad choice...

If I'm understanding you correctly, you want to write to a different
source depending on which address is used in the From.  You'd either
need to make a separate config entry in each account that gets setup
(similar to the sendmail that you note) or provide the ability for the
user to select the sent box in some other way.

In the 'simpler' case where the decision is made based on account
used, you've got a chunk of static code making the choice and
defaulting as it would now.  The hook would simply take the place of
the static decision maker.  The decision has to be made per message
regardless of how it's implemented, so doing it in a hook is a better
option, imo.  The Hook route would be slightly slower, since there are
extra activation records on the stack for the function calls, but it
should be negligible.

The other advantage to a Hook is that the decision could be made based
on more than simply the From:.  Maybe other users would prefer to
store mail based on who it was sent To...or a combo of From/To?

I'm interested in William's thoughts on this.  It's not a feature I'd
use, but I do think it's a good feature to have.

I hope this explains my thinking more clearly.

-Ben
-- 
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302

GPG Key Id: 8E89F6D2; Key Server: pgp.mit.edu
Contact me to arrange for a CAcert assurance meeting.

Attachment: signature.asc
Description: PGP signature

_______________________________________________
sup-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/sup-talk

Reply via email to