Opened 15 years ago

Closed 14 years ago

#20735 closed defect (fixed)

ssmtp 2.61 produces bad dates

Reported by: telemachus@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 1.7.1
Keywords: Cc:
Port: ssmtp

Description

The current version of ssmtp produces dates like the following:

Date: Wed, _d Aug 2009 06:32:00 -0400

The '_d' can be traced back to arpadate.c, line 82:

const char *format = "%a, %_d %b %Y %H:%M:%S %z";

Apparently %_d wants to produce a date with a leading space for single digits, but the format isn't universally recognized. So what actually gets printed is '_d' for every date. (See this post: http://www.cygwin.com/ml/cygwin/2004-02/msg00031.html)

MacPorts seems to get the source for ssmtp from Debian, and the current Debian stable version (2.62) has changed the formatting string to use %d. On OS X, I think that %e would work as well.

Thanks in advance

Change History (5)

comment:1 Changed 15 years ago by telemachus@…

Cc: telemachus@… added

Cc Me!

comment:2 Changed 15 years ago by jmroot (Joshua Root)

Cc: olaf@… telemachus@… removed
Owner: changed from macports-tickets@… to olaf@…
Type: enhancementdefect

comment:3 Changed 15 years ago by nerdling (Jeremy Lavergne)

Either a reinplace or a patch would suffice for this.

    reinplace s|const char *format = "%a, %_d %b %Y %H:%M:%S %z";|const char *format = "%a, %e %b %Y %H:%M:%S %z";| ${worksrcpath}/arpadate.c
--- arpadate.c.orig	2009-08-23 09:53:27.000000000 -0400
+++ arpadate.c	2009-08-23 09:53:38.000000000 -0400
@@ -79,7 +79,7 @@
 	time_t now;
 
 	/* RFC822 format string borrowed from GNU shellutils date.c */
-	const char *format = "%a, %_d %b %Y %H:%M:%S %z";
+	const char *format = "%a, %e %b %Y %H:%M:%S %z";
 
 	now = time(NULL);
 

comment:4 Changed 14 years ago by jmroot (Joshua Root)

Keywords: ssmtp date removed
Owner: changed from olaf@… to macports-tickets@…

comment:5 Changed 14 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.