LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-10-2018, 01:26 PM   #1
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,953

Rep: Reputation: 270Reputation: 270Reputation: 270
Does some spec require a space-padded day-of-month in the From line that separates messages in an mbox file?


The new mailx complains about From lines that have a single-digit day-of-month. mailx's man page says it uses ctime. ctime's man page says nothing about this. time.h doesn't so specify.

Now, to create a From line I can't just use 'date', but have to specify the whole format.

It's a small thing. I'm just wondering.

Last edited by RandomTroll; 12-10-2018 at 05:22 PM. Reason: Make the title more specific
 
Old 12-10-2018, 02:06 PM   #2
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,708

Rep: Reputation: 2209Reputation: 2209Reputation: 2209Reputation: 2209Reputation: 2209Reputation: 2209Reputation: 2209Reputation: 2209Reputation: 2209Reputation: 2209Reputation: 2209
Please show what you're trying that's not working. AFAIK From lines only contain email addresses...not dates.
 
Old 12-10-2018, 05:20 PM   #3
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,953

Original Poster
Rep: Reputation: 270Reputation: 270Reputation: 270
I refer to rfc4155, the spec for mbox files.
Quote:

• Each message in the mbox database MUST be immediately preceded
by a single separator line, which MUST conform to the following
syntax:

The exact character sequence of "From";

a single Space character (0x20);

the email address of the message sender (as obtained from the
message envelope or other authoritative source), conformant
with the "addr-spec" syntax from RFC 2822;



a single Space character;

a timestamp indicating the UTC date and time when the message
was originally received, conformant with the syntax of the
traditional UNIX 'ctime' output sans timezone (note that the
use of UTC precludes the need for a timezone indicator);

an end-of-line marker.

• Each message in the database MUST be terminated by an empty
line, containing a single end-of-line marker.
I create my own mbox from messages I send. I prepend a line that meets this test, except I don't pad day-of-month. The new mailx complains about single-digit day-of-month. The spec refers to ctime, which doesn't require it, at least as I read the man page.
 
Old 12-10-2018, 06:03 PM   #4
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,708

Rep: Reputation: 2209Reputation: 2209Reputation: 2209Reputation: 2209Reputation: 2209Reputation: 2209Reputation: 2209Reputation: 2209Reputation: 2209Reputation: 2209Reputation: 2209
Ahh. Very Interesting. I had no idea.

I'm sorry, I don't use mbox, I'm a Maildir guy; but perhaps the expanded explanation will draw knowledgeable responses.

['Tho, if the only thing that's changed is the version of mailx, I'd just probably start padding the month...with a fun script to update all the existing entries]
 
Old 12-10-2018, 07:27 PM   #5
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by RandomTroll View Post
I refer to rfc4155, the spec for mbox files.
Hmm, interesting. I never used mailx a lot, but the very first mbox format file I looked at (rather an old one) has this as its first line
Code:
From noreply@linux-mag.com Tue Jun  2 14:26:28 2009
and you see that IT has a double space before the day of month.
(btw, this was from a Linux magazine I was subscribed to at that time, I do not remember exactly what MTA I was using then, but it passed a lot of the university mail processing agents before it reached me). It was retrieved FROM a university (Delft University of Technology) server through imap, though, possibly by evolution.

So certainly at that time having a single digit day of month was no problem.
 
Old 12-10-2018, 09:38 PM   #6
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,953

Original Poster
Rep: Reputation: 270Reputation: 270Reputation: 270
Quote:
Originally Posted by scasey View Post
if the only thing that's changed is the version of mailx, I'd just probably start padding the month...with a fun script to update all the existing entries
I figured that out. I've been using mailx for 30 years. This is the first time I've seen this behavior. I found 2 other bugs in the new maintainer's version, so maybe this was a bug. If it is, other mbox user(s) (is there another?) may have the same problem; if it is, he should fix it. That's why I asked about the ctime spec.

What I use is what date returns. I take that as a sign of what the spec is. To get a space-padded day-of-month, I have to specify every element. It'd be nice if date responded to an environment variable to get its default format.

Quote:
Originally Posted by ehartman View Post
Hmm, interesting. I never used mailx a lot, but the very first mbox format file I looked at (rather an old one) has this as its first line
Code:
From noreply@linux-mag.com Tue Jun  2 14:26:28 2009
So certainly at that time having a single digit day of month was no problem.
That head line has 2 spaces between Jun and 2, what the new version of mailx expects, what old ones didn't
I don't object to accepting it. I ask about requiring it.

Last edited by RandomTroll; 12-10-2018 at 11:55 PM. Reason: Clarification
 
Old 12-11-2018, 12:29 PM   #7
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,953

Original Poster
Rep: Reputation: 270Reputation: 270Reputation: 270
A fellow on the s-mailx list pointed me to the relevant POSIX page http://pubs.opengroup.org/onlinepubs...s/asctime.html which says the day-of-month displayed by %2d , so it is POSIX.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Get first day of last month and last day of last month in bash xowl Linux - Software 18 02-09-2017 09:49 AM
OpenOffice.org Calc formula to check if day is last day of the month win32sux Linux - Software 1 01-19-2009 12:38 PM
Date command - month of year, blank padded? menator Programming 3 06-27-2006 06:00 AM
How do I print using format that padded space between printed value ? Linh Programming 2 06-18-2004 03:22 PM
Starting day of month, month length chrisk5527 Programming 2 03-03-2004 04:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration