[SOLVED] Does some spec require a space-padded day-of-month in the From line that separates messages in an mbox file?
Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
• 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.
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]
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.
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
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.