]> Pileus Git - ~andy/fetchmail/commitdiff
Don't <-enclose MAIL FROM name if it already contains one.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 25 May 1998 15:03:38 +0000 (15:03 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 25 May 1998 15:03:38 +0000 (15:03 -0000)
svn path=/trunk/; revision=1824

smtp.c

diff --git a/smtp.c b/smtp.c
index 651f943d11e2952e704998c8c74e48ab1dd5bea8..bb97827dfb5e275724d07ef19bba4c9f303cac92 100644 (file)
--- a/smtp.c
+++ b/smtp.c
@@ -81,17 +81,20 @@ int SMTP_ehlo(int sock, char *host, int *opt)
 int SMTP_from(int sock, char *from, char *opts)
 /* send a "MAIL FROM:" message to the SMTP listener */
 {
-  int ok;
-  char buf[MSGBUFSIZE];
-
-  sprintf(buf, "MAIL FROM:<%s>", from);
-  if (opts)
-      strcat(buf, opts);
-  SockPrintf(sock,"%s\r\n", buf);
-  if (outlevel == O_VERBOSE)
-      error(0, 0, "SMTP> %s", buf);
-  ok = SMTP_ok(sock);
-  return ok;
+    int ok;
+    char buf[MSGBUFSIZE];
+
+    if (strchr(from, '<'))
+       sprintf(buf, "MAIL FROM: %s", from);
+    else
+       sprintf(buf, "MAIL FROM:<%s>", from);
+    if (opts)
+       strcat(buf, opts);
+    SockPrintf(sock,"%s\r\n", buf);
+    if (outlevel == O_VERBOSE)
+       error(0, 0, "SMTP> %s", buf);
+    ok = SMTP_ok(sock);
+    return ok;
 }
 
 int SMTP_rcpt(int sock, char *to)