Code Monkey home page Code Monkey logo

eea.docker.postfix's Introduction

Postfix SMTP only with relay support

Postfix SMTP only Docker image with SMTP relay support.

  • CentOS: 7
  • Postfix: 2.10.1
  • Expose: 25

Supported tags and respective Dockerfile links

Stable and immutable tags

  • :2.10-3.7 Dockerfile - Postfix: 2.10 Release: 3.7

See older versions

Base docker image

Source code

Usage

Start postfix (to send emails using postfix within container)

$ docker run --rm --name=postfix \
             -e  MTP_HOST=foo.com \
         eeacms/postfix

or start postfix (to send emails by using a remote email server)

$ docker run --rm --name=postfix \
             -e MTP_HOST=foo.com \
             -e MTP_RELAY=smtp.gmail.com \
             -e MTP_USER=foo \
             -e MTP_PASS=secret \
         eeacms/postfix

Start sending emails:

$ docker run -it --rm --link=postfix busybox sh
  $ telnet postfix 25
  HELO foo.com
  MAIL FROM: [email protected]
  RCPT TO: [email protected]
  DATA
  subject: Test
  Testing 1, 2, 3
  .
  quit

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.
  • MTP_PROTOCOLS The inet_protocols parameter specifies the network interface protocol. Can be set to all, ipv4,ipv6 or ipv4,ipv6. The default value is all.
  • MTP_MS_SIZE_LIMIT If set, will configure email size limit.

Copyright and license

The Initial Owner of the Original Code is European Environment Agency (EEA). All Rights Reserved.

The Original Code is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Funding

European Environment Agency (EU)

eea.docker.postfix's People

Contributors

alecghica avatar alexef avatar avoinea avatar charliefd avatar cristiroma avatar danielm-gh avatar danielpopescu22 avatar demarant avatar ekulos avatar valentinab25 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eea.docker.postfix's Issues

unable to send mail

I use email generated using https://www.fakemail.net/ for testing as

docker run -d --name=postfix -e MTP_HOST=andyes.net -e MTP_RELAY=mail.andyes.net -e MTP_USER=ferdinand.sutton -e MTP_PASS=gfqkc2K@ eeacms/postfix

and on its log I got

Jun 22 17:33:52 90c24854f4ca chaperone[1]: Switching all chaperone logging to /dev/log
Jun 22 17:33:52 90c24854f4ca chaperone[1]: chaperone version 0.3.9, ready.
Jun 22 17:33:54 90c24854f4ca postfix-script[139]: starting the Postfix mail system
Jun 22 17:33:55 90c24854f4ca master[141]: daemon started -- version 2.10.1, configuration /etc/postfix

So I connected to the container using

docker run -it --rm --link=postfix busybox sh

and run the following commands

 telnet postfix 25
(->gave output>  Connected to postfix
(->gave output>  220 andyes.net ESMTP Postfix
HELO andyes.net   (->gave output>  250 andyes.net
MAIL FROM: [email protected]    (->gave output> 250 2.1.0 Ok
RCPT TO: [email protected]  (->gave output> 250 2.1.5 Ok
DATA   (->gave output> 354 End data with <CR><LF>.<CR><LF>
DATA
subject: Test
Testing 1, 2, 3
.     (->gave output>   250 2.0.0 Ok: queued as E0C8913F488
quit   (->gave output>  221 2.0.0 Bye

but I didn't get any mail. I tried the reciving end as my mail also but I don't receive anything.
Please help me out

Container will fail in Openshift

This would happen if you start the container in openshift.

[root@localhost ~]# docker run -u 1001 --group-add=0  -i -t eeacms/postfix  
Unable to find image 'eeacms/postfix:latest' locally
Trying to pull repository docker.io/eeacms/postfix ... 
sha256:81a71e74e0ffdbe7f3aad51229d0668837fb8f12e43475995d398d2cb4a5e18e: Pulling from docker.io/eeacms/postfix
7dc0dca2b151: Pull complete 
6ecac0ae0f79: Pull complete 
ba93fb51ff11: Pull complete 
37ac39bd1cd8: Pull complete 
5e284f9a79e0: Pull complete 
6c8d417df31f: Pull complete 
Digest: sha256:81a71e74e0ffdbe7f3aad51229d0668837fb8f12e43475995d398d2cb4a5e18e
Status: Downloaded newer image for docker.io/eeacms/postfix:latest
syslog service cannot be started: [Errno 13] Permission denied: '/dev/log'
command service cannot be started: [Errno 13] Permission denied
postconf: fatal: open /etc/postfix/main.cf.tmp: Permission denied
postconf: fatal: open /etc/postfix/main.cf.tmp: Permission denied
postalias: fatal: open database /etc/aliases.db: Permission denied
postfix.service terminated abnormally with <ProcStatus exit_status=1>
setup.service terminated abnormally with <ProcStatus exit_status=1>

Add a param for inet_protocols

Hi !

Doesn't work here, it seems because it's trying to send through ipv6. Would it be possible to add the inet_protocols parameter, allowing to use ipv4 only ?

Thanks !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.