87 |
char *tls_key; /* TLS key */ |
char *tls_key; /* TLS key */ |
88 |
char *tls_cafile; |
char *tls_cafile; |
89 |
|
|
|
#define enable_tls() (tls_cafile != NULL || (tls_cert != NULL && tls_key != NULL)) |
|
|
|
|
90 |
#define DH_BITS 768 |
#define DH_BITS 768 |
91 |
|
#define enable_tls() (tls_cafile != NULL || (tls_cert != NULL && tls_key != NULL)) |
92 |
|
void tls_init(void); |
93 |
|
|
94 |
gnutls_dh_params dh_params; |
gnutls_dh_params dh_params; |
95 |
static gnutls_certificate_server_credentials x509_cred; |
static gnutls_certificate_server_credentials x509_cred; |
96 |
#endif |
#endif /* HAVE_TLS */ |
97 |
|
|
98 |
char *progname; |
char *progname; |
99 |
|
|
101 |
int mta_stdio(int, char **); |
int mta_stdio(int, char **); |
102 |
void error(const char *, ...); |
void error(const char *, ...); |
103 |
void smtp_reply(int, char *, ...); |
void smtp_reply(int, char *, ...); |
104 |
|
void reset_capa(char *); |
105 |
|
|
106 |
#define R_CONT 0x8000 |
#define R_CONT 0x8000 |
107 |
#define R_CODEMASK 0xfff |
#define R_CODEMASK 0xfff |
255 |
#ifdef HAVE_TLS |
#ifdef HAVE_TLS |
256 |
|
|
257 |
static void |
static void |
258 |
_tls_cleanup_x509() |
_tls_cleanup_x509(void) |
259 |
{ |
{ |
260 |
if (x509_cred) |
if (x509_cred) |
261 |
gnutls_certificate_free_credentials(x509_cred); |
gnutls_certificate_free_credentials(x509_cred); |
276 |
} |
} |
277 |
|
|
278 |
void |
void |
279 |
tls_init() |
tls_init(void) |
280 |
{ |
{ |
281 |
if (!enable_tls()) |
if (!enable_tls()) |
282 |
return; |
return; |
394 |
} |
} |
395 |
|
|
396 |
void |
void |
397 |
smtp_starttls() |
smtp_starttls(void) |
398 |
{ |
{ |
399 |
gnutls_session session; |
gnutls_session session; |
400 |
|
|
412 |
smtp_reply(530, "TLS negotiation failed"); |
smtp_reply(530, "TLS negotiation failed"); |
413 |
} |
} |
414 |
|
|
415 |
#endif |
#endif /* HAVE_TLS */ |
416 |
|
|
417 |
void |
void |
418 |
smtp_reply(int code, char *fmt, ...) |
smtp_reply(int code, char *fmt, ...) |
581 |
} |
} |
582 |
|
|
583 |
void |
void |
584 |
smtp_help() |
smtp_help(void) |
585 |
{ |
{ |
586 |
smtp_reply(502, "HELP not implemented"); |
smtp_reply(502, "HELP not implemented"); |
587 |
} |
} |
588 |
|
|
589 |
void |
void |
590 |
smtp() |
smtp(void) |
591 |
{ |
{ |
592 |
int state; |
int state; |
593 |
char buf[128]; |
char buf[128]; |