diff options
author | Gilles Chehade <gilles@poolp.org> | 2018-05-30 00:29:18 +0200 |
---|---|---|
committer | Gilles Chehade <gilles@poolp.org> | 2018-05-30 00:29:18 +0200 |
commit | c230f4232809bda2556e753e74c1c35572cdc8f0 (patch) | |
tree | 2a2c62d06a89feed8ae8b934b656c16a38694f66 /smtpd/to.c | |
parent | sync (diff) | |
download | OpenSMTPD-c230f4232809bda2556e753e74c1c35572cdc8f0.tar.xz OpenSMTPD-c230f4232809bda2556e753e74c1c35572cdc8f0.zip |
sync openbsd
Diffstat (limited to 'smtpd/to.c')
-rw-r--r-- | smtpd/to.c | 58 |
1 files changed, 1 insertions, 57 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: to.c,v 1.29 2018/05/24 11:38:24 gilles Exp $ */ +/* $OpenBSD: to.c,v 1.30 2018/05/29 21:05:52 eric Exp $ */ /* * Copyright (c) 2009 Jacek Masiulaniec <jacekm@dobremiasto.net> @@ -404,62 +404,6 @@ text_to_relayhost(struct relayhost *relay, const char *s) return 1; } -const char * -relayhost_to_text(const struct relayhost *relay) -{ - static char buf[4096]; - char port[4096]; - uint16_t mask = F_SMTPS|F_STARTTLS|F_AUTH|F_TLS_OPTIONAL|F_LMTP|F_BACKUP; - - memset(buf, 0, sizeof buf); - switch (relay->flags & mask) { - case F_SMTPS|F_STARTTLS|F_AUTH: - (void)strlcat(buf, "secure+auth://", sizeof buf); - break; - case F_SMTPS|F_STARTTLS: - (void)strlcat(buf, "secure://", sizeof buf); - break; - case F_STARTTLS|F_AUTH: - (void)strlcat(buf, "tls+auth://", sizeof buf); - break; - case F_SMTPS|F_AUTH: - (void)strlcat(buf, "smtps+auth://", sizeof buf); - break; - case F_STARTTLS: - (void)strlcat(buf, "tls://", sizeof buf); - break; - case F_SMTPS: - (void)strlcat(buf, "smtps://", sizeof buf); - break; - case F_BACKUP|F_STARTTLS: - (void)strlcat(buf, "tls+backup://", sizeof buf); - break; - case F_BACKUP: - (void)strlcat(buf, "backup://", sizeof buf); - break; - case F_TLS_OPTIONAL: - (void)strlcat(buf, "smtp+tls://", sizeof buf); - break; - case F_LMTP: - (void)strlcat(buf, "lmtp://", sizeof buf); - break; - default: - (void)strlcat(buf, "smtp://", sizeof buf); - break; - } - if (relay->authlabel[0]) { - (void)strlcat(buf, relay->authlabel, sizeof buf); - (void)strlcat(buf, "@", sizeof buf); - } - (void)strlcat(buf, relay->hostname, sizeof buf); - if (relay->port) { - (void)strlcat(buf, ":", sizeof buf); - (void)snprintf(port, sizeof port, "%d", relay->port); - (void)strlcat(buf, port, sizeof buf); - } - return buf; -} - uint64_t text_to_evpid(const char *s) { |