http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=557725

Patch by Darik Horn <dajhorn@vanadac.com>

--- ssmtp.c.orig	2009-11-23 20:55:11.000000000 +1100
+++ ssmtp.c	2009-11-24 11:02:02.000000000 +1100
@@ -97,6 +97,26 @@ static char hextab[]="0123456789abcdef";
 
 ssize_t outbytes;
 
+#if defined(__APPLE__) || (defined (__SVR4) && defined (__sun))
+/*
+strndup() - Unimplemented by the Solaris libc.
+*/
+char * strndup(char const *s, size_t n)
+{
+	char *new;
+	size_t len;
+	if (s[n-1] != '\0') {
+		len = n;
+	} else {
+		len = strlen(s);
+	}
+	new = malloc(len + 1);
+	if(new == NULL) return NULL;
+	new[len] = '\0';
+	return memcpy(new, s, len);
+}
+#endif
+
 /*
 log_event() -- Write event to syslog (or log file if defined)
 */
