Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
File name of message in maildir format
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
pmatos
Veteran
Veteran


Joined: 06 Jun 2003
Posts: 1246
Location: Eckental, Germany

PostPosted: Fri Aug 20, 2004 1:47 pm    Post subject: File name of message in maildir format Reply with quote

Hi all,

The file names created in the maildir format have some special information or they are just made up so that they do not clash with one another?

Cheers,
_________________
Paulo Matos
Back to top
View user's profile Send private message
devon
l33t
l33t


Joined: 23 Jun 2003
Posts: 943

PostPosted: Fri Aug 20, 2004 4:54 pm    Post subject: Reply with quote

man maildir wrote:
A new unique filename is created using one of two possible forms: ``time.MusecPpid.host'', or
``time.MusecPpid_unique.host''. ``time'' and ``usec'' is the current system time, obtained from get-
timeofday(2). ``pid'' is the process number of the process that is delivering this message to the
maildir. ``host'' is the name of the machine where the mail is being delivered. In the event that the
same process creates multiple messages, a suffix unique to each message is appended to the process id;
preferrably an underscore, followed by an increasing counter. This applies whether messages created by a
process are all added to the same, or different, maildirs. This protocol allows multiple processes run-
ning on multiple machines on the same network to simultaneously create new messages without stomping on
each other.

The filename created in the previous step is checked for existence by executing the stat(2) system call.
If stat(2) results in ANYTHING OTHER than the system error ENOENT, the process must sleep for two sec-
onds, then go back and create another unique filename. This is an extra step to insure that each new
message has a completely unique filename.
Back to top
View user's profile Send private message
pmatos
Veteran
Veteran


Joined: 06 Jun 2003
Posts: 1246
Location: Eckental, Germany

PostPosted: Fri Aug 20, 2004 5:06 pm    Post subject: Reply with quote

All the replies should be like this one... Clear, straight to the point and quoting an authority! Thanks!

devon wrote:
man maildir wrote:
A new unique filename is created using one of two possible forms: ``time.MusecPpid.host'', or
``time.MusecPpid_unique.host''. ``time'' and ``usec'' is the current system time, obtained from get-
timeofday(2). ``pid'' is the process number of the process that is delivering this message to the
maildir. ``host'' is the name of the machine where the mail is being delivered. In the event that the
same process creates multiple messages, a suffix unique to each message is appended to the process id;
preferrably an underscore, followed by an increasing counter. This applies whether messages created by a
process are all added to the same, or different, maildirs. This protocol allows multiple processes run-
ning on multiple machines on the same network to simultaneously create new messages without stomping on
each other.

The filename created in the previous step is checked for existence by executing the stat(2) system call.
If stat(2) results in ANYTHING OTHER than the system error ENOENT, the process must sleep for two sec-
onds, then go back and create another unique filename. This is an extra step to insure that each new
message has a completely unique filename.

_________________
Paulo Matos
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum