-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
179 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
--- | ||
layout: doc | ||
title: Execute Scripts | ||
dovecotlinks: | ||
execute_scripts: Execute Scripts | ||
execute_unix: | ||
hash: execute-unix | ||
text: "execute: UNIX Sockets" | ||
execute_tcp: | ||
hash: execute-tcp | ||
text: "execute: TCP Sockets" | ||
execute_fork: | ||
hash: execute-fork | ||
text: "execute: Fork and Execute" | ||
--- | ||
|
||
# Execute Scripts | ||
|
||
Some features, e.g. [[link,welcome]] execute an external script. | ||
This is configured with the [[setting,execute]] settings. Currently only | ||
a single script execution at a time is supported. | ||
|
||
Supported script execution drivers are: | ||
|
||
| Name | Description | | ||
| --- | --- | | ||
| [[link,execute_unix,unix]] | Connect to UNIX socket. | | ||
| [[link,execute_tcp,tcp]] | Connect to TCP socket. | | ||
| [[link,execute_fork,fork]] | Fork and execute the script directly. | | ||
|
||
## UNIX Sockets | ||
|
||
Execute the script via a script service listening on a UNIX socket. The service | ||
must execute the `script` binary to provide the proper communication API. | ||
|
||
Example: | ||
|
||
```[dovecot.conf] | ||
execute test-script { | ||
#driver = unix # default | ||
args = hello %{user} | ||
} | ||
service test-script-service { | ||
execute = script /usr/local/bin/test-script.sh one | ||
unix_listener test-script { | ||
path = 0666 | ||
} | ||
} | ||
``` | ||
|
||
The `test-script.sh` is executed with parameters `one hello <username>`. | ||
|
||
## TCP sockets | ||
|
||
Execute the script via a script service listening on a TCP socket. The service | ||
must execute the `script` binary to provide the proper communication API. | ||
|
||
Example: | ||
|
||
```[dovecot.conf] | ||
execute localhost:12345 { | ||
driver = tcp # default | ||
args = hello %{user} | ||
} | ||
service test-script-service { | ||
execute = script /usr/local/bin/test-script.sh one | ||
inet_listener { | ||
port = 12345 | ||
} | ||
} | ||
``` | ||
|
||
The `test-script.sh` is executed with parameters `one hello <username>`. | ||
|
||
## Fork and Execute | ||
|
||
Fork the process and execute the script directly. | ||
|
||
Example: | ||
|
||
```[dovecot.conf] | ||
execute /usr/local/bin/test-script.sh { | ||
driver = fork | ||
args = hello %{user} | ||
} | ||
``` | ||
|
||
The `test-script.sh` is executed with parameters `hello <username>`. | ||
|
||
## Execute Settings | ||
|
||
<SettingsComponent tag="execute" /> |