Cleanup libmpcdev Makefile.
[openwrt/svn-archive/archive.git] / mail / mini_sendmail / patches / 200-fullname.patch
1 Index: mini_sendmail-1.3.6/mini_sendmail.c
2 ===================================================================
3 --- mini_sendmail-1.3.6.orig/mini_sendmail.c 2007-08-28 17:58:37.000000000 +0200
4 +++ mini_sendmail-1.3.6/mini_sendmail.c 2007-08-28 17:58:37.000000000 +0200
5 @@ -542,6 +542,7 @@
6 }
7
8 /* Strip off any angle brackets. */
9 +/*
10 while ( len > 0 && *recipient == '<' )
11 {
12 ++recipient;
13 @@ -551,6 +552,23 @@
14 --len;
15
16 (void) snprintf( buf, sizeof(buf), "RCPT TO:<%.*s>", len, recipient );
17 +*/
18 + if (len > 0 && recipient[len-1] == '>' )
19 + {
20 + /* "<name@domain>" or: "Full Name <name@domain>" */
21 + while (len > 0 && *recipient != '<' )
22 + {
23 + ++recipient;
24 + --len;
25 + }
26 + (void) snprintf( buf, sizeof(buf), "RCPT TO:%.*s", len, recipient );
27 + }
28 + else
29 + {
30 + /* name@domain */
31 + (void) snprintf( buf, sizeof(buf), "RCPT TO:<%.*s>", len, recipient );
32 + }
33 +
34 send_command( buf );
35 status = read_response();
36 if ( status != 250 && status != 251 )