Skip to content

Commit

Permalink
Add smtp_server and smtp_port as configuration variables (#22)
Browse files Browse the repository at this point in the history
* Add smtp_server and smtp_port as configuration variables

* Add a default value to smtp_server and smtp_port
Update Readme
  • Loading branch information
Christophe Cosnefroy authored Mar 8, 2020
1 parent 9419925 commit 4791374
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ You can configure this through the following environment variables when running

Note: An SQLite database is probably not recommended for production use, but is a quick and easy way to try out the software without dependencies.

You can also set the postfix host and port.

* POSTFIXADMIN\_SMTP\_SERVER=... - localhost per default
* POSTFIXADMIN\_SMTP\_PORT=... - 25 per default

### Example docker run

```bash
Expand All @@ -59,6 +64,8 @@ docker run -e POSTFIXADMIN_DB_TYPE=mysqli \
-e POSTFIXADMIN_DB_USER=user \
-e POSTFIXADMIN_DB_PASSWORD=topsecret \
-e POSTFIXADMIN_DB_NAME=postfixadmin \
-e POSTFIXADMIN_SMTP_SERVER=postfix \
-e POSTFIXADMIN_SMTP_PORT=25 \
--name postfixadmin \
-p 8080:80 \
postfixadmin-image
Expand Down Expand Up @@ -119,6 +126,8 @@ services:
POSTFIXADMIN_DB_USER: postfixadmin
POSTFIXADMIN_DB_NAME: postfixadmin
POSTFIXADMIN_DB_PASSWORD: postfixadminPassword
POSTFIXADMIN_SMTP_SERVER: postfix
POSTFIXADMIN_SMTP_PORT: 25

```

4 changes: 4 additions & 0 deletions apache/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ POSTFIXADMIN_DB_TYPE=${POSTFIXADMIN_DB_TYPE:=sqlite}
POSTFIXADMIN_DB_HOST=${POSTFIXADMIN_DB_HOST:=""}
POSTFIXADMIN_DB_USER=${POSTFIXADMIN_DB_USER:=""}
POSTFIXADMIN_DB_PASSWORD=${POSTFIXADMIN_DB_PASSWORD:=""}
POSTFIXADMIN_SMTP_SERVER=${POSTFIXADMIN_SMTP_SERVER:="localhost"}
POSTFIXADMIN_SMTP_PORT=${POSTFIXADMIN_SMTP_PORT:="25"}

# topsecret99
DEFAULT_SETUP_PASSWORD="791eb4ead7fd996c01bed30707ae27dd:b7910d09773104bf84c4f4951205d2198c7cfc4f"
Expand Down Expand Up @@ -72,6 +74,8 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
\$CONF['database_password'] = '${POSTFIXADMIN_DB_PASSWORD}';
\$CONF['database_name'] = '${POSTFIXADMIN_DB_NAME}';
\$CONF['setup_password'] = '${POSTFIXADMIN_SETUP_PASSWORD}';
\$CONF['smtp_server'] = '${POSTFIXADMIN_SMTP_SERVER}';
\$CONF['smtp_port'] = '${POSTFIXADMIN_SMTP_PORT}';
\$CONF['configured'] = true;
?>" | tee config.local.php
else
Expand Down
4 changes: 4 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ POSTFIXADMIN_DB_TYPE=${POSTFIXADMIN_DB_TYPE:=sqlite}
POSTFIXADMIN_DB_HOST=${POSTFIXADMIN_DB_HOST:=""}
POSTFIXADMIN_DB_USER=${POSTFIXADMIN_DB_USER:=""}
POSTFIXADMIN_DB_PASSWORD=${POSTFIXADMIN_DB_PASSWORD:=""}
POSTFIXADMIN_SMTP_SERVER=${POSTFIXADMIN_SMTP_SERVER:="localhost"}
POSTFIXADMIN_SMTP_PORT=${POSTFIXADMIN_SMTP_PORT:="25"}

# topsecret99
DEFAULT_SETUP_PASSWORD="791eb4ead7fd996c01bed30707ae27dd:b7910d09773104bf84c4f4951205d2198c7cfc4f"
Expand Down Expand Up @@ -72,6 +74,8 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
\$CONF['database_password'] = '${POSTFIXADMIN_DB_PASSWORD}';
\$CONF['database_name'] = '${POSTFIXADMIN_DB_NAME}';
\$CONF['setup_password'] = '${POSTFIXADMIN_SETUP_PASSWORD}';
\$CONF['smtp_server'] = '${POSTFIXADMIN_SMTP_SERVER}';
\$CONF['smtp_port'] = '${POSTFIXADMIN_SMTP_PORT}';
\$CONF['configured'] = true;
?>" | tee config.local.php
else
Expand Down
4 changes: 4 additions & 0 deletions fpm-alpine/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ POSTFIXADMIN_DB_TYPE=${POSTFIXADMIN_DB_TYPE:=sqlite}
POSTFIXADMIN_DB_HOST=${POSTFIXADMIN_DB_HOST:=""}
POSTFIXADMIN_DB_USER=${POSTFIXADMIN_DB_USER:=""}
POSTFIXADMIN_DB_PASSWORD=${POSTFIXADMIN_DB_PASSWORD:=""}
POSTFIXADMIN_SMTP_SERVER=${POSTFIXADMIN_SMTP_SERVER:="localhost"}
POSTFIXADMIN_SMTP_PORT=${POSTFIXADMIN_SMTP_PORT:="25"}

# topsecret99
DEFAULT_SETUP_PASSWORD="791eb4ead7fd996c01bed30707ae27dd:b7910d09773104bf84c4f4951205d2198c7cfc4f"
Expand Down Expand Up @@ -72,6 +74,8 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
\$CONF['database_password'] = '${POSTFIXADMIN_DB_PASSWORD}';
\$CONF['database_name'] = '${POSTFIXADMIN_DB_NAME}';
\$CONF['setup_password'] = '${POSTFIXADMIN_SETUP_PASSWORD}';
\$CONF['smtp_server'] = '${POSTFIXADMIN_SMTP_SERVER}';
\$CONF['smtp_port'] = '${POSTFIXADMIN_SMTP_PORT}';
\$CONF['configured'] = true;
?>" | tee config.local.php
else
Expand Down
4 changes: 4 additions & 0 deletions fpm/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ POSTFIXADMIN_DB_TYPE=${POSTFIXADMIN_DB_TYPE:=sqlite}
POSTFIXADMIN_DB_HOST=${POSTFIXADMIN_DB_HOST:=""}
POSTFIXADMIN_DB_USER=${POSTFIXADMIN_DB_USER:=""}
POSTFIXADMIN_DB_PASSWORD=${POSTFIXADMIN_DB_PASSWORD:=""}
POSTFIXADMIN_SMTP_SERVER=${POSTFIXADMIN_SMTP_SERVER:="localhost"}
POSTFIXADMIN_SMTP_PORT=${POSTFIXADMIN_SMTP_PORT:="25"}

# topsecret99
DEFAULT_SETUP_PASSWORD="791eb4ead7fd996c01bed30707ae27dd:b7910d09773104bf84c4f4951205d2198c7cfc4f"
Expand Down Expand Up @@ -72,6 +74,8 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
\$CONF['database_password'] = '${POSTFIXADMIN_DB_PASSWORD}';
\$CONF['database_name'] = '${POSTFIXADMIN_DB_NAME}';
\$CONF['setup_password'] = '${POSTFIXADMIN_SETUP_PASSWORD}';
\$CONF['smtp_server'] = '${POSTFIXADMIN_SMTP_SERVER}';
\$CONF['smtp_port'] = '${POSTFIXADMIN_SMTP_PORT}';
\$CONF['configured'] = true;
?>" | tee config.local.php
else
Expand Down

0 comments on commit 4791374

Please sign in to comment.