diff options
author | Eric Faurot <eric@cvs.openbsd.org> | 2012-10-10 17:57:06 +0000 |
---|---|---|
committer | Eric Faurot <eric@cvs.openbsd.org> | 2012-10-10 17:57:06 +0000 |
commit | 72dffe3754f92adefba1fd73c49c423ebbed554a (patch) | |
tree | 8dbfe31865c23905fd725891d360191219bb8cfb /usr.sbin/smtpd | |
parent | d2285c9537aa64983166aca5ea934f9b033e9932 (diff) |
show the port number for a relay if specified.
ok gilles@
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r-- | usr.sbin/smtpd/mta.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.sbin/smtpd/mta.c b/usr.sbin/smtpd/mta.c index 534aba48b35..246cf507eef 100644 --- a/usr.sbin/smtpd/mta.c +++ b/usr.sbin/smtpd/mta.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mta.c,v 1.145 2012/10/07 14:55:48 gilles Exp $ */ +/* $OpenBSD: mta.c,v 1.146 2012/10/10 17:57:05 eric Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -337,13 +337,19 @@ const char * mta_route_to_text(struct mta_route *route) { static char buf[1024]; + char tmp[32]; const char *sep = ""; - buf[0] = '\0'; - snprintf(buf, sizeof buf, "route:%s[", route->hostname); + if (route->port) { + snprintf(tmp, sizeof tmp, "port=%i", (int)route->port); + strlcat(buf, tmp, sizeof buf); + sep = ","; + } + if (route->flags & ROUTE_STARTTLS) { + strlcat(buf, sep, sizeof buf); sep = ","; strlcat(buf, "starttls", sizeof buf); } |