SHA256
1
0
forked from pool/courier-imap
courier-imap/courier-imap-4.1.1.diff

148 lines
4.6 KiB
Diff

--- imap/imapd-ssl.dist.in
+++ imap/imapd-ssl.dist.in
@@ -254,7 +254,7 @@
#
# This is an experimental feature.
-TLS_CERTFILE=@mydatadir@/imapd.pem
+TLS_CERTFILE=@sysconfdir@/imapd.pem
##NAME: TLS_TRUSTCERTS:0
#
--- imap/mkimapdcert.in
+++ imap/mkimapdcert.in
@@ -18,19 +18,19 @@
prefix="@prefix@"
-if test -f @mydatadir@/imapd.pem
+if test -f @sysconfdir@/imapd.pem
then
- echo "@mydatadir@/imapd.pem already exists."
+ echo "@sysconfdir@/imapd.pem already exists."
exit 1
fi
umask 077
cleanup() {
- rm -f @mydatadir@/imapd.pem
- rm -f @mydatadir@/imapd.rand
- rm -f @mydatadir@/imapd.key
- rm -f @mydatadir@/imapd.cert
+ rm -f @sysconfdir@/imapd.pem
+ rm -f @sysconfdir@/imapd.rand
+ rm -f @sysconfdir@/imapd.key
+ rm -f @sysconfdir@/imapd.cert
exit 1
}
@@ -38,21 +38,21 @@
if test "@ssllib@" = "openssl"
then
- cp /dev/null @mydatadir@/imapd.pem
- chmod 600 @mydatadir@/imapd.pem
- chown @mailuser@ @mydatadir@/imapd.pem
+ cp /dev/null @sysconfdir@/imapd.pem
+ chmod 600 @sysconfdir@/imapd.pem
+ chown @mailuser@ @sysconfdir@/imapd.pem
- dd if=@RANDOMV@ of=@mydatadir@/imapd.rand count=1 2>/dev/null
+ dd if=@RANDOMV@ of=@sysconfdir@/imapd.rand count=1 2>/dev/null
@OPENSSL@ req -new -x509 -days 365 -nodes \
- -config @sysconfdir@/imapd.cnf -out @mydatadir@/imapd.pem -keyout @mydatadir@/imapd.pem || cleanup
- @OPENSSL@ gendh -rand @mydatadir@/imapd.rand 512 >>@mydatadir@/imapd.pem || cleanup
- @OPENSSL@ x509 -subject -dates -fingerprint -noout -in @mydatadir@/imapd.pem || cleanup
- rm -f @mydatadir@/imapd.rand
+ -config @sysconfdir@/imapd.cnf -out @sysconfdir@/imapd.pem -keyout @sysconfdir@/imapd.pem || cleanup
+ @OPENSSL@ gendh -rand @sysconfdir@/imapd.rand 512 >>@sysconfdir@/imapd.pem || cleanup
+ @OPENSSL@ x509 -subject -dates -fingerprint -noout -in @sysconfdir@/imapd.pem || cleanup
+ rm -f @sysconfdir@/imapd.rand
else
- cp /dev/null @mydatadir@/imapd.key
- chmod 600 @mydatadir@/imapd.key
- cp /dev/null @mydatadir@/imapd.cert
- chmod 600 @mydatadir@/imapd.cert
+ cp /dev/null @sysconfdir@/imapd.key
+ chmod 600 @sysconfdir@/imapd.key
+ cp /dev/null @sysconfdir@/imapd.cert
+ chmod 600 @sysconfdir@/imapd.cert
@CERTTOOL@ --generate-privkey --outfile imapd.key
@CERTTOOL@ --generate-self-signed --load-privkey imapd.key --outfile imapd.cert --template @sysconfdir@/imapd.cnf
--- imap/mkpop3dcert.in
+++ imap/mkpop3dcert.in
@@ -18,41 +18,41 @@
prefix="@prefix@"
-if test -f @mydatadir@/pop3d.pem
+if test -f @sysconfdir@/pop3d.pem
then
- echo "@mydatadir@/pop3d.pem already exists."
+ echo "@sysconfdir@/pop3d.pem already exists."
exit 1
fi
umask 077
cleanup() {
- rm -f @mydatadir@/pop3d.pem
- rm -f @mydatadir@/pop3d.rand
- rm -f @mydatadir@/pop3d.key
- rm -f @mydatadir@/pop3d.cert
+ rm -f @sysconfdir@/pop3d.pem
+ rm -f @sysconfdir@/pop3d.rand
+ rm -f @sysconfdir@/pop3d.key
+ rm -f @sysconfdir@/pop3d.cert
exit 1
}
-cd @mydatadir@
+cd @sysconfdir@
if test "@ssllib@" = "openssl"
then
- cp /dev/null @mydatadir@/pop3d.pem
- chmod 600 @mydatadir@/pop3d.pem
- chown @mailuser@ @mydatadir@/pop3d.pem
+ cp /dev/null @sysconfdir@/pop3d.pem
+ chmod 600 @sysconfdir@/pop3d.pem
+ chown @mailuser@ @sysconfdir@/pop3d.pem
- dd if=@RANDOMV@ of=@mydatadir@/pop3d.rand count=1 2>/dev/null
+ dd if=@RANDOMV@ of=@sysconfdir@/pop3d.rand count=1 2>/dev/null
@OPENSSL@ req -new -x509 -days 365 -nodes \
- -config @sysconfdir@/pop3d.cnf -out @mydatadir@/pop3d.pem -keyout @mydatadir@/pop3d.pem || cleanup
- @OPENSSL@ gendh -rand @mydatadir@/pop3d.rand 512 >>@mydatadir@/pop3d.pem || cleanup
- @OPENSSL@ x509 -subject -dates -fingerprint -noout -in @mydatadir@/pop3d.pem || cleanup
- rm -f @mydatadir@/pop3d.rand
+ -config @sysconfdir@/pop3d.cnf -out @sysconfdir@/pop3d.pem -keyout @sysconfdir@/pop3d.pem || cleanup
+ @OPENSSL@ gendh -rand @sysconfdir@/pop3d.rand 512 >>@sysconfdir@/pop3d.pem || cleanup
+ @OPENSSL@ x509 -subject -dates -fingerprint -noout -in @sysconfdir@/pop3d.pem || cleanup
+ rm -f @sysconfdir@/pop3d.rand
else
- cp /dev/null @mydatadir@/pop3d.key
- chmod 600 @mydatadir@/pop3d.key
- cp /dev/null @mydatadir@/pop3d.cert
- chmod 600 @mydatadir@/pop3d.cert
+ cp /dev/null @sysconfdir@/pop3d.key
+ chmod 600 @sysconfdir@/pop3d.key
+ cp /dev/null @sysconfdir@/pop3d.cert
+ chmod 600 @sysconfdir@/pop3d.cert
@CERTTOOL@ --generate-privkey --outfile pop3d.key
@CERTTOOL@ --generate-self-signed --load-privkey pop3d.key --outfile pop3d.cert --template @sysconfdir@/pop3d.cnf
--- imap/pop3d-ssl.dist.in
+++ imap/pop3d-ssl.dist.in
@@ -241,7 +241,7 @@
#
# This is an experimental feature.
-TLS_CERTFILE=@mydatadir@/pop3d.pem
+TLS_CERTFILE=@sysconfdir@/pop3d.pem
##NAME: TLS_TRUSTCERTS:0
#