-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstunnel-tip.txt
56 lines (39 loc) · 1.55 KB
/
stunnel-tip.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
From: "Japheth Cleaver"
Subject: Stunnel tip for qmail-{pop3d,smtpd}-ssl
Date: Mon, 05 Dec 2005 09:01:28 -0800
After searching for a way to easily bring up SSL-enabled versions of
these services without messing up my existing means of configuration
too much, I came upon a rather simple solution for stunnel (which
seems to give people fits sometimes). Simply create a wrapper script
named qmail-stunnel-wrapper.sh like so:
--- snip ---
#!/bin/ash
SSLCERT=$1; shift
exec /usr/sbin/stunnel -fd 3 3<<HERE
debug=4
foreground=yes
cert=$SSLCERT
exec=$1
execargs=$*
HERE
--- snip ---
...and you can call it from within your
supervise/qmail-{pop3d,smtpd}-ssl/run command line:
exec /usr/local/sbin/softlimit -m 20971520 /usr/local/sbin/tcpserver \
-v -x /etc/tcprules.d/qmail-pop3d.cdb -c 120 -R 0 995 \
/var/qmail/bin/qmail-stunnel-wrapper.sh \
/var/qmail/control/pop3d-ssl.pem \
/var/qmail/bin/qmail-popup "`cat /var/qmail/control/me`" \
/usr/sbin/vchkpw \
/var/qmail/bin/qmail-pop3d-wrapper.sh \
/var/qmail/bin/qmail-pop3d Maildir 2>&1 7>&1
This way you can keep your existing configuration in the same
exec-pipeline method of the run files -- like the qmail-pop3d-wrapper
and FD7 redirect -- without having to make a separate stunnel config
file for each SSL service. Plus your qmail-smtpd-ssl service can be
run using the same wrapper.
Note that you need stunnel v4.05 or higher for this to work.
Hope this is useful for someone!
Regards,
Japheth Cleaver
cleaver rohan.sdsu.edu / cleaver redwire.net