]>
Commit | Line | Data |
---|---|---|
d17b8ca4 | 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 | |
4 | @@ -480,6 +480,12 @@ | |
5d26edcf | 5 | eval "datarootdir=$datarootdir" |
c2c7a750 | 6 | eval "bindir=$bindir" |
5d26edcf | 7 | eval "localstatedir=$localstatedir" |
69e1f9b1 AA |
8 | +eval "datadir=$datadir" |
9 | + | |
c2c7a750 | 10 | +AC_ARG_WITH(certsdir, [ --with-certsdir Directory where certs are created ], |
69e1f9b1 | 11 | +certsdir="$withval", certsdir=$datadir) |
c2c7a750 AA |
12 | + |
13 | +AC_SUBST(certsdir) | |
69e1f9b1 | 14 | |
c2c7a750 AA |
15 | MAILDROP="$bindir/maildrop" |
16 | AC_SUBST(MAILDROP) | |
d17b8ca4 | 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 | |
c2c7a750 AA |
20 | @@ -28,6 +28,11 @@ |
21 | ||
22 | case $1 in | |
23 | start) | |
33c18667 AA |
24 | + # If we do not have a certificate, make one up. |
25 | + if [ ! -f @certsdir@/imapd.pem ]; then | |
26 | + @sbindir@/mkimapdcert | |
27 | + fi | |
c2c7a750 | 28 | + |
33c18667 AA |
29 | umask $IMAP_UMASK |
30 | @ULIMIT@ $IMAP_ULIMITD | |
31 | @SETENV@ -i @SHELL@ -c " set -a ; | |
d17b8ca4 | 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 | |
35 | @@ -287,6 +287,11 @@ | |
5d26edcf | 36 | AC_SUBST(mydatadir) # Quell automake warning |
37 | ||
c2c7a750 AA |
38 | |
39 | +AC_ARG_WITH(certsdir, [ --with-certsdir Directory where certs are created ], | |
b3795f4c | 40 | +certsdir="$withval", certsdir=$datadir) |
c2c7a750 AA |
41 | + |
42 | +AC_SUBST(certsdir) | |
43 | + | |
44 | dnl | |
45 | dnl Check what libraries are available | |
46 | dnl | |
d17b8ca4 | 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 | |
50 | @@ -242,7 +242,7 @@ | |
3d35ebab | 51 | # |
5d26edcf | 52 | # This is an experimental feature. |
53 | ||
54 | -TLS_CERTFILE=@mydatadir@/esmtpd.pem | |
3d35ebab AA |
55 | +TLS_CERTFILE=@certsdir@/esmtpd.pem |
56 | ||
d17b8ca4 | 57 | ##NAME: TLS_TRUSTCERTS:0 |
3d35ebab | 58 | # |
d17b8ca4 | 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 | |
62 | @@ -269,7 +269,7 @@ | |
c2c7a750 | 63 | # |
5d26edcf | 64 | # This is an experimental feature. |
65 | ||
66 | -TLS_CERTFILE=@mydatadir@/esmtpd.pem | |
c2c7a750 AA |
67 | +TLS_CERTFILE=@certsdir@/esmtpd.pem |
68 | ||
69 | ##NAME: TLS_TRUSTCERTS:0 | |
70 | # | |
d17b8ca4 | 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 | |
c2c7a750 AA |
74 | @@ -25,6 +25,10 @@ |
75 | ||
76 | case $1 in | |
77 | start) | |
78 | + # If we do not have a certificate, make one up. | |
79 | + if [ ! -f @certsdir@/esmtpd.pem ]; then | |
80 | + @sbindir@/mkesmtpdcert | |
81 | + fi | |
82 | ;; | |
83 | stop) | |
84 | ${sbindir}/couriertcpd -pid=$SSLPIDFILE -stop | |
d17b8ca4 | 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 | |
5d26edcf | 88 | @@ -16,38 +16,38 @@ |
89 | test -x @CERTTOOL@ || exit 0 | |
90 | fi | |
69e1f9b1 | 91 | |
5d26edcf | 92 | -if test -f @mydatadir@/esmtpd.pem |
69e1f9b1 AA |
93 | +if test -f @certsdir@/esmtpd.pem |
94 | then | |
5d26edcf | 95 | - echo "@mydatadir@/esmtpd.pem already exists." |
69e1f9b1 AA |
96 | + echo "@certsdir@/esmtpd.pem already exists." |
97 | exit 1 | |
98 | fi | |
99 | ||
69e1f9b1 | 100 | cleanup() { |
5d26edcf | 101 | - rm -f @mydatadir@/esmtpd.rand |
102 | - rm -f @mydatadir@/esmtpd.pem | |
103 | - rm -f @mydatadir@/esmtpd.key | |
104 | - rm -f @mydatadir@/esmtpd.cert | |
69e1f9b1 AA |
105 | + rm -f @certsdir@/esmtpd.rand |
106 | + rm -f @certsdir@/esmtpd.pem | |
5d26edcf | 107 | + rm -f @certsdir@/esmtpd.key |
108 | + rm -f @certsdir@/esmtpd.cert | |
69e1f9b1 AA |
109 | exit 1 |
110 | } | |
111 | ||
5d26edcf | 112 | -cd @mydatadir@ |
113 | +cd @certsdir@ | |
114 | ||
115 | if test "@ssllib@" = "openssl" | |
116 | then | |
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 | |
134 | else | |
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 | |
143 | ||
144 | @CERTTOOL@ --generate-privkey --outfile esmtpd.key | |
145 | @CERTTOOL@ --generate-self-signed --load-privkey esmtpd.key --outfile esmtpd.cert --template @sysconfdir@/esmtpd.cnf | |
d17b8ca4 | 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 | |
c2c7a750 AA |
149 | @@ -29,6 +29,11 @@ |
150 | ||
151 | case $1 in | |
152 | start) | |
33c18667 AA |
153 | + # If we do not have a certificate, make one up. |
154 | + if [ ! -f @certsdir@/pop3d.pem ]; then | |
155 | + @sbindir@/mkpop3dcert | |
156 | + fi | |
c2c7a750 | 157 | + |
33c18667 AA |
158 | exec @SETENV@ -i PATH="$PATH" SHELL="$SHELL" \ |
159 | @SHELL@ -c " set -a ; \ | |
160 | prefix=@prefix@ ; \ | |
d17b8ca4 | 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 | |
5d26edcf | 164 | @@ -18,7 +18,7 @@ |
c2c7a750 AA |
165 | sbindir="@sbindir@" |
166 | bindir="@bindir@" | |
167 | libexecdir="@libexecdir@" | |
168 | -datadir="@datadir@" | |
169 | +certsdir="@certsdir@" | |
170 | ||
171 | if test ! -f ${sysconfdir}/esmtpd | |
172 | then | |
5d26edcf | 173 | @@ -85,7 +85,7 @@ |
c2c7a750 AA |
174 | then |
175 | # If we do not have a certificate, make one up. | |
176 | ||
177 | - if test ! -f ${datadir}/esmtpd.pem | |
178 | + if test ! -f ${certsdir}/esmtpd.pem | |
179 | then | |
180 | if test -x $COURIERTLS | |
181 | then | |
5d26edcf | 182 | @@ -152,7 +152,7 @@ |
c2c7a750 AA |
183 | then |
184 | # If we do not have a certificate, make one up. | |
185 | ||
186 | - if test ! -f ${datadir}/pop3d.pem | |
187 | + if test ! -f ${certsdir}/pop3d.pem | |
188 | then | |
189 | echo -n " generating-POP3-SSL-certificate..." | |
190 | ||
5d26edcf | 191 | @@ -182,7 +182,7 @@ |
c2c7a750 AA |
192 | then |
193 | # If we do not have a certificate, make one up. | |
194 | ||
195 | - if test ! -f ${datadir}/imapd.pem | |
196 | + if test ! -f ${certsdir}/imapd.pem | |
197 | then | |
198 | echo -n " generating-IMAP-SSL-certificate..." | |
199 |