opnsense-ports/mail/mini_sendmail/files/patch-mini_sendmail.c
Franco Fichtner 8cb1a96ede ports: pull in a snapshot of the FreeBSD ports tree
Taken from:	https://github.com/freebsd/freebsd-ports.git
Commit id:	5070672073b68be364139bc6b3a89100bd17d331
2014-11-09 14:03:21 +01:00

36 lines
956 B
C

--- mini_sendmail.c.orig 2005-06-29 19:37:15.000000000 +0200
+++ mini_sendmail.c 2008-11-02 17:09:53.000000000 +0100
@@ -542,6 +542,7 @@
}
/* Strip off any angle brackets. */
+/*
while ( len > 0 && *recipient == '<' )
{
++recipient;
@@ -551,6 +552,23 @@
--len;
(void) snprintf( buf, sizeof(buf), "RCPT TO:<%.*s>", len, recipient );
+*/
+ if (len > 0 && recipient[len-1] == '>' )
+ {
+ /* "<name@domain>" or: "Full Name <name@domain>" */
+ while (len > 0 && *recipient != '<' )
+ {
+ ++recipient;
+ --len;
+ }
+ (void) snprintf( buf, sizeof(buf), "RCPT TO:%.*s", len, recipient );
+ }
+ else
+ {
+ /* name@domain */
+ (void) snprintf( buf, sizeof(buf), "RCPT TO:<%.*s>", len, recipient );
+ }
+
send_command( buf );
status = read_response();
if ( status != 250 && status != 251 )