aboutsummaryrefslogtreecommitdiffstats
path: root/smtp.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1998-05-25 15:03:38 +0000
committerEric S. Raymond <esr@thyrsus.com>1998-05-25 15:03:38 +0000
commitc8c8573eb8e36f98deb5672244af5b609abe5cc3 (patch)
tree73433e8220e94641d4cff9cb57faf7d4896d50b7 /smtp.c
parent0ac2d52e1c3b7f54846683d2b918e228af7b4073 (diff)
downloadfetchmail-c8c8573eb8e36f98deb5672244af5b609abe5cc3.tar.gz
fetchmail-c8c8573eb8e36f98deb5672244af5b609abe5cc3.tar.bz2
fetchmail-c8c8573eb8e36f98deb5672244af5b609abe5cc3.zip
Don't <-enclose MAIL FROM name if it already contains one.
svn path=/trunk/; revision=1824
Diffstat (limited to 'smtp.c')
-rw-r--r--smtp.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/smtp.c b/smtp.c
index 651f943d..bb97827d 100644
--- 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)