Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 411781
Collapse All | Expand All

(-)a/TLS (-3 / +3 lines)
Lines 26-34 Set this to yes to make ssmtp identify itself with a certificate. Link Here
26
TLSCert=<file>
26
TLSCert=<file>
27
Specify which certificate file should be used.
27
Specify which certificate file should be used.
28
28
29
TLSKey=<file>
30
Specify which key file should be used (can be the same as the
31
certificate file).
29
32
30
TODO:
33
TODO:
31
* Check server certificate for changes and notify about it.
34
* Check server certificate for changes and notify about it.
32
* Diffrent Certificate and Key file?
33
34
(-)a/ssmtp.c (-1 / +11 lines)
Lines 68-73 char *gecos; Link Here
68
char *prog = (char)NULL;
68
char *prog = (char)NULL;
69
char *root = NULL;
69
char *root = NULL;
70
char *tls_cert = "/etc/ssl/certs/ssmtp.pem";	/* Default Certificate */
70
char *tls_cert = "/etc/ssl/certs/ssmtp.pem";	/* Default Certificate */
71
char *tls_key = "/etc/ssl/certs/ssmtp.pem";	/* Default private key */
71
char *uad = (char)NULL;
72
char *uad = (char)NULL;
72
char *config_file = (char)NULL;		/* alternate configuration file */
73
char *config_file = (char)NULL;		/* alternate configuration file */
73
74
Lines 1033-1038 bool_t read_config() Link Here
1033
					log_event(LOG_INFO, "Set TLSCert=\"%s\"\n", tls_cert);
1034
					log_event(LOG_INFO, "Set TLSCert=\"%s\"\n", tls_cert);
1034
				}
1035
				}
1035
			}
1036
			}
1037
			else if(strcasecmp(p, "TLSKey") == 0) {
1038
				if((tls_key = strdup(q)) == (char *)NULL) {
1039
					die("parse_config() -- strdup() failed");
1040
				}
1041
1042
				if(log_level > 0) {
1043
					log_event(LOG_INFO, "Set TLSKey=\"%s\"\n", tls_key);
1044
				}
1045
			}
1036
#endif
1046
#endif
1037
			/* Command-line overrides these */
1047
			/* Command-line overrides these */
1038
			else if(strcasecmp(p, "AuthUser") == 0 && !auth_user) {
1048
			else if(strcasecmp(p, "AuthUser") == 0 && !auth_user) {
Lines 1138-1144 int smtp_open(char *host, int port) Link Here
1138
			return(-1);
1148
			return(-1);
1139
		}
1149
		}
1140
1150
1141
		if(SSL_CTX_use_PrivateKey_file(ctx, tls_cert, SSL_FILETYPE_PEM) <= 0) {
1151
		if(SSL_CTX_use_PrivateKey_file(ctx, tls_key, SSL_FILETYPE_PEM) <= 0) {
1142
			perror("Use PrivateKey");
1152
			perror("Use PrivateKey");
1143
			return(-1);
1153
			return(-1);
1144
		}
1154
		}
(-)a/ssmtp.conf.5 (-1 / +3 lines)
Lines 54-59 See RFC 2487. Link Here
54
.It Cm TLSCert
54
.It Cm TLSCert
55
The file name of an RSA certificate to use for TLS, if required.
55
The file name of an RSA certificate to use for TLS, if required.
56
.Pp
56
.Pp
57
.It Cm TLSKey
58
The file name of an RSA key to use for TLS, if required.
59
.Pp
57
.It Cm AuthUser
60
.It Cm AuthUser
58
The user name to use for SMTP AUTH.
61
The user name to use for SMTP AUTH.
59
The default is blank, in which case SMTP AUTH is not used.
62
The default is blank, in which case SMTP AUTH is not used.
60
- 

Return to bug 411781