Message-Id should include a hostname
Brought to you by:
brunoga,
nwhitehorn
According to RFC822 a message-id should be made of a
local part and a hostname.On a test email I sent
myself, the hostname is missing:
To: daixiwen@daixiwen.net
Subject: essai
X-Mailer: BeMail - Mail Daemon Replacement 3.0.0 Final
From: "Sylvain Tertois" <sylvain@becoz.org>
Date: Wed, 05 Jan 2005 11:47:49 +0100 CET
Message-Id: <9578016030-BeMail@>
Mime-Version: 1.0
Content-Type: text/plain; charset="windows-1252"
Content-Transfer-Encoding: 7bit
Logged In: YES
user_id=27501
It sure does work here. Are you sure you've set the hostname
correctly?
This is what the code in question looks like:
message_id << "<";
message_id << system_time();
message_id << "-BeMail@";
#if BONE
utsname uinfo;
uname(&uinfo);
message_id << uinfo.nodename;
#else
char host[255];
gethostname(host,255);
message_id << host;
#endif
What version of BeOS are you using?
Logged In: YES
user_id=631611
This is odd...
I'm using BeOS 5.0.3 Pro with Bone-7a
Hostname and uname seem to be correctly set:
Welcome to the BeOS shell.
$ hostname
odin
$ uname -n
odin
I compiled and run this C program:
#include <unistd.h>
#include <stdio.h>
#include <sys/utsname.h>
main()
{
utsname uinfo;
char host[255];
uname(&uinfo);
printf("uinfo.nodename:'%s'\n",uinfo.nodename);
gethostname(host,255);
printf("gethostname:'%s'\n",host);
}
And here is the result:
$ ./test
uinfo.nodename:'odin'
gethostname:'odin'
Am I using the right version of Bemail? I'm using the
december 9th version from bebits
Logged In: YES
user_id=428482
Looks like a new bug. In 2.3.1 it inserts my system's host name
correctly. Maybe something got broken in 3.x? Also, Bruno was
having problems too, with his apparent host name containing NUL
characters in the e-mail headers. Suspicious.
- Alex