diff --git a/debian/changelog b/debian/changelog
index 2efb82b..d7070e6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,8 @@ courier (1.0.14-1) UNRELEASED; urgency=medium
   * New upstream release 1.0.14.
   * Make courier-imap depend on fam or gamin.  Closes: #578937, #974585.
   * Refresh patch 0012
+  * Improve regular expressions used to parse config files.  Allows
+    single and double quotes.  Closes: #933948.
   * Add patch 0026-correct-config-dir-in-docs.patch to correct paths to
     certificates in manpages and HTML documentation.  Closes: #946591.
   * Drop patch 0015-Disable-imapscanfail-maildirwatch-error-reporting:
diff --git a/debian/courier-imap.courier-imap-ssl.init b/debian/courier-imap.courier-imap-ssl.init
index b9ed0b8..1043ebb 100644
--- a/debian/courier-imap.courier-imap-ssl.init
+++ b/debian/courier-imap.courier-imap-ssl.init
@@ -17,7 +17,7 @@ fi
 DAEMON="/usr/sbin/imapd-ssl"
 DESC="Courier IMAP server (TLS)"
 
-DO_START=$(sed -ne 's/^IMAPDSSLSTART=\([^[:space:]]*\)/\1/p' /etc/courier/imapd-ssl | tr "A-Z" "a-z")
-PIDFILE=$(sed -ne 's/^SSLPIDFILE=\([^[:space:]]*\)/\1/p' /etc/courier/imapd-ssl)
+DO_START=$(sed -ne "s/^IMAPDSSLSTART[[:space:]]*=[[:space:]]*[\\'\\\"]\\?\\(\\w*\\)[\\'\\\"]\\?/\\L\\1/p" /etc/courier/imapd-ssl)
+PIDFILE=$(sed -ne "s/^SSLPIDFILE[[:space:]]*=[[:space:]]*[\\'\\\"]\\?\\([^[:space:]]*\\)[\\'\\\"]\\?/\\1/p" /etc/courier/imapd-ssl)
 
 . /usr/lib/courier/init-d-script-courier
diff --git a/debian/courier-imap.init b/debian/courier-imap.init
index ce2f20e..1217e15 100644
--- a/debian/courier-imap.init
+++ b/debian/courier-imap.init
@@ -17,7 +17,7 @@ fi
 DAEMON="/usr/sbin/imapd"
 DESC="Courier IMAP server"
 
-DO_START=$(sed -ne 's/^IMAPDSTART=\([^[:space:]]*\)/\1/p' /etc/courier/imapd | tr "A-Z" "a-z")
-PIDFILE=$(sed -ne 's/^PIDFILE=\([^[:space:]]*\)/\1/p' /etc/courier/imapd)
+DO_START=$(sed -ne "s/^IMAPDSTART[[:space:]]*=[[:space:]]*[\\'\\\"]\\?\\(\\w*\\)[\\'\\\"]\\?/\\L\\1/p" /etc/courier/imapd)
+PIDFILE=$(sed -ne "s/^PIDFILE[[:space:]]*=[[:space:]]*[\\'\\\"]\\?\\([^[:space:]]*\\)[\\'\\\"]\\?/\\1/p" /etc/courier/imapd)
 
 . /usr/lib/courier/init-d-script-courier
diff --git a/debian/courier-mta.courier-msa.init b/debian/courier-mta.courier-msa.init
index 5dac698..f283969 100644
--- a/debian/courier-mta.courier-msa.init
+++ b/debian/courier-mta.courier-msa.init
@@ -17,7 +17,7 @@ fi
 DAEMON="/usr/sbin/esmtpd-msa"
 DESC="Courier MSA server"
 
-DO_START=$(sed -ne 's/^ESMTPDSTART=\([^[:space:]]*\)/\1/p' /etc/courier/esmtpd-msa | tr "A-Z" "a-z")
-PIDFILE=$(sed -ne 's/^PIDFILE=\([^[:space:]]*\)/\1/p' /etc/courier/esmtpd-msa)
+DO_START=$(sed -ne "s/^ESMTPDSTART[[:space:]]*=[[:space:]]*[\\'\\\"]\\?\\(\\w*\\)[\\'\\\"]\\?/\\L\\1/p" /etc/courier/esmtpd-msa)
+PIDFILE=$(sed -ne "s/^PIDFILE[[:space:]]*=[[:space:]]*[\\'\\\"]\\?\\([^[:space:]]*\\)[\\'\\\"]\\?/\\1/p" /etc/courier/esmtpd-msa)
 
 . /usr/lib/courier/init-d-script-courier
diff --git a/debian/courier-mta.courier-mta-ssl.init b/debian/courier-mta.courier-mta-ssl.init
index 9c5eb05..9f0a2da 100644
--- a/debian/courier-mta.courier-mta-ssl.init
+++ b/debian/courier-mta.courier-mta-ssl.init
@@ -17,7 +17,7 @@ fi
 DAEMON="/usr/sbin/esmtpd-ssl"
 DESC="Courier MTA TLS server"
 
