On Sat, 2007-05-05 at 14:23 -0700, Ask Bjørn Hansen wrote:
> If we want to set LANG={undef,C}, I think we should do it from the  
> run/init.d script and just have qpsmtpd warn if it's set and not to C.

Agreed.

> 
> Another option, saner seeming by now, is to just explicitly format  
> the dates we generate ...

How "explicit"?  

I used to write my own date code until I discovered 'strftime' in POSIX
but that is affected by LANG settings.  My 'perldoc POSIX' claims these:
        aAbBcdHIjmMpSUwWxXyYZ%
are portable (C89 'to be safe') but that these:
        aAbBcpZ
are locale-dependent with 'Z' being "notoriously" so.  It says:
        Sticking to the numeric specifiers is the safest route.

What do the SMTP RFCs say about date formats in mail headers?  If they
specify ASCII/English then LANG=C is sufficient ... let me see ...
RFC 2822, section 3.3 specifies English 3-letter abreviations for day
and month names and specifies that:

        A date-time specification MUST be semantically valid.  That is, the
        day-of-the-week (if included) MUST be the day implied by the date,
        the numeric day-of-month MUST be between 1 and the number of days
        allowed for the specified month [etc]

It has some rules for numeric formats ... I suspect that 'strftime' with
LANG=C is consistent with this and rolling your own would be a fair bit
of work to get everything correct.

RFC 2822 does say that time zones should be represented as offsets from
gmtime ... my own notes say that 'z' gives this but this is not in the
portable list from POSIX and my notes say:

        # z numeric time-zone RFC 822/ISO 8601:1988 ( ISO C99 and POSIX.1-2001)

I can't remember where I dredged all the details from ... ah, the libc info 
pages
are the source where details are missing from perloc POSIX.


> 

-- 
--gh


Reply via email to