Fix full name support, thanks zandbelt (#1578)
authorFlorian Fainelli <florian@openwrt.org>
Tue, 10 Apr 2007 10:36:51 +0000 (10:36 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Tue, 10 Apr 2007 10:36:51 +0000 (10:36 +0000)
SVN-Revision: 6919

net/mini_sendmail/Makefile
net/mini_sendmail/patches/200-fullname.patch [new file with mode: 0644]

index 5ad7d4c2f9f399fd2957c42fafe0284c65d85796..596eaac203e9ce28c64e4902f019810609694f9c 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mini-sendmail
 PKG_VERSION:=1.3.5
 
 PKG_NAME:=mini-sendmail
 PKG_VERSION:=1.3.5
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=mini_sendmail-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.acme.com/software/mini_sendmail/
 
 PKG_SOURCE:=mini_sendmail-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.acme.com/software/mini_sendmail/
diff --git a/net/mini_sendmail/patches/200-fullname.patch b/net/mini_sendmail/patches/200-fullname.patch
new file mode 100644 (file)
index 0000000..b22916f
--- /dev/null
@@ -0,0 +1,34 @@
+--- mini_sendmail-1.3.5.org/mini_sendmail.c    2003-11-17 03:03:35.000000000 +0100
++++ mini_sendmail-1.3.5/mini_sendmail.c        2007-04-08 19:46:42.000000000 +0200
+@@ -539,6 +539,7 @@
+       }
+     /* Strip off any angle brackets. */
++/*
+     while ( len > 0 && *recipient == '<' )
+       {
+       ++recipient;
+@@ -548,6 +549,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 )