Skip to content

ducnm0711/cyrus-postfix-docker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yadd/cyrus-imapd-postfix

Docker image based on last Debian stable release. It embeds:

  • postfix
  • cyrus-imapd (backports version)

HOW TO START

docker build -t cyrus-local .
docker-compose up -d
docker exec -it cyrus /bin/bash

After remote into the docker, run below steps to add dummy data:

Start saslthdb

/etc/init.d/saslauthd start

Create Mailbox user/password in SASLAUTHDB

echo 'createmailbox user.example@localhost.com' | cyradm -u cyrus -w cyrus localhost
echo 'createmailbox user.ana@localhost.com' | cyradm -u cyrus -w cyrus localhost
echo 'createmailbox user.bob@localhost.com' | cyradm -u cyrus -w cyrus localhost
echo 'example' | saslpasswd2 -p -c example
echo 'example' | saslpasswd2 -p -c ana
echo 'example' | saslpasswd2 -p -c bob

List user in SASLAUTHDB and verify password

sasldblistusers2
cyrus@ca77a55b1057: userPassword
example@ca77a55b1057: userPassword
testsaslauthd -u example -p example -f /var/run/saslauthd/mux
0: OK "Success."

Sample CURL

curl -X POST      -H "Content-Type: application/json"      -H "Accept: application/json"      --user example:example      -d '{
       "using": [ "urn:ietf:params:jmap:core", "urn:ietf:params:jmap:mail" ],
       "methodCalls": [[ "Mailbox/get", {}, "c1" ]]
     }'      http://localhost:8008/jmap/ | jq

Environment variables

Changing these variables has no effect when /etc/postfix is populated (after the first run if volume is kept).

Environment variables for Postfix (with default value):

  • For Cyrus-Imapd:
    • CYRUS_PWD = "" (if not set, cyradm isn't usable)
    • SASL_PWCHECK_METHOD = saslauthd auxprop
    • SASLDB = sasldb
  • For Postfix
    • MAILNAME = mail.example.com
    • OTHER_DESTINATIONS = example.com mail.example.com
    • RELAY_HOST = ""
    • MYNETWORKS = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
    • ROOT_ADDRESS = "": (address to which mail from root and postmaster will be sent)

Exposed ports

  • Postfix (depends on configuration):
    • 25
    • 465 (not configured by default)
    • 587 (not configured by default)
  • Cyrus (depends on configuration):
    • 110
    • 143
    • 993
    • 995 (not configured by default)
    • 2000 (not configured by default)
    • 8008
    • 8443 (not configured by default)

Repository and bug reports

Copyright and license

Copyright: Xavier (Yadd) Guimard yadd@debian.org.

License: GNU General Public License v2.0

About

Docker image for Postfix and Cyrus-Imapd

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 100.0%