summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2018-03-27 21:58:25 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-03-27 21:58:25 +0200
commit9a14a9fff41d628ced31fea188bb5344bc6f48c3 (patch)
treede09b24ea25f075193cc79316727e287ddbb9d86
parent7469b90fce44ca6ab27d88e991c74b71ab8f29e8 (diff)
downloadkube-9a14a9fff41d628ced31fea188bb5344bc6f48c3.tar.gz
kube-9a14a9fff41d628ced31fea188bb5344bc6f48c3.zip
Fixed saslauthd authentication
-rw-r--r--docker/Dockerfile12
-rw-r--r--docker/bashrc2
-rw-r--r--docker/imapd.conf12
-rwxr-xr-xdocker/startimap.sh2
4 files changed, 15 insertions, 13 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile
index f6eac989..a784d1ae 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -28,13 +28,16 @@ RUN dnf -y install google-noto-serif-fonts google-noto-sans-fonts
28 28
29RUN useradd -d /home/developer -m developer 29RUN useradd -d /home/developer -m developer
30 30
31
32ADD rsyslog.conf /etc/rsyslog.conf
31#Setup cyrus imap 33#Setup cyrus imap
32RUN echo 'altnamespace: 0' >> /etc/imapd.conf 34ADD imapd.conf /etc/imapd.conf
33RUN echo 'unixhierarchysep: 0' >> /etc/imapd.conf
34RUN usermod -p `perl -e "print crypt("admin","Q4")"` cyrus 35RUN usermod -p `perl -e "print crypt("admin","Q4")"` cyrus
35RUN useradd -p `perl -e "print crypt("doe","Q4")"` doe 36RUN useradd -p `perl -e "print crypt("doe","Q4")"` doe
36RUN /usr/bin/sscg --package cyrus-imapd --cert-file /etc/pki/cyrus-imapd/cyrus-imapd.pem --cert-key-file /etc/pki/cyrus-imapd/cyrus-imapd-key.pem --ca-file /etc/pki/cyrus-imapd/cyrus-imapd-ca.pem 37RUN /usr/bin/sscg --package cyrus-imapd --cert-file /etc/pki/cyrus-imapd/cyrus-imapd.pem --cert-key-file /etc/pki/cyrus-imapd/cyrus-imapd-key.pem --ca-file /etc/pki/cyrus-imapd/cyrus-imapd-ca.pem
37RUN saslauthd -a pam && /usr/libexec/cyrus-imapd/master -d && sleep 1 && echo "cm user.doe" | cyradm --auth PLAIN -u cyrus -w admin localhost 38RUN saslauthd -a shadow && /usr/libexec/cyrus-imapd/master -d && sleep 1 && echo "cm user.doe" | cyradm --auth PLAIN -u cyrus -w admin localhost
39#RUN echo "doe" | saslpasswd2 -p -u example.org doe
40#RUN chown cyrus:root /etc/sasldb2
38 41
39#DBus For KCacheGrind 42#DBus For KCacheGrind
40RUN dbus-uuidgen --ensure 43RUN dbus-uuidgen --ensure
@@ -78,6 +81,3 @@ RUN sudo chown developer:developer /home/developer/.gnupg -R
78RUN gpg2 --batch --generate-key /home/developer/keyconfig 81RUN gpg2 --batch --generate-key /home/developer/keyconfig
79#Better qt support 82#Better qt support
80RUN git clone https://github.com/Lekensteyn/qt5printers.git ~/.gdb/qt5printers/ 83RUN git clone https://github.com/Lekensteyn/qt5printers.git ~/.gdb/qt5printers/
81
82ADD rsyslog.conf /etc/rsyslog.conf
83ADD imapd.conf /etc/imapd.conf
diff --git a/docker/bashrc b/docker/bashrc
index d477583c..faf93f55 100644
--- a/docker/bashrc
+++ b/docker/bashrc
@@ -2,6 +2,6 @@
2ulimit -c 0 2ulimit -c 0
3 3
4sudo rsyslogd & 4sudo rsyslogd &
5sudo saslauthd -a pam & 5sudo saslauthd -a shadow &
6sudo /usr/libexec/cyrus-imapd/master -d 6sudo /usr/libexec/cyrus-imapd/master -d
7 7
diff --git a/docker/imapd.conf b/docker/imapd.conf
index 86b320ab..320cbd36 100644
--- a/docker/imapd.conf
+++ b/docker/imapd.conf
@@ -94,11 +94,13 @@ allowplaintext: yes
94# Possible values are "saslauthd", "auxprop", "pwcheck" and 94# Possible values are "saslauthd", "auxprop", "pwcheck" and
95# "alwaystrue". They are tried in order, you can specify more than one, 95# "alwaystrue". They are tried in order, you can specify more than one,
96# separated by spaces. 96# separated by spaces.
97# FIXME saslauthd doesn't work with caldav/carddav for unknown reasons. 97# * saslauthd works when started with the shadow mech
98# It seems to work fine on the commandline, and from the logs the only thing 98# * auxprop should work when:
99# that could be going wrong is authentication via pam, but for imap it seems 99# * setting default_domain: example.org
100# to work anyways.... 100# * creating a password with 'echo "doe" | saslpasswd2 -p -u example.org doe' (chown cyrus:root /etc/sasldb2)
101sasl_pwcheck_method: alwaystrue 101# * either login with doe@example.org, ensure the current hostname is example.org.
102# * We currently use the saslauthd option so we can login using just doe
103sasl_pwcheck_method: saslauthd
102 104
103# If enabled, the SASL library will automatically create authentication 105# If enabled, the SASL library will automatically create authentication
104# secrets when given a plaintext password. Refer to SASL documentation 106# secrets when given a plaintext password. Refer to SASL documentation
diff --git a/docker/startimap.sh b/docker/startimap.sh
index cb5af4f0..b80733af 100755
--- a/docker/startimap.sh
+++ b/docker/startimap.sh
@@ -1,5 +1,5 @@
1#!/bin/bash 1#!/bin/bash
2sudo saslauthd -a pam & 2sudo saslauthd -a shadow &
3sudo /usr/libexec/cyrus-imapd/master -d 3sudo /usr/libexec/cyrus-imapd/master -d
4#Give the imap server some time to start 4#Give the imap server some time to start
5sleep 1 5sleep 1