+ static char buf[100];
+# ifdef SMTP
+ extern char *SmtpPhase;
+ extern char *RealHostName;
+# endif SMTP
+
+# ifdef DAEMON
+# ifdef VMUNIX
+ /*
+ ** Handle special network error codes.
+ **
+ ** These are 4.2/4.3bsd specific; they should be in daemon.c.
+ */
+
+ switch (errno)
+ {
+ case ETIMEDOUT:
+ case ECONNRESET:
+ (void) strcpy(buf, sys_errlist[errno]);
+ if (SmtpPhase != NULL)
+ {
+ (void) strcat(buf, " during ");
+ (void) strcat(buf, SmtpPhase);
+ }
+ if (RealHostName != NULL)
+ {
+ (void) strcat(buf, " with ");
+ (void) strcat(buf, RealHostName);
+ }
+ return (buf);
+
+ case EHOSTDOWN:
+ if (RealHostName == NULL)
+ break;
+ (void) sprintf(buf, "Host %s is down", RealHostName);
+ return (buf);
+
+ case ECONNREFUSED:
+ if (RealHostName == NULL)
+ break;
+ (void) sprintf(buf, "Connection refused by %s", RealHostName);
+ return (buf);
+ }
+# endif VMUNIX
+# endif DAEMON