I'm using the postlogin service, following the examples in the wiki. But I can't find any documentation on the behavior (what's allowed/not allowed) of the script-login binary. So, some questions:
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?
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?
Question 3:
I'd like to be able to pass some information to the post-login.sh script, such as the service (%s), as a positional parameter.
For example: executable = script-login /path/post-login.sh %Ls
Or even more explicitly: executable = script-login /path/post-login.sh imap
But it appears that the script-login binary is expecting only script names to be passed to it so that it can handle more than one script. Is there a way to pass arguments to the different scripts?
Thanks,
Michael
No response seen yet. Trying again.
Surely someone knows how the postlogin scripts work and can answer these questions easily... Anyone?
Thanks, Michael
-----Original Message----- From: dovecot [mailto:dovecot-bounces@dovecot.org] On Behalf Of Michael Fox Sent: Sunday, December 11, 2016 8:48 AM To: Dovecot Mailing List dovecot@dovecot.org Subject: postlogin script
I'm using the postlogin service, following the examples in the wiki. But I can't find any documentation on the behavior (what's allowed/not allowed) of the script-login binary. So, some questions:
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?
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?
Question 3:
I'd like to be able to pass some information to the post-login.sh script, such as the service (%s), as a positional parameter.
For example: executable = script-login /path/post-login.sh %Ls
Or even more explicitly: executable = script-login /path/post-login.sh imap
But it appears that the script-login binary is expecting only script names to be passed to it so that it can handle more than one script. Is there a way to pass arguments to the different scripts?
Thanks,
Michael
On 14.12.2016 05:58, Michael Fox wrote:
No response seen yet. Trying again.
Surely someone knows how the postlogin scripts work and can answer these questions easily... Anyone?
Thanks, Michael
-----Original Message----- From: dovecot [mailto:dovecot-bounces@dovecot.org] On Behalf Of Michael Fox Sent: Sunday, December 11, 2016 8:48 AM To: Dovecot Mailing List dovecot@dovecot.org Subject: postlogin script
I'm using the postlogin service, following the examples in the wiki. But I can't find any documentation on the behavior (what's allowed/not allowed) of the script-login binary. So, some questions:
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?
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?
Question 3:
I'd like to be able to pass some information to the post-login.sh script, such as the service (%s), as a positional parameter.
For example: executable = script-login /path/post-login.sh %Ls
Or even more explicitly: executable = script-login /path/post-login.sh imap
But it appears that the script-login binary is expecting only script names to be passed to it so that it can handle more than one script. Is there a way to pass arguments to the different scripts?
Thanks,
Michael
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
participants (2)
-
Aki Tuomi
-
Michael Fox