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

Re: Advanced alternates regexp



* David T-G <davidtg-muttusers@xxxxxxxxxxxxxxx> [2003-09-08 06:19]:
> ...and then David Rock said...
> 
> % 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.

OK, so the files in this example would be:
        ~davidtg/.qmail-muttusers
        ~davidtg/.qmail-foo
        ~davidtg/.qmail-bar
        ~davidtg/.qmail-list-baz
        ~davidtg/.qmail-list-zoo
        etc...
and would also likely include:
        ~davidtg/.qmail-default
        ~davidtg/.qmail-list-default
        etc...

> % 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.

I see that now. dang.

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

So you could set a reply-to header with an address that doesn't actuall
exist, and as long as it gets caught by a default, it will still work:
(i.e. davidtg-list-extra gets caught by ~davidtg/.qmail-list-default)

I have to admit, that's kind of cool, if not really annoying for this.
Hmm, I wonder if defaults could be picked up by a regex:
 set alternates="(davidtg|davidtg-(muttusers|foo|bar|list-[a-zA-Z0-9]+))@domain"
and so on....

I just thought of this. If the above works, then why not just use
something that matches EVERYTHING after davidtg:
        set alternates="(davidtg|davidtg-[a-zA-Z0-9-]+)@domain"

generic, and probably has a few cases that don't match, but an
interesting possiblity.

> 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 would probably have to maintain a list of excluded addresses to do
this (which would be tough with the above "catch everything" example).

> 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.

OK, now this is getting rediculous. keeping track of addresses that the
system can't even access? Throw me a bone, would ya? ;-)

> [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.]

Most of these aren't set up to work this way. I don't think any of them
have user-controlled aliases. sendmail and postfix use an alias file in
/etc/mail with one for one references:
        address :       destination

postfix also has a virtual table and relocation table that can do more
ornate redirection, but it's still an admin-based table.

-- 
David Rock
david@xxxxxxxxxxxxxx

Attachment: pgpov1sxVUdKs.pgp
Description: PGP signature