FW: postlogin script

Aki Tuomi aki.tuomi at dovecot.fi
Thu Dec 15 06:52:15 UTC 2016


Also, if you look at the examples at
http://wiki.dovecot.org/PostLoginScripting you can see how it's used and
how to call multiple scripts as well.

Aki

On 15.12.2016 08:49, Aki Tuomi wrote:
>
> On 15.12.2016 05:54, Michael Fox wrote:
>>> Hi!
>>>
>>> You need to use executable = script-login -- /path/post-login.sh -a -r -g
>> -s
>>> note the double-dash. it tells getopt to stop processing arguments.
>>>
>>> Aki
>> Thanks Aki.  So that let's me call a single script with arguments.  Great.
>> What if there is more than one script?  I'm unable to guess what the
>> complete syntax would be for calling more than one script, some of which may
>> have their own arguments.
> Please keep responses in the list. Maybe you could, I don't know, call
> multiple scripts in your script?
>
>> Also, can you help with my other two questions (below):
>>
>>> Question 1:
>>>
>>> The examples show the following at the end of the post-login.sh script:
>>> exec "$@"
>>>
>>> My understanding is that this would exec each of the command line arguments
>>> to the post-login.sh script.  But, there are no arguments sent to the
>>> post-login.sh script in the examples.  So what is this line supposed to do?
> It will execute something dovecot wants in order to import the env
> variables set in your question 2.
>
>>>
>>> Question 2:
>>>
>>> One of the examples shows exporting some environmental variables, followed
>>> by the above exec line:
>>>
>>>     export MAIL=maildir:/tmp/test
>>>
>>>     export USERDB_KEYS="$USERDB_KEYS mail"
>>>
>>>     exec "$@"
>>>
>>> Now, I'm really confused.  Can someone explain step-by-step why this does
>>> anything at all?
>> Michael
> Aki



More information about the dovecot mailing list