New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #20735 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

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

comment:1 Changed 4 years ago by telemachus@…

  • Cc telemachus@… added

Cc Me!

comment:2 Changed 4 years ago by jmr@…

  • Cc olaf@…, telemachus@… removed
  • Owner changed from macports-tickets@… to olaf@…
  • Type changed from enhancement to defect

comment:3 Changed 4 years ago by snc@…

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 3 years ago by jmr@…

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

comment:5 Changed 3 years ago by jmr@…

  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.