summaryrefslogtreecommitdiff
path: root/sys/src/cmd/upas/common
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2019-06-20 12:13:51 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2019-06-20 12:13:51 +0200
commit56e71d5260182e2ac32e09767b7c9440048a1d2f (patch)
treeffe72d2b5433be952c25ffe861d737d9cd760fad /sys/src/cmd/upas/common
parent4ff5a4febb8a3bf7f58fcf8524761d2c3565778f (diff)
upas/smtp: handle temporary authentication failures
under heavy load, factotum can return a "too much activity" error, which upas/smtpd and upas/smtp should consider a temporary error instead of a permanent one.
Diffstat (limited to 'sys/src/cmd/upas/common')
-rw-r--r--sys/src/cmd/upas/common/aux.c9
-rw-r--r--sys/src/cmd/upas/common/common.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/sys/src/cmd/upas/common/aux.c b/sys/src/cmd/upas/common/aux.c
index 985e3f296..28e4492b1 100644
--- a/sys/src/cmd/upas/common/aux.c
+++ b/sys/src/cmd/upas/common/aux.c
@@ -108,3 +108,12 @@ returnable(char *path)
{
return strcmp(path, "/dev/null") != 0;
}
+
+int
+temperror(void)
+{
+ char err[ERRMAX];
+
+ rerrstr(err, sizeof(err));
+ return strstr(err, "too much activity") != nil || strstr(err, "temporary problem") != nil;
+}
diff --git a/sys/src/cmd/upas/common/common.h b/sys/src/cmd/upas/common/common.h
index f7e8ad5e9..c2bc45878 100644
--- a/sys/src/cmd/upas/common/common.h
+++ b/sys/src/cmd/upas/common/common.h
@@ -37,6 +37,7 @@ int shellchars(char*);
String *escapespecial(String*);
String *unescapespecial(String*);
int returnable(char*);
+int temperror(void);
/* folder.c */
Biobuf *openfolder(char*, long);