summaryrefslogtreecommitdiffstats
path: root/qmail-smtpd.c
diff options
context:
space:
mode:
Diffstat (limited to 'qmail-smtpd.c')
-rw-r--r--qmail-smtpd.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/qmail-smtpd.c b/qmail-smtpd.c
index fe33249..19e7c9b 100644
--- a/qmail-smtpd.c
+++ b/qmail-smtpd.c
@@ -57,9 +57,13 @@ char *local;
57char *relayclient; 57char *relayclient;
58 58
59#ifdef TLS 59#ifdef TLS
60#include <sys/stat.h> 60# include <sys/stat.h>
61#include "tls.h" 61# include "tls.h"
62#include "ssl_timeoutio.h" 62# include "ssl_timeoutio.h"
63
64# define CLIENTCA "control/clientca.pem"
65# define CLIENTCRL "control/clientcrl.pem"
66# define SERVERCERT "control/servercert.pem"
63 67
64void tls_init(); 68void tls_init();
65int tls_verify(); 69int tls_verify();
@@ -591,7 +595,9 @@ void smtp_ehlo(arg) char *arg;
591 if(!spp_helo(arg)) return; 595 if(!spp_helo(arg)) return;
592 smtp_greet("250-"); 596 smtp_greet("250-");
593#ifdef TLS 597#ifdef TLS
594 if (!ssl && (stat("control/servercert.pem",&st) == 0)) 598 const char *servercert = env_get("SMTP_SERVERCERT");
599 if (!servercert) servercert = SERVERCERT;
600 if (!ssl && (stat(servercert, &st) == 0))
595 out("\r\n250-STARTTLS"); 601 out("\r\n250-STARTTLS");
596#endif 602#endif
597 out("\r\n250-PIPELINING\r\n250-8BITMIME\r\n"); 603 out("\r\n250-PIPELINING\r\n250-8BITMIME\r\n");
@@ -1262,10 +1268,6 @@ void tls_out(const char *s1, const char *s2)
1262} 1268}
1263void tls_err(const char *s) { tls_out(s, ssl_error()); if (smtps) die_read(); } 1269void tls_err(const char *s) { tls_out(s, ssl_error()); if (smtps) die_read(); }
1264 1270
1265# define CLIENTCA "control/clientca.pem"
1266# define CLIENTCRL "control/clientcrl.pem"
1267# define SERVERCERT "control/servercert.pem"
1268
1269int tls_verify() 1271int tls_verify()
1270{ 1272{
1271 stralloc clients = {0}; 1273 stralloc clients = {0};
@@ -1460,9 +1462,6 @@ void tls_init()
1460 dohelo(remotehost); 1462 dohelo(remotehost);
1461} 1463}
1462 1464
1463# undef SERVERCERT
1464# undef CLIENTCA
1465
1466#endif 1465#endif
1467 1466
1468struct commands smtpcommands[] = { 1467struct commands smtpcommands[] = {