Index: files/patch-configure.ac.diff
===================================================================
--- files/patch-configure.ac.diff	(revision 93001)
+++ files/patch-configure.ac.diff	(working copy)
@@ -1,6 +1,6 @@
---- configure.in.orig	2005-12-15 13:37:42.000000000 -0700
-+++ configure.in	2009-09-19 02:11:26.000000000 -0600
-@@ -538,7 +538,7 @@
+--- configure.ac.orig	2010-08-09 15:24:50.000000000 -0500
++++ configure.ac	2012-05-13 21:38:53.000000000 -0500
+@@ -539,7 +539,7 @@
  dnl #########################################################################
  
  AC_REPLACE_FUNCS(strdup strcasecmp strncasecmp memrchr)
Index: files/patch-headers.c
===================================================================
--- files/patch-headers.c	(revision 93001)
+++ files/patch-headers.c	(working copy)
@@ -1,32 +1,19 @@
-*** headers.c.orig	2006-03-30 19:30:35.000000000 +0200
---- headers.c	2006-03-30 19:57:05.000000000 +0200
-***************
-*** 29,36 ****
---- 29,38 ----
-  #include <stdio.h>
-  #include <stdarg.h>
-  #include <string.h>
-+ #include <strings.h>
-  #include <stdlib.h>
-  #include <unistd.h>
-+ #include <sys/time.h>
-  #include <time.h>
-  #include <errno.h>
-  
-***************
-*** 168,174 ****
-      {
-  #ifdef HAVE_GETTIMEOFDAY
-        if (gettimeofday (&tv, NULL) == -1) /* This shouldn't fail ... */
-! 	snprintf (buf, sizeof buf, "%ld.%ld.%d@%s", tv.tv_sec, tv.tv_usec,
-  		  getpid (), message->session->localhost);
-        else /* ... but if it does fall back to using time() */
-  #endif
---- 170,176 ----
-      {
-  #ifdef HAVE_GETTIMEOFDAY
-        if (gettimeofday (&tv, NULL) == -1) /* This shouldn't fail ... */
-! 	snprintf (buf, sizeof buf, "%ld.%d.%d@%s", tv.tv_sec, tv.tv_usec,
-  		  getpid (), message->session->localhost);
-        else /* ... but if it does fall back to using time() */
-  #endif
+--- headers.c.orig	2010-08-09 15:35:19.000000000 -0500
++++ headers.c	2012-05-13 21:33:41.000000000 -0500
+@@ -29,6 +29,7 @@
+ #include <stdio.h>
+ #include <stdarg.h>
+ #include <string.h>
++#include <strings.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <time.h>
+@@ -171,7 +172,7 @@
+     {
+ #ifdef HAVE_GETTIMEOFDAY
+       if (gettimeofday (&tv, NULL) != -1) /* This shouldn't fail ... */
+-	snprintf (buf, sizeof buf, "%ld.%ld.%d@%s", tv.tv_sec, tv.tv_usec,
++	snprintf (buf, sizeof buf, "%ld.%d.%d@%s", tv.tv_sec, tv.tv_usec,
+ 		  getpid (), message->session->localhost);
+       else /* ... but if it does fall back to using time() */
+ #endif
Index: files/patch-configure.in.diff
===================================================================
--- files/patch-configure.in.diff	(revision 93001)
+++ files/patch-configure.in.diff	(working copy)
@@ -1,11 +0,0 @@
---- configure.in.orig	2005-12-15 13:37:42.000000000 -0700
-+++ configure.in	2009-09-19 02:11:26.000000000 -0600
-@@ -538,7 +538,7 @@
- dnl #########################################################################
- 
- AC_REPLACE_FUNCS(strdup strcasecmp strncasecmp memrchr)
--AC_CHECK_FUNCS(strtol uname gethostname gettimeofday)
-+AC_CHECK_FUNCS(strtol uname gethostname gettimeofday snprintf vsnprintf)
- AC_SEARCH_LIBS(socket, socket)
- 
- dnl Conditional check for functions needed in threaded code
Index: Portfile
===================================================================
--- Portfile	(revision 93001)
+++ Portfile	(working copy)
@@ -2,8 +2,7 @@
 
 PortSystem 1.0
 name		libesmtp
-version		1.0.4
-revision	2
+version		1.0.6
 categories	mail
 maintainers	noses.com:noses
 description	ESMTP library
@@ -25,12 +24,18 @@
 master_sites	http://www.stafford.uklinux.net/libesmtp
 use_bzip2	yes
 
-checksums	md5 8b4e8a794adc46268f0c6a0b3fb79486
+checksums           rmd160  7489ef298b56085f8788a3af4d17aed4ef0f1077 \
+                    sha256  d0a61a5c52d99fa7ce7d00ed0a07e341dbda67101dbed1ab0cdae3f37db4eb0b
 
 depends_lib	port:openssl
 
+post-extract {
+    # aclocal: error: couldn't open directory 'm4': No such file or directory
+    file mkdir ${worksrcpath}/m4
+}
+
 patchfiles	patch-auth-client.c patch-errors.c patch-headers.c patch-htable.c \
 		patch-protocol.c patch-rfc2822date.c patch-smtp-auth.c \
-		patch-smtp-tls.c patch-configure.in.diff
+		patch-smtp-tls.c patch-configure.ac.diff
 
 use_autoreconf yes
