[Dovecot] Automatic Index Generation

Benjamin R. Haskell dovecot at benizi.com
Sun Dec 9 21:30:18 EET 2007


On Sun, 9 Dec 2007, Timo Sirainen wrote:
> On Sun, 2007-12-09 at 13:48 -0500, Benjamin R. Haskell wrote:
>>>> vmu1 at test:~$ echo "quit" | /usr/lib/dovecot/pop3
>>>> pop3(vmu1): Fatal: pop3_uidl_format setting is missing from config file
>>>>
>>>> I have pop3_uidl_format correctly defined in the config file. I've also
>>>> tried to strace pop3, to find where it does look for it, but with no
>>>> success.
>>>
>>> It gets it from environment:
>>>
>>> POP3_UIDL_FORMAT=... pop3
>>>
>>> In general all settings are passed in environment using uppercased
>>> names.
>>
>> In other words, you (Maciej) probably don't want to run 'pop3' directly. I
>> suspect you'd rather do:
>>
>> /path/to/dovecot --exec-mail pop3
>>
>> This will set up the environment for the 'pop3' executable the same way
>> dovecot normally does it.
>
> Yes, I was going to mention that but I wasn't sure how well it'd work
> when you want to run it for multiple users. At least you can't then
> override MAIL environment directly, but rather you need to override USER
> and/or HOME.
>

Maybe it'd be easiest with 'su'? Something along the lines of:

su username -l -c /path/to/dovecot --exec-mail pop3

(Though this doesn't seem to be working for me. I've reïnstalled dovecot 
too many times. Something's up with permissions.)


Another way that might be relatively easy:

Set up, in dovecot.conf:

protocol pop3 { # in this section
mail_executable = /path/to/envscript.sh

And, in /path/to/envscript.sh:

#!/bin/sh
env > /path/to/saved-environment
exec /path/to/pop3

That'll give you all the environment variables dovecot would normally set 
up. Then you could filter out the user-specific ones to set up manually, 
and use e.g. envdir (from DJB's daemontools) to handle the common ones:

$ mkdir common-env
$ perl -F= -lanwe 'my $var = shift; open my $f, ">common-env/$var" or die ">$var: $!"; print $f join "=", @F' /path/to/saved-environment

Then:

env USER=blah HOME=blah MAIL=blah envdir /path/to/common-env /usr/libexec/dovecot/pop3

Best,
Ben


More information about the dovecot mailing list