[tpop3d-discuss] Selective maildir usage

Chris Lightfoot chris at ex-parrot.com
Fri, 11 Oct 2002 20:47:14 +0100


On Thu, Sep 26, 2002 at 01:50:37PM +0100, John P Connor wrote:
> One of our customers wants us to do something rather odd, but I believe that
> Energis have modified qmail's POP3 server to do the same. We are munging
> mail sent to anyone@company.domain to company@domain and delivering it to
> one maildir. What the users want to do is this: if they POP in as
> anyone@company.domain, they just get the mail for that single address. If
> they POP in as company@domain, they get all the mail.
> 
> I was going to arrange for the prefix of the mail files to be the user's
> address. It would then be a fairly simple matter to attempt to identify the
> appropriate mails, if this behaviour was required. I was intending to
> control this by an extra field in the auth packet.

Ooh, that's *horrible*. Though I can see it would be
useful.

> Question is, Chris: does this sound like something which could be included
> in the main distro once implemented & tested, cos I don't fancy having to
> make these changes every time a new release comes out, or am I on my own?

Hmm. I'd be a bit reluctant to include it, but I don't
think that the interface to the mailbox-reading code is
likely to change much in later versions. Unfortunately you
will also need to make modifications to the authentication
stuff to make the information about the logged-in username
available to the maildir reader. It's not a modification
which fits neatly into the tpop3d structure, sadly. The
simplest approach would probably be to pass the username
information as a suffix to the maildir name, then parse
that. Not very pleasant.

-- 
... You know you'll never walk alone 'cause you can't control your legs...
  (`Swallow Everything', The Mr. T Experience)