- Teach -c toggle to behave as described in man page

PR:		ports/63324
Submitted by:	Malcolm Kay <malcolm.kay@internode.on.net>
This commit is contained in:
Pav Lucistnik 2004-05-26 17:57:10 +00:00
parent e784a33567
commit 7eaa211d56
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=110080
2 changed files with 26 additions and 2 deletions

View File

@ -7,6 +7,7 @@
PORTNAME= smtpclient
PORTVERSION= 1.0.0
PORTREVISION= 1
CATEGORIES= mail
MASTER_SITES= http://www.engelschall.com/sw/smtpclient/distrib/

View File

@ -1,5 +1,5 @@
--- smtpclient_main.c.orig Wed Aug 1 15:25:22 2001
+++ smtpclient_main.c Wed Aug 1 15:33:07 2001
--- smtpclient_main.c.orig Tue Feb 24 11:49:07 2004
+++ smtpclient_main.c Tue Feb 24 12:47:11 2004
@@ -86,7 +86,7 @@ void log(char *str, ...)
char buf[1024];
@ -29,3 +29,26 @@
}
from_addr = strdup(buf);
}
@@ -453,8 +453,20 @@ int main(int argc, char **argv)
chat("MAIL FROM: <%s>\r\n", from_addr);
for (i = optind; i < argc; i++)
chat("RCPT TO: <%s>\r\n", argv[i]);
- if (cc_addr)
- chat("RCPT TO: <%s>\r\n", cc_addr);
+ if (cc_addr) {
+ char *cc_tmp,*p;
+ if(!(cc_tmp=malloc(strlen(cc_addr+1)))) {
+ log("memory allocation failed.");
+ exit(1);
+ }
+ strcpy(cc_tmp,cc_addr);
+ p=strtok(cc_tmp,",");
+ while(p) {
+ chat("RCPT TO: <%s>\r\n", p);
+ p=strtok(NULL,",");
+ }
+ free(cc_tmp);
+ }
chat("DATA\r\n");
/*