Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
postfix
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
luiz.nunes
postfix
Commits
86615b21
Commit
86615b21
authored
Mar 25, 2016
by
Alin Voinea
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refs #70500 - Support more environment variables
parent
fd6917f2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
3 deletions
+34
-3
README.md
README.md
+13
-0
docker-setup.sh
docker-setup.sh
+21
-3
No files found.
README.md
View file @
86615b21
...
@@ -13,6 +13,7 @@ The relay is set in `MTP_RELAY` and the port in `MTP_PORT`.
...
@@ -13,6 +13,7 @@ The relay is set in `MTP_RELAY` and the port in `MTP_PORT`.
-
`:latest`
[
*Dockerfile*
](
https://github.com/eea/eea.docker.postfix/blob/master/Dockerfile
)
(
default
)
-
`:latest`
[
*Dockerfile*
](
https://github.com/eea/eea.docker.postfix/blob/master/Dockerfile
)
(
default
)
-
`:eionet`
[
*Dockerfile*
](
https://github.com/eea/eea.docker.postfix/blob/master/eionet/Dockerfile
)
(
EEA
specific)
-
`:eionet`
[
*Dockerfile*
](
https://github.com/eea/eea.docker.postfix/blob/master/eionet/Dockerfile
)
(
EEA
specific)
-
`:2.10.1`
[
*Dockerfile*
](
https://github.com/eea/eea.docker.postfix/blob/2.10.1/Dockerfile
)
(
centos
7, chaperone, support more environment variables)
-
`:2.10`
[
*Dockerfile*
](
https://github.com/eea/eea.docker.postfix/blob/2.10/Dockerfile
)
(
centos
7, chaperone)
-
`:2.10`
[
*Dockerfile*
](
https://github.com/eea/eea.docker.postfix/blob/2.10/Dockerfile
)
(
centos
7, chaperone)
-
`:2.6`
[
*Dockerfile*
](
https://github.com/eea/eea.docker.postfix/blob/2.6/Dockerfile
)
(
centos
6)
-
`:2.6`
[
*Dockerfile*
](
https://github.com/eea/eea.docker.postfix/blob/2.6/Dockerfile
)
(
centos
6)
...
@@ -59,6 +60,18 @@ From another application container ("app"):
...
@@ -59,6 +60,18 @@ From another application container ("app"):
>>> s = smtplib.SMTP('postfixcontainer')
>>> s = smtplib.SMTP('postfixcontainer')
>>> s.sendmail('test@mydomain.com', ['user@example.com'], 'test')
>>> s.sendmail('test@mydomain.com', ['user@example.com'], 'test')
## Supported environment variables
*
`MTP_HOST`
The
`myhostname`
parameter specifies the internet hostname of this mail system
*
`MTP_DESTINATION`
The
`mydestination`
parameter specifies the list of domains that this machine considers itself the final destination for.
*
`MTP_BANNER`
The
`smtpd_banner`
parameter specifies the text that follows the 220 code in the SMTP server's greeting banner.
*
`MTP_RELAY`
The
`relayhost`
parameter specifies the default host to send mail to when no entry is matched in the optional transport(5) table.
*
`MTP_RELAY_DOMAINS`
The
`relay_domains`
parameter restricts what destinations this system will relay mail to.
*
`MTP_PORT`
The
`relayhost`
port
*
`MTP_USER`
The user used to connect to the
`relayhost`
*
`MTP_PASS`
The password used to connect to the
`relayhost`
*
`MTP_INTERFACES`
The
`inet_interfaces`
parameter specifies the network interface addresses that this mail system receives mail on.
## Copyright and license
## Copyright and license
The Initial Owner of the Original Code is European Environment Agency (EEA).
The Initial Owner of the Original Code is European Environment Agency (EEA).
...
...
docker-setup.sh
View file @
86615b21
...
@@ -10,14 +10,32 @@ function setup_conf_and_secret {
...
@@ -10,14 +10,32 @@ function setup_conf_and_secret {
postconf
-e
'smtp_sasl_security_options = noanonymous'
postconf
-e
'smtp_sasl_security_options = noanonymous'
postconf
-e
'smtp_tls_security_level = may'
postconf
-e
'smtp_tls_security_level = may'
postconf
-e
'mynetworks = 127.0.0.0/8 172.17.0.0/16'
postconf
-e
'mynetworks = 127.0.0.0/8 172.17.0.0/16'
postconf
-e
'local_recipient_maps ='
echo
"
$MTP_RELAY
$MTP_USER
:
$MTP_PASS
"
>
/etc/postfix/relay_passwd
echo
"
$MTP_RELAY
$MTP_USER
:
$MTP_PASS
"
>
/etc/postfix/relay_passwd
postmap /etc/postfix/relay_passwd
postmap /etc/postfix/relay_passwd
}
}
postconf
-e
"myhostname =
$MTP_HOST
"
if
[
-z
"
$MTP_INTERFACES
"
]
;
then
postconf
-e
'inet_interfaces = all'
postconf
-e
'inet_interfaces = all'
else
postconf
-e
'inet_interfaces = $MTP_INTERFACES'
fi
if
[
!
-z
"
$MTP_HOST
"
]
;
then
postconf
-e
'myhostname = $MTP_HOST'
fi
if
[
!
-z
"
$MTP_DESTINATION
"
]
;
then
postconf
-e
'mydestination = $MTP_DESTINATION'
fi
if
[
!
-z
"
$MTP_BANNER
"
]
;
then
postconf
-e
'smtpd_banner = $MTP_BANNER'
fi
if
[
!
-z
"
$MTP_RELAY_DOMAINS
"
]
;
then
postconf
-e
'relay_domains = $MTP_RELAY_DOMAINS'
fi
if
[
!
-z
"
$MTP_RELAY
"
-a
!
-z
"
$MTP_PORT
"
-a
!
-z
"
$MTP_USER
"
-a
!
-z
"
$MTP_PASS
"
]
;
then
if
[
!
-z
"
$MTP_RELAY
"
-a
!
-z
"
$MTP_PORT
"
-a
!
-z
"
$MTP_USER
"
-a
!
-z
"
$MTP_PASS
"
]
;
then
setup_conf_and_secret
setup_conf_and_secret
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment