On 1/31/2011 8:06 PM, Victor Duchovni wrote:
On Mon, Jan 31, 2011 at 07:58:30PM -0500, Daniel Bromberg wrote:
I'm puzzling over the various discussions on using Courier's maildrop as
the local agent with Postfix. It plays well enough, but not...great. First
its error messages are less than precise but you can get used to what they
mean after a while. (I need it for SpamAssassin auto-directory-sorting.)
E-Mail Account provisioning for a virtual user requires a variety of
steps to be taken, to create authentication records, mail-store location
records, ... One of those steps should be the creation of the mailstore
directory. If you create the directory when you create the account, you
don't run into hassles trying to create on the fly.
Good point.
The virtual users are created with Horde/PHP, so it's awkward and feels
wrong to have PHP call a shell script to create mail directories whenever a
new user is created through the Horde admin page. I feel like Horde should
live entirely in MySQL and only needs to communicate with mail via its
built-in IMAP client.
Provisioning the email directory can be an IPC request to a directory
provisioning service, ideally the IMAP server supports an operation
to create the store for a user whose meta-data is present in the database.
You know, as I rethought my last sentence just after sending, I was
fuzzily starting to conclude that. It seems that Dovecot creates the
minimum full structure upon login (it consults the same MySQL DB for
credentials of course so that part is not a problem). Hence the Horde
script should proxy as the first-time user connection with a simple
imap_open() and imap_close(). Then with future spam arrival, maildrop
is dynamic enough to handle this case directly in the rc file:
if ( /^X-Spam-Status: Yes/ )
{
`test -d $HOME/Maildir/.Junk\ E-mail`
if ( $RETURNCODE != 0 )
{
`logger -i -p mail.info "maildroprc: creating .Junk E-mail in
$HOME"`
`maildirmake $HOME/Maildir/.Junk\ E-mail`
`echo "Junk E-mail" >> $HOME/Maildir/subscriptions`
`chown vmail:mail $HOME/Maildir/subscriptions`
`chmod 700 $HOME/Maildir/subscriptions`
}
to "Maildir/.Junk E-mail"
}
Daniel