1 diff -urN courier-0.64.2.orig//courier/configure.in courier-0.64.2/courier/configure.in
2 --- courier-0.64.2.orig//courier/configure.in 2010-01-09 22:13:40.000000000 +0100
3 +++ courier-0.64.2/courier/configure.in 2010-05-08 23:31:10.355976183 +0200
5 eval "datarootdir=$datarootdir"
7 eval "localstatedir=$localstatedir"
8 +eval "datadir=$datadir"
10 +AC_ARG_WITH(certsdir, [ --with-certsdir Directory where certs are created ],
11 +certsdir="$withval", certsdir=$datadir)
15 MAILDROP="$bindir/maildrop"
17 diff -urN courier-0.64.2.orig//courier/imapd-ssl.rc.in courier-0.64.2/courier/imapd-ssl.rc.in
18 --- courier-0.64.2.orig//courier/imapd-ssl.rc.in 2010-05-08 23:30:54.599915374 +0200
19 +++ courier-0.64.2/courier/imapd-ssl.rc.in 2010-05-08 23:31:10.355976183 +0200
24 + # If we do not have a certificate, make one up.
25 + if [ ! -f @certsdir@/imapd.pem ]; then
26 + @sbindir@/mkimapdcert
30 @ULIMIT@ $IMAP_ULIMITD
31 @SETENV@ -i @SHELL@ -c " set -a ;
32 diff -urN courier-0.64.2.orig//courier/module.esmtp/configure.in courier-0.64.2/courier/module.esmtp/configure.in
33 --- courier-0.64.2.orig//courier/module.esmtp/configure.in 2008-07-12 22:17:24.000000000 +0200
34 +++ courier-0.64.2/courier/module.esmtp/configure.in 2010-05-08 23:31:10.355976183 +0200
36 AC_SUBST(mydatadir) # Quell automake warning
39 +AC_ARG_WITH(certsdir, [ --with-certsdir Directory where certs are created ],
40 +certsdir="$withval", certsdir=$datadir)
45 dnl Check what libraries are available
47 diff -urN courier-0.64.2.orig//courier/module.esmtp/esmtpd.dist.in courier-0.64.2/courier/module.esmtp/esmtpd.dist.in
48 --- courier-0.64.2.orig//courier/module.esmtp/esmtpd.dist.in 2010-02-02 23:30:00.000000000 +0100
49 +++ courier-0.64.2/courier/module.esmtp/esmtpd.dist.in 2010-05-08 23:31:10.355976183 +0200
52 # This is an experimental feature.
54 -TLS_CERTFILE=@mydatadir@/esmtpd.pem
55 +TLS_CERTFILE=@certsdir@/esmtpd.pem
57 ##NAME: TLS_TRUSTCERTS:0
59 diff -urN courier-0.64.2.orig//courier/module.esmtp/esmtpd-ssl.dist.in courier-0.64.2/courier/module.esmtp/esmtpd-ssl.dist.in
60 --- courier-0.64.2.orig//courier/module.esmtp/esmtpd-ssl.dist.in 2010-02-02 23:30:00.000000000 +0100
61 +++ courier-0.64.2/courier/module.esmtp/esmtpd-ssl.dist.in 2010-05-08 23:31:10.355976183 +0200
64 # This is an experimental feature.
66 -TLS_CERTFILE=@mydatadir@/esmtpd.pem
67 +TLS_CERTFILE=@certsdir@/esmtpd.pem
69 ##NAME: TLS_TRUSTCERTS:0
71 diff -urN courier-0.64.2.orig//courier/module.esmtp/esmtpd-ssl.in courier-0.64.2/courier/module.esmtp/esmtpd-ssl.in
72 --- courier-0.64.2.orig//courier/module.esmtp/esmtpd-ssl.in 2010-05-08 23:30:54.612778263 +0200
73 +++ courier-0.64.2/courier/module.esmtp/esmtpd-ssl.in 2010-05-08 23:31:10.355976183 +0200
78 + # If we do not have a certificate, make one up.
79 + if [ ! -f @certsdir@/esmtpd.pem ]; then
80 + @sbindir@/mkesmtpdcert
84 ${sbindir}/couriertcpd -pid=$SSLPIDFILE -stop
85 diff -urN courier-0.64.2.orig//courier/module.esmtp/mkesmtpdcert.in courier-0.64.2/courier/module.esmtp/mkesmtpdcert.in
86 --- courier-0.64.2.orig//courier/module.esmtp/mkesmtpdcert.in 2007-11-04 22:17:03.000000000 +0100
87 +++ courier-0.64.2/courier/module.esmtp/mkesmtpdcert.in 2010-05-08 23:31:10.355976183 +0200
89 test -x @CERTTOOL@ || exit 0
92 -if test -f @mydatadir@/esmtpd.pem
93 +if test -f @certsdir@/esmtpd.pem
95 - echo "@mydatadir@/esmtpd.pem already exists."
96 + echo "@certsdir@/esmtpd.pem already exists."
101 - rm -f @mydatadir@/esmtpd.rand
102 - rm -f @mydatadir@/esmtpd.pem
103 - rm -f @mydatadir@/esmtpd.key
104 - rm -f @mydatadir@/esmtpd.cert
105 + rm -f @certsdir@/esmtpd.rand
106 + rm -f @certsdir@/esmtpd.pem
107 + rm -f @certsdir@/esmtpd.key
108 + rm -f @certsdir@/esmtpd.cert
115 if test "@ssllib@" = "openssl"
117 - cp /dev/null @mydatadir@/esmtpd.pem
118 - chmod 600 @mydatadir@/esmtpd.pem
119 - chown @mailuser@ @mydatadir@/esmtpd.pem
120 - dd if=@RANDOMV@ of=@mydatadir@/esmtpd.rand count=1 2>/dev/null
121 + cp /dev/null @certsdir@/esmtpd.pem
122 + chmod 600 @certsdir@/esmtpd.pem
123 + chown @mailuser@ @certsdir@/esmtpd.pem
124 + dd if=@RANDOMV@ of=@certsdir@/esmtpd.rand count=1 2>/dev/null
125 @OPENSSL@ req -new -x509 -days 365 -nodes \
126 - -config @sysconfdir@/esmtpd.cnf -out @mydatadir@/esmtpd.pem -keyout @mydatadir@/esmtpd.pem || cleanup
127 - @OPENSSL@ gendh -rand @mydatadir@/esmtpd.rand 512 >>@mydatadir@/esmtpd.pem || cleanup
128 - @OPENSSL@ x509 -subject -dates -fingerprint -noout -in @mydatadir@/esmtpd.pem || cleanup
129 - rm -f @mydatadir@/esmtpd.rand
130 + -config @sysconfdir@/esmtpd.cnf -out @certsdir@/esmtpd.pem -keyout @certsdir@/esmtpd.pem || cleanup
131 + @OPENSSL@ gendh -rand @certsdir@/esmtpd.rand 512 >>@certsdir@/esmtpd.pem || cleanup
132 + @OPENSSL@ x509 -subject -dates -fingerprint -noout -in @certsdir@/esmtpd.pem || cleanup
133 + rm -f @certsdir@/esmtpd.rand
135 - cp /dev/null @mydatadir@/esmtpd.key
136 - chmod 600 @mydatadir@/esmtpd.key
137 - cp /dev/null @mydatadir@/esmtpd.cert
138 - chmod 600 @mydatadir@/esmtpd.cert
139 + cp /dev/null @certsdir@/esmtpd.key
140 + chmod 600 @certsdir@/esmtpd.key
141 + cp /dev/null @certsdir@/esmtpd.cert
142 + chmod 600 @certsdir@/esmtpd.cert
144 @CERTTOOL@ --generate-privkey --outfile esmtpd.key
145 @CERTTOOL@ --generate-self-signed --load-privkey esmtpd.key --outfile esmtpd.cert --template @sysconfdir@/esmtpd.cnf
146 diff -urN courier-0.64.2.orig//courier/pop3d-ssl.in courier-0.64.2/courier/pop3d-ssl.in
147 --- courier-0.64.2.orig//courier/pop3d-ssl.in 2010-05-08 23:30:54.612778263 +0200
148 +++ courier-0.64.2/courier/pop3d-ssl.in 2010-05-08 23:31:10.355976183 +0200
153 + # If we do not have a certificate, make one up.
154 + if [ ! -f @certsdir@/pop3d.pem ]; then
155 + @sbindir@/mkpop3dcert
158 exec @SETENV@ -i PATH="$PATH" SHELL="$SHELL" \
159 @SHELL@ -c " set -a ; \
161 diff -urN courier-0.64.2.orig//courier.sysvinit.in courier-0.64.2/courier.sysvinit.in
162 --- courier-0.64.2.orig//courier.sysvinit.in 2010-05-08 23:30:54.612778263 +0200
163 +++ courier-0.64.2/courier.sysvinit.in 2010-05-08 23:31:10.355976183 +0200
167 libexecdir="@libexecdir@"
169 +certsdir="@certsdir@"
171 if test ! -f ${sysconfdir}/esmtpd
175 # If we do not have a certificate, make one up.
177 - if test ! -f ${datadir}/esmtpd.pem
178 + if test ! -f ${certsdir}/esmtpd.pem
180 if test -x $COURIERTLS
184 # If we do not have a certificate, make one up.
186 - if test ! -f ${datadir}/pop3d.pem
187 + if test ! -f ${certsdir}/pop3d.pem
189 echo -n " generating-POP3-SSL-certificate..."
193 # If we do not have a certificate, make one up.
195 - if test ! -f ${datadir}/imapd.pem
196 + if test ! -f ${certsdir}/imapd.pem
198 echo -n " generating-IMAP-SSL-certificate..."