summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2013-08-02 03:24:49 +0200
committercinap_lenrek <cinap_lenrek@gmx.de>2013-08-02 03:24:49 +0200
commitc3c228a108bf4220e5471700029b713242a87eb2 (patch)
tree9961a38e8eadb33978f6433678d65daa9d74490a
parentbbf7f29d26d8db919c240f4d4704d390bd1c436c (diff)
parentb0a470fa0d47cf46d47aec7229f97c6ef700dcb1 (diff)
downloadplan9front-c3c228a108bf4220e5471700029b713242a87eb2.tar.xz
merge
-rw-r--r--sys/src/cmd/upas/smtp/smtp.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/sys/src/cmd/upas/smtp/smtp.c b/sys/src/cmd/upas/smtp/smtp.c
index 9c8e89d6a..895c84914 100644
--- a/sys/src/cmd/upas/smtp/smtp.c
+++ b/sys/src/cmd/upas/smtp/smtp.c
@@ -120,7 +120,8 @@ main(int argc, char **argv)
ARGBEGIN{
case 'a':
tryauth = 1;
- trysecure = 1;
+ if(trysecure == 0)
+ trysecure = 1;
break;
case 'A': /* autistic: won't talk to us until we talk (Verizon) */
autistic = 1;
@@ -150,7 +151,8 @@ main(int argc, char **argv)
ping = 1;
break;
case 's':
- trysecure = 1;
+ if(trysecure == 0)
+ trysecure = 1;
break;
case 't':
trysecure = 2;
@@ -221,9 +223,7 @@ main(int argc, char **argv)
/* 10 minutes to get through the initial handshake */
atnotify(timeout, 1);
alarm(10*alarmscale);
- if(trysecure > 1 && (rv = wraptls()) != nil)
- goto error;
- if((rv = hello(hellodomain, trysecure > 1)) != 0)
+ if((rv = hello(hellodomain, 0)) != 0)
goto error;
alarm(10*alarmscale);
if((rv = mailfrom(s_to_c(from))) != 0)
@@ -474,6 +474,12 @@ hello(char *me, int encrypted)
char *ret, *s, *t;
if (!encrypted) {
+ if(trysecure > 1){
+ if((ret = wraptls()) != nil)
+ return ret;
+ encrypted = 1;
+ }
+
/*
* Verizon fails to print the smtp greeting banner when it
* answers a call. Send a no-op in the hope of making it