diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-03-27 21:58:25 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-03-27 21:58:25 +0200 |
commit | 9a14a9fff41d628ced31fea188bb5344bc6f48c3 (patch) | |
tree | de09b24ea25f075193cc79316727e287ddbb9d86 | |
parent | 7469b90fce44ca6ab27d88e991c74b71ab8f29e8 (diff) | |
download | kube-9a14a9fff41d628ced31fea188bb5344bc6f48c3.tar.gz kube-9a14a9fff41d628ced31fea188bb5344bc6f48c3.zip |
Fixed saslauthd authentication
-rw-r--r-- | docker/Dockerfile | 12 | ||||
-rw-r--r-- | docker/bashrc | 2 | ||||
-rw-r--r-- | docker/imapd.conf | 12 | ||||
-rwxr-xr-x | docker/startimap.sh | 2 |
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 | ||
29 | RUN useradd -d /home/developer -m developer | 29 | RUN useradd -d /home/developer -m developer |
30 | 30 | ||
31 | |||
32 | ADD rsyslog.conf /etc/rsyslog.conf | ||
31 | #Setup cyrus imap | 33 | #Setup cyrus imap |
32 | RUN echo 'altnamespace: 0' >> /etc/imapd.conf | 34 | ADD imapd.conf /etc/imapd.conf |
33 | RUN echo 'unixhierarchysep: 0' >> /etc/imapd.conf | ||
34 | RUN usermod -p `perl -e "print crypt("admin","Q4")"` cyrus | 35 | RUN usermod -p `perl -e "print crypt("admin","Q4")"` cyrus |
35 | RUN useradd -p `perl -e "print crypt("doe","Q4")"` doe | 36 | RUN useradd -p `perl -e "print crypt("doe","Q4")"` doe |
36 | RUN /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 | 37 | RUN /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 |
37 | RUN saslauthd -a pam && /usr/libexec/cyrus-imapd/master -d && sleep 1 && echo "cm user.doe" | cyradm --auth PLAIN -u cyrus -w admin localhost | 38 | RUN 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 |
40 | RUN dbus-uuidgen --ensure | 43 | RUN dbus-uuidgen --ensure |
@@ -78,6 +81,3 @@ RUN sudo chown developer:developer /home/developer/.gnupg -R | |||
78 | RUN gpg2 --batch --generate-key /home/developer/keyconfig | 81 | RUN gpg2 --batch --generate-key /home/developer/keyconfig |
79 | #Better qt support | 82 | #Better qt support |
80 | RUN git clone https://github.com/Lekensteyn/qt5printers.git ~/.gdb/qt5printers/ | 83 | RUN git clone https://github.com/Lekensteyn/qt5printers.git ~/.gdb/qt5printers/ |
81 | |||
82 | ADD rsyslog.conf /etc/rsyslog.conf | ||
83 | ADD 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 @@ | |||
2 | ulimit -c 0 | 2 | ulimit -c 0 |
3 | 3 | ||
4 | sudo rsyslogd & | 4 | sudo rsyslogd & |
5 | sudo saslauthd -a pam & | 5 | sudo saslauthd -a shadow & |
6 | sudo /usr/libexec/cyrus-imapd/master -d | 6 | sudo /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) |
101 | sasl_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 | ||
103 | sasl_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 |
2 | sudo saslauthd -a pam & | 2 | sudo saslauthd -a shadow & |
3 | sudo /usr/libexec/cyrus-imapd/master -d | 3 | sudo /usr/libexec/cyrus-imapd/master -d |
4 | #Give the imap server some time to start | 4 | #Give the imap server some time to start |
5 | sleep 1 | 5 | sleep 1 |