procmail
[Top] [All Lists]

Re: hashed MAILDIR with procmail filter mode

1999-08-10 19:05:33
"Juergen Georgi" <georgi(_at_)belwue(_dot_)de> writes:
...
Thanks for the recipe. I wanted it in C, so I followed your advice
and modified authenticate.c to lookup the user from a Berkeley DB
password database. In case the user is found, a getpwnam(virtualuser)
call is done, where 'virtualuser' is the owner of the password database
and the mailspool directory. Before the passwd structure is returned,
pw->pw_name is set to the looked-up username. This way procmail
is happy and can even process the virtualuser's $HOME/.procmailrc.

A large part of the code was taken from the cucipop source (including 
sdb.h). In order to support cucipop's concept of 'virtual host system 
mailboxes', the virtual host name can be passed with the '-a argument' 
mechanism. Calling 'procmail -a virtual.dom.ain -d foobar' will lookup
virtual.dom.ain/foobar in the password database and delivers to 
'/var/pop/virtual.dom.ain/f/o/foobar'. Just calling 'procmail -d foobar'
will lookup 'foobar' and delivers to '/var/pop/f/o/foobar'.
Note: standard cucipop looks for '/var/pop/v/i/virtual.dom.ain/foobar'
when compiled with MAILSPOOLHASH 2 and VIRTUALSERVER. I didn't like
this, so I modified cucipop's auth_mailboxname() to accomodate hashing 
on the username level.

I don't have the time right now to review your code, but I will make
one suggestion on your design: instead of overloading the -a flag, I
think you should use a separate flag, to pass that information into
procmail.  How about -D for domain?


Philip Guenther

<Prev in Thread] Current Thread [Next in Thread>
  • Re: hashed MAILDIR with procmail filter mode, Philip Guenther <=