Postfix can return addresses without <>.

--- a/src/sm-archive.cpp
+++ b/src/sm-archive.cpp
@@ -135,14 +135,26 @@ void my_syslog(const char *text) {
 // always be enclosed in <>. It may have mixed case, just
 // as the mail client sent it. We dup the string and convert
 // the duplicate to lower case.
+// Postfix will return addresses without <> if they have been provided
+// this way in the SMTP dialog.
 //
 const char *to_lower_string(const char *email);
 const char *to_lower_string(const char *email) {
-	int n = strlen(email)-2;
-	if (n < 1) return strdup(email);
-	char *key = strdup(email+1);
-	key[n] = '\0';
-	for (int i=0; i<n; i++) key[i] = tolower(key[i]);
+	char *key, *p;
+	int i;
+
+	if (strcmp(email, "<>") == 0)
+		return strdup(email);
+	if (email[0] == '<')
+		p = (char *) email + 1;
+	else
+		p = (char *) email;
+	key = (char *) malloc(strlen(p) + 1);
+	for (i = 0; p[i] != '\0'; i++)
+		key[i] = tolower(p[i]);
+	if (p[i - 1] == '>')
+		i--;
+	key[i] = '\0';
 	return key;
 }
 
