summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2004-05-30 10:52:45 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2004-05-30 10:52:45 +0000
commit4ff67e9074f5c37aa5be0a7e8e4a4eeb203f7646 (patch)
tree5ea134d1424a917087607095833d6fe18c31d021 /mail-mta/qmail-ldap/files/1.03-r3/qmail-genrsacert.sh
parentmove net-mail/qmail-mysql to mail-mta/qmail-mysql. (Manifest recommit) (diff)
downloadgentoo-2-4ff67e9074f5c37aa5be0a7e8e4a4eeb203f7646.tar.gz
gentoo-2-4ff67e9074f5c37aa5be0a7e8e4a4eeb203f7646.tar.bz2
gentoo-2-4ff67e9074f5c37aa5be0a7e8e4a4eeb203f7646.zip
move net-mail/qmail-ldap to mail-mta/qmail-ldap.
Diffstat (limited to 'mail-mta/qmail-ldap/files/1.03-r3/qmail-genrsacert.sh')
-rw-r--r--mail-mta/qmail-ldap/files/1.03-r3/qmail-genrsacert.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/mail-mta/qmail-ldap/files/1.03-r3/qmail-genrsacert.sh b/mail-mta/qmail-ldap/files/1.03-r3/qmail-genrsacert.sh
new file mode 100644
index 000000000000..4120b470bef8
--- /dev/null
+++ b/mail-mta/qmail-ldap/files/1.03-r3/qmail-genrsacert.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail-ldap/files/1.03-r3/qmail-genrsacert.sh,v 1.1 2004/05/30 10:52:45 robbat2 Exp $
+# Robin H. Johnson <robbat2@gentoo.org> - October 17, 2003
+# This file generates the static temporary RSA keys needed for qmail to encrypt messages
+# It should be run from a crontab, once a day is ok on low load machines, but
+# if you do lots of mail, once per hour is more reasonable
+# if you do NOT create the rsa512.pem, qmail will generate it on the fly for
+# each connection, which can be VERY slow.
+
+if [ -z "${ROOT}" -o "${ROOT}" = "/" ]; then
+confdir=/var/qmail/control
+else
+confdir=${ROOT}/var/qmail/control
+fi
+pemfile="${confdir}/rsa512.pem"
+tmpfile="${confdir}/rsa512.pem.tmp"
+
+# this is the number of bits in the key
+# it should be a power of 2 ideally
+# and it must be more than 64!
+bits="512"
+
+# the key should be 0600
+# which is readable by qmaild only!
+umaskvalue="0077"
+uid="qmaild"
+gid="qmail"
+
+umask ${umaskvalue} ;
+# we need to make sure that all of the operations succeed
+/usr/bin/openssl genrsa -out ${tmpfile} ${bits} 2>/dev/null && \
+/bin/chown ${uid}:${gid} ${tmpfile} && \
+/bin/mv -f ${tmpfile} ${pemfile}