<<< Date Index >>>     <<< Thread Index >>>

Re: Advanced alternates regexp



David --

...and then David Rock said...
% 
% * David T-G <davidtg-muttusers@xxxxxxxxxxxxxxx> [2003-09-07 13:54]:
% > 
% > ...and then David Rock said...
% > % 
...
% > % Well, you are already messing with the MTA to add the addresses, whether
% > 
% > No, that's what I don't want to do.  My only config is in my .qmail files
% > and my .muttrc file.
% 
% I didn't really pick up on your using qmail. I don't, so I don't have

No biggie; it should be transparent.


% any experience with the config files, but the little reading I've done
% gives me a little better understanding of the problem. Let me see if I

Always a good thing.


% have this right:
% 
% username on the box is davidtg
% series of .qmail files related to this id:
%       ~davidtg/.qmail-davidtg-muttusers
%       ~davidtg/.qmail-davidtg-foo
%       ~davidtg/.qmail-davidtg-bar
%       etc...

Basically (you leave out the davidtg- since it's in my home dir and picks
up the davidtg that way).  You've missed a very important file, though,
as well as an additional wrinkle.  Read on.


% 
% When you said "on the fly", I didn't realize qmail has USER defined
% files for transport directives. If this is how it works, then the

Yeah.


% problem is actually simpler than I thought. Just create a script to walk
% the directory for .qmail-extension and build the alternates dynamically 
% from that.

That's a start, but it is not sufficiently encompassing.


% 
% Brute force (and easiest to write) for the example above would end up
% looking like this:
%       set alternates="(david-tg-muttusers|davidtg-foo|davidtg-bar)@domain"

Sure.


% slightly more fancy (but more work)
%       set alternates="david-tg-(muttusers|foo|bar)@domain"

I like this, and it's slick, but it still lacks two things:

1) There's a .qmail-default file (actually at any dash level) which takes
care of addresses not specifically defined otherwise

2) I might have my bigfoot mail handled by .qmail-bigfoot when it gets
forwarded here but that doesn't mean that "davidtg-bigfoot@xxxxxxxxxx"
should appear in my alternates list.

You might argue that I could manually list all off-site email addresses
and then add to them with the walking capability of this script, and I'd
agree that that would be a very good capability to include, but it doesn't
take care of the case where I have an account on another machine where I
*also* define many addresses (davidtg+this+and+that@xxxxxxxxxx or such)
but, amongst other things, cannot walk the .qmail tree or its equivalent.
[Oh, and I don't know how sendmail, exim, postfix do their alias handling,
but if you can write it for qmail, which can use dash or plus or any char(s)
you want, then you can write it for those as well.]

So I still don't see how this algorithm can be quite smart enough.


% 
% so the .muttrc would look something like this:
%       set alternates=`altscript.sh`

Ah, how lovely that would be...  Keep at it!


% 
% I would expect that you could even re-source .muttrc if you added a new
% address. Although that is probably a bit too "on the fly" even for you
% ;-)

Rather than that, I'd just have a comma macro to reload the alternates
just like I do the aliases :-)


% 
% > HAND to you, too :-)
% 
% Thanks.


HTH & HAND

:-D
-- 
David T-G                      * There is too much animal courage in 
(play) davidtg@xxxxxxxxxxxxxxx * society and not sufficient moral courage.
(work) davidtgwork@xxxxxxxxxxxxxxx  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/      Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

Attachment: pgprCCe9vxECy.pgp
Description: PGP signature