-DO_START=$(sed -ne 's/^ESMTPDSSLSTART=\([^[:space:]]*\)/\1/p' /etc/courier/esmtpd-ssl | tr "A-Z" "a-z")
-PIDFILE=$(sed -ne 's/^SSLPIDFILE=\([^[:space:]]*\)/\1/p' /etc/courier/esmtpd-ssl)
+DO_START=$(sed -ne "s/^ESMTPDSSLSTART[[:space:]]*=[[:space:]]*[\\'\\\"]\\?\\(\\w*\\)[\\'\\\"]\\?/\\L\\1/p" /etc/courier/esmtpd-ssl)
+PIDFILE=$(sed -ne "s/^SSLPIDFILE[[:space:]]*=[[:space:]]*[\\'\\\"]\\?\\([^[:space:]]*\\)[\\'\\\"]\\?/\\1/p" /etc/courier/esmtpd-ssl)
 
 . /usr/lib/courier/init-d-script-courier
diff --git a/debian/courier-mta.init b/debian/courier-mta.init
index e2bd979..db2781a 100644
--- a/debian/courier-mta.init
+++ b/debian/courier-mta.init
@@ -17,7 +17,7 @@ fi
 DAEMON="/usr/sbin/esmtpd"
 DESC="Courier MTA server"
 
-DO_START=$(sed -ne 's/^ESMTPDSTART=\([^[:space:]]*\)/\1/p' /etc/courier/esmtpd | tr "A-Z" "a-z")
-PIDFILE=$(sed -ne 's/^PIDFILE=\([^[:space:]]*\)/\1/p' /etc/courier/esmtpd)
+DO_START=$(sed -ne "s/^ESMTPDSTART[[:space:]]*=[[:space:]]*[\\'\\\"]\\?\\(\\w*\\)[\\'\\\"]\\?/\\L\\1/p" /etc/courier/esmtpd)
+PIDFILE=$(sed -ne "s/^PIDFILE[[:space:]]*=[[:space:]]*[\\'\\\"]\\?\\([^[:space:]]*\\)[\\'\\\"]\\?/\\1/p" /etc/courier/esmtpd)
 
 . /usr/lib/courier/init-d-script-courier
diff --git a/debian/courier-pop.courier-pop-ssl.init b/debian/courier-pop.courier-pop-ssl.init
index 30edec2..d2c216e 100644
--- a/debian/courier-pop.courier-pop-ssl.init
+++ b/debian/courier-pop.courier-pop-ssl.init
@@ -17,7 +17,7 @@ fi
 DAEMON="/usr/sbin/pop3d-ssl"
 DESC="Courier POP3 server (TLS)"
 
-DO_START=$(sed -ne 's/^POP3DSSLSTART=\([^[:space:]]*\)/\1/p' /etc/courier/pop3d-ssl | tr "A-Z" "a-z")
-PIDFILE=$(sed -ne 's/^SSLPIDFILE=\([^[:space:]]*\)/\1/p' /etc/courier/pop3d-ssl)
+DO_START=$(sed -ne "s/^POP3DSSLSTART[[:space:]]*=[[:space:]]*[\\'\\\"]\\?\\(\\w*\\)[\\'\\\"]\\?/\\L\\1/p" /etc/courier/pop3d-ssl)
+PIDFILE=$(sed -ne "s/^SSLPIDFILE[[:space:]]*=[[:space:]]*[\\'\\\"]\\?\\([^[:space:]]*\\)[\\'\\\"]\\?/\\1/p" /etc/courier/pop3d-ssl)
 
 . /usr/lib/courier/init-d-script-courier
diff --git a/debian/courier-pop.init b/debian/courier-pop.init
index 553b17f..59fd8c2 100644
--- a/debian/courier-pop.init
+++ b/debian/courier-pop.init
@@ -17,7 +17,7 @@ fi
 DAEMON="/usr/sbin/pop3d"
 DESC="Courier POP3 server"
 
-DO_START=$(sed -ne 's/^POP3DSTART=\([^[:space:]]*\)/\1/p' /etc/courier/pop3d | tr "A-Z" "a-z")
-PIDFILE=$(sed -ne 's/^PIDFILE=\([^[:space:]]*\)/\1/p' /etc/courier/pop3d)
+DO_START=$(sed -ne "s/^POP3DSTART[[:space:]]*=[[:space:]]*[\\'\\\"]\\?\\(\\w*\\)[\\'\\\"]\\?/\\L\\1/p" /etc/courier/pop3d)
+PIDFILE=$(sed -ne "s/^PIDFILE[[:space:]]*=[[:space:]]*[\\'\\\"]\\?\\([^[:space:]]*\\)[\\'\\\"]\\?/\\1/p" /etc/courier/pop3d)
 
 . /usr/lib/courier/init-d-script-courier
