Mike Lemoine writes:

Anand Buddhdev wrote:

On Thu, Jan 30, 2003 at 02:52:17PM -0800, Mike Lemoine wrote:


I'd like to have mail delivered to a spot other than a user's home directory...

At the moment I've got sendmail using maildrop as the local delivery agent, and using a global maildroprc which looks like:

import SENDER
DEFAULT="/mail/$LOGNAME"

I've got it delivering to where i want it... (Can happily cat files under 'new' and verify that they are what I think they are) The problem is that imapd isn't reading from there.. It's trying to read from $HOME/Maildir... In my courierd config file, I've got:

DEFAULTDELIVERY="/mail/$LOGNAME/"
MAILDROPDEFAULT="/mail/$LOGNAME/"

But no such luck...

I have done a 'maildirmake /mail/sven' to create the above maildir... (as evidenced by the fact that maildrop is delivering there...)

The imap server by default looks at $HOME/Maildir. To make it look at
some other location, you have to edit the imapd startup script (usually
/usr/lib/courier/sbin/imapd) and look for the couriertcpd line, which
actually starts the imap daemon per connection. At the end of the line,
you will see something like "/usr/lib/courier/bin/imapd Maildir" which
tells the imap daemon to look for Maildir in the current directory (which
is usually the user's home directory). Change the Maildir to something
like "/mail/$AUTHENTICATED/Maildir", where the $AUTHENTICATED variable
contains the logged-in username. Then restart the imap service. This is
not documented, because most people do not do what you have done. Most
people would use userdb, LDAP or SQL tables to set the location of
the Maildir.

I'm at a bit of a loss, here... I can't see how to get the name of the user that will have/has authenticated into the command that starts the process that calls for his authentication...

I've tried using $LOGNAME, which (of course) fails, becuase the user is root at the time the shell variable is interprolated... I've tried escaping it out so that it gets interpreted later, but it doesn't, it ends up as the literal string /mail/$LOGNAME (or $USER, etc..)
Perhaps the solution is obvious, but I'm missing it...
The only way to do this is to hack the imapd startup script. The startup command ends with:

[ ... ]

/usr/lib/courier/bin/imapd Maildir"

[ .... ]

Create a shell script:

#!/bin/sh

exec /usr/lib/courier/bin/imapd /var/mail/`whoami`


You might have to experiment there, perhaps using /var/mail/$AUTHENTICATED instead.

Then modify the startup script to run your shell script, instead of imapd.

This does, of course, impose the overhead of starting an entire /bin/sh for each login, but with multi-gigahertz CPUs that may not be much at all.




-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to