q2K BHP
Black History Portal
THE BHP WIRE —
HIDDEN TRUTHS
What's New!
THE JOURNEY THROUGH TIME

Explore Black History

Explore the people, places, events, achievements, struggles and stories that shaped our journey.

✊🏾

Civil Rights

Movements, leaders, victories and the continuing fight for equality.

⚙️

Black Inventors

Innovation, patents, science, technology and world-changing contributions.

🏆

Sports

Pioneers, champions, Negro Leagues, records, activism and excellence.

♟️

People

Meet the people whose lives, choices and achievements shaped the journey.

📍

Places

Black towns, communities, institutions and places where history happened.

📜

Events

Moments that changed communities, movements, institutions and the nation.

Enter a person, place, event, or topic.
MY'STORY

The MOVE Fire

This is a personal recollection on the Move fire on May 13, 1985 Philadelphia police fired thousands of rounds at the MOVE house, city officials approved dropping an explosive device on the roof, the resulting fire was allowed to burn, 11 people—including five children—died, and 61 homes were destroyed. Philadelphia City Council later called it a “brutal attack carried out by the City of Philadelphia on its own citizens” and acknowledged that no individual faced criminal consequences for the bombing. One timeline correction worth preserving for the BHP record: the major previous MOVE-police confrontation was August 8, 1978, about seven years before the bombing, not a year or two earlier. Officer James Ramp was killed, other police and firefighters were wounded, nine MOVE members were later convicted, and television cameras recorded police beating Delbert Africa during his arrest. The 1985 MOVE Commission later specifically criticized city planners for failing to adequately use lessons from that 1978 confrontation. And that actually strengthens the point you’re making: 1985 did not happen without precedent or institutional memory. There had already been a deadly confrontation with MOVE, years of conflict, negotiations and police involvement before Osage Avenue.

MORE →
BLACK FACTS
The Truths They Never Taught You...

Katherine Johnson — Mathematics to the Moon

Katherine Johnson’s mathematical calculations helped guide some of America’s most important early space missions while she confronted the racial and gender barriers faced by Black women in twentieth-century America.

MORE →
BHP gathered finds from its connected research sources. Showing the 4 strongest Black History matches.
← BACK TO RESULTS
Wikipedia

Maildir

Maildir
Filename extensionNone; a directory structure
Internet media typeNone registered
Developed byDaniel J. Bernstein
Initial release1995; 31 years ago (1995)
Type of formatEmail mailbox storage
Container forEmail messages in RFC 5322 form
Extended toMaildir++
StandardDe facto, per Bernstein's Using maildir format
Websitecr.yp.to/proto/maildir.html

The Maildir e-mail format is a common way of storing email messages on a file system, rather than in a database. Each message is assigned a file with a unique name, and each mail folder is a file system directory containing these files. Maildir was designed by Daniel J. Bernstein circa 1995, with a major goal of eliminating the need for program code to handle file locking and unlocking through use of the local filesystem.[1] Maildir design reflects the fact that the only operations valid for an email message is that it be created, deleted or have its status changed in some way.

Internal structure

Specifications

[edit]

A Maildir directory (often named Maildir) usually has three subdirectories named tmp, new, and cur.[2]

  • The tmp subdirectory temporarily stores e-mail messages that are in the process of being delivered. This subdirectory may also store other kinds of temporary files.
  • The new subdirectory stores messages that have been delivered, but have not yet been seen by any mail application.
  • The cur subdirectory stores messages that have already been seen by mail applications.[3]

Maildir++

[edit]

Sam Varshavchik, the author of the Courier Mail Server and other software, defined the Maildir++ extension[3][4] to the Maildir format to support subfolders and mail quotas. Maildir++ directories contain subdirectories with names that start with a '.' (dot) which are also Maildir++ folders. The extension complies with the original Maildir specification, which allows for subdirectories in addition to tmp, new and cur.

Technical operation

[edit]

A mail delivery agent is a program that delivers an email message into a Maildir. The mail delivery agent creates a new file with a unique filename in the tmp directory.[5][6][3] At the time of its invention guaranteeing unique filenames efficiently was difficult. The original qmail[1] algorithm for unique names was:

  1. read the current Unix time
  2. read the current process identifier (PID)
  3. read the current hostname
  4. concatenate the above three values into a string separated by the period character; this is the new filename
  5. if stat() reports that the filename exists, then wait two seconds
  6. go to previous step until the filename does not exist
  7. create a file with the unique filename and write the message contents to the new file

By 2000, the qmail author recommended in an updated specification[5] to append the value of a per-process counter to the PID, whose value should be incremented after each delivery. The rate-limiting recommendation to "wait two seconds" was dropped.

By 2003, the recommendations had been further amended to require that instead of the PID and counter, the middle part of the filename should be created by "concatenating enough of the following strings to guarantee uniqueness" even in the face of multiple simultaneous deliveries to the same maildir from one or more processes:[7]

  • #n, where n is (in hexadecimal) the output of the operating system's unix_sequencenumber() system call, which returns a number that increases by 1 every time it is called, starting from 0 after reboot.
  • Xn, where n is (in hexadecimal) the output of the operating system's unix_bootnumber() system call, which reports the number of times that the system has been booted. Together with #, this guarantees uniqueness; unfortunately, most operating systems don't support unix_sequencenumber() and unix_bootnumber().
  • Rn, where n is (in hexadecimal) the output of the operating system's unix_cryptorandomnumber() system call or an equivalent source, such as /dev/urandom. Unfortunately, some operating systems don't include cryptographic random number generators.
  • In, where n is (in hexadecimal) the UNIX inode number of this file. Unfortunately, inode numbers aren't always available through NFS.
  • Vn, where n is (in hexadecimal) the UNIX device number of this file. Unfortunately, device numbers aren't always available through NFS. (Device numbers are also not helpful with the standard UNIX filesystem: a maildir has to be within a single UNIX device for link() and rename() to work.)
  • Mn, where n is (in decimal) the microsecond counter from the same gettimeofday() used for the left part of the unique name.
  • Pn, where n is (in decimal) the process ID.
  • Qn, where n is (in decimal) the number of deliveries made by this process.

This 2003 algorithm was criticised[8] in 2006 as being unnecessarily complex by Timo Sirainen, the creator of Dovecot.

As of November 2023, qmail author Daniel Bernstein had made no further changes to the 2003 filename generation recommendations.[9] On modern POSIX systems, temporary files can be safely created with the mkstemp C library function.

The delivery process stores the message in the maildir by creating and writing to tmp/uniquefilename, and then moving this file to new/uniquefilename. The moving can be done using rename, which is atomic in many systems.[10] Alternatively, it can be done by hard-linking the file to new and then unlinking the file from tmp. Any leftover file will eventually be deleted. This sequence guarantees that a maildir-reading program will not see a partially written message. There can be multiple programs reading a maildir at the same time. They range from mail user agents (MUAs), which access the server's file system directly, through Internet Message Access Protocol or Post Office Protocol servers acting on behalf of remote MUAs, to utilities such as biff and rsync, which may or may not be aware of the maildir structure. Readers should never look in tmp.

When a cognizant maildir-reading process (either a POP or IMAP server, or a mail user agent acting locally) finds messages in the new directory, it must move them to cur. It is just a means to notify the user "you have X new messages".[11] This moving needs to be done using the atomic filesystem rename(), as the alternative link-then-unlink technique is non-atomic and may result in duplicated messages. An informational suffix is appended to filenames at this stage. It consists of a colon (to separate the unique part of the filename from the actual information), a "2", a comma and various flags. The "2" specifies the version of the information that follows the comma. "2" is the only currently[when?] officially specified version, "1" being an experimental version. The specification defines flags that show whether the message has been read, deleted and so on: the initial (capital) letter of "Passed", "Replied", "Seen", "Trashed", "Draft", and "Flagged".[7] Applications often choose to supplement this very limited set of flags, for example notmuch[12] offers flag synchronization in addition to arbitrary user-defined flags,[13] while Dovecot uses lowercase letters to match 26 IMAP keywords,[6] which may include keywords such as $MDNSent or user-defined flags.

Although Maildir was intended to allow lockless usage, in practice some software that uses Maildirs also uses locks, such as Dovecot.[14]

File-system compatibility issues

[edit]

The Maildir standard can only be implemented on systems that accept colons in filenames.[15]

Systems that do not allow colons in filenames (this includes Microsoft Windows and some configurations of Novell Storage Services) can use a non-standard alternative separator, such as ";" or "-". It is often trivial to patch free and open-source software to use a different separator.[16]

As there is currently[when?] no agreement on what character this alternative separator should be, there can be interoperability difficulties between different Maildir-supporting programs on these systems. However, not all Maildir-related software needs to know what the separator character is, because not all Maildir-related software needs to be able to read or modify the flags of a message ("read", "replied to" etc.); software that merely delivers to a Maildir or archives old messages from it based only on date, should work no matter what separator is in use. If only the MUA needs to read or modify message flags, and only one MUA is used, then non-standard alternative separators may be used without interoperability problems.

Software that supports Maildir directly

[edit]

Mail servers

[edit]

Delivery agents

[edit]

Mail readers

[edit]
  • aerc[17] (efficient and extensible email client)
  • Balsa previously the official GNOME mail reader (prior to Evolution)
  • Cone a curses-based mail reader
  • Evolution, official GNOME mail client
  • GNUMail
  • Gnus
  • Himalaya – Command-line email interface, from the Pimalaya Rust project
  • KMail, KDE mail reader
  • mailx
  • Mutt
  • Notmuch[12] (fast, global-search and tag-based email system)
  • Pine/Alpine
  • meli – Terminal email client written in Rust
  • Mozilla Thunderbird – experimental and “disabled by default because there are still many bugs” [18]

See also

[edit]

Notes and references

[edit]
  1. ^ a b Bernstein, Daniel J. (1995). "maildir(5)". Archived from the original on 1997-10-12. Retrieved 2018-11-23.
  2. ^ Blum, Richard (2001). Postfix. Sams Publishing. ISBN 978-0-672-32114-6.
  3. ^ a b c Varshavchik, Sam (2009). "maildir(5)". Archived from the original on 2024-04-17. Retrieved 2024-08-09.
  4. ^ Varshavchik, Sam (2011). "Maildir++". Archived from the original on 2024-05-29. Retrieved 2024-08-09.
  5. ^ a b Bernstein., Daniel J. (c. 2000) [First published 2000 or earlier]. "Using maildir format". Archived from the original on 2000-09-02. Retrieved 2018-11-23.
  6. ^ a b Dovecot Wiki: maildir format
  7. ^ a b Bernstein., Daniel J. (2003) [The earliest version of this document was first published in 2000 or earlier]. "Using maildir format". Archived from the original on 2003-04-01. Retrieved 2018-11-23.
  8. ^ Sirainen, Timo. "Maildir Mailbox Format: Mail Delivery'". Archived from the original on 2024-06-24. Retrieved 2024-08-09. All this trouble is rather pointless. Only the first step is what really guarantees that the mails won't get overwritten, the rest just sounds nice. Even though they might catch a problem once in a while, they give no guaranteed protection and will just as easily pass duplicate filenames through and overwrite existing mails.¶ Step 2 is pointless because there's a race condition between steps 2 and 3. PID/host combination by itself should already guarantee that it never finds such a file. If it does, something's broken and the stat() check won't help since another process might be doing the same thing at the same time, and you end up writing to the same file in tmp/, causing the mail to get corrupted.¶ In step 4 the link() would fail if an identical file already existed in the Maildir, right? Wrong. The file may already have been moved to cur/ directory, and since it may contain any number of flags by then you can't check with a simple stat() anymore if it exists or not.¶ Step 2 was pointed out to be useful if clock had moved backwards. However, this doesn't give any actual safety guarantees because an identical base filename could already exist in cur/. Besides if the system was just rebooted, the file in tmp/ could probably be even overwritten safely (assuming it wasn't already link()ed to new/).¶ So really, all that's important in not getting mails overwritten in your Maildir is step 1: Always create filenames that are guaranteed to be unique. Forget about the 2 second waits and such that the Qmail's man page talks about.
  9. ^ "Wayback Machine snapshots of cr.yp.to/proto/maildir.html". Internet Archive. 2023. Archived from the original on 2023-05-03. Retrieved 2023-11-23. {{cite web}}: Cite uses generic title (help)CS1 maint: bot: original URL status unknown (link)
  10. ^ "rename". The Open Group. 2013. Retrieved 23 July 2016. That specification requires that the action of the function be atomic.
  11. ^ Varshavchik, Sam (25 July 2016). "Management of maildir structures". courier-users (Mailing list). Retrieved 26 July 2016.
  12. ^ a b "Notmuch mail system homepage". notmuchmail.org. Retrieved 2019-06-22.
  13. ^ "notmuch 0.38.3 documentation". notmuch-config. Retrieved 2024-04-17.
  14. ^ Sirainen, Timo. "Maildir Mailbox Format: Locking". Archived from the original on 2024-06-24. Retrieved 2024-08-09.
  15. ^ "mailbox — Manipulate mailboxes in various formats". Python documentation. Retrieved 2023-06-19.
  16. ^ mutt maildir support: workaround for filesystems that don't accept colons
  17. ^ "aerc - the world's best email client homepage". aerc-mail.org.
  18. ^ "Maildir in Thunderbird". mozilla.org. Retrieved 2020-12-06.
[edit]

Source: Wikipedia. Article content is retrieved live through the MediaWiki API.

No preview image
Wikipedia

OpenSMTPD

OpenSMTPD (also known as OpenBSD SMTP Server) is a Unix daemon implementing the Simple Mail Transfer Protocol to deliver messages on a local machine or to relay them to other SMTP servers. It was publicly released on 17 March 2013 with version number 5.3, after being in development since late 2008. OpenSMTPD is primarily developed by Gilles Chehade, Eric Faurot and Charles Longeau as part of the OpenBSD project. Its design goals include security, reliability, ease of configuration, and support for common use cases. The source code is available under the ISC license. Its portable version, like that of OpenSSH, is developed as a child project which adds the portability code to the OpenBSD version and releases it separately. The portable version was initiated by Charles Longeau and adds support for multiple operating systems including NetBSD, FreeBSD, DragonFly BSD, and several Linux distributions.

MORE →
Wikipedia

Maildir

The Maildir e-mail format is a common way of storing email messages on a file system, rather than in a database. Each message is assigned a file with a unique name, and each mail folder is a file system directory containing these files. Maildir was designed by Daniel J. Bernstein circa 1995, with a major goal of eliminating the need for program code to handle file locking and unlocking through use of the local filesystem. Maildir design reflects the fact that the only operations valid for an email message is that it be created, deleted or have its status changed in some way.

MORE →
Wikipedia

OpenBSD

OpenBSD is a security-focused, free software, Unix-like operating system based on the Berkeley Software Distribution (BSD). Theo de Raadt created OpenBSD in 1995 by forking NetBSD 1.0. The OpenBSD project emphasizes portability, standardization, correctness, proactive security, and integrated cryptography. The OpenBSD project maintains portable versions of many subsystems as packages for other operating systems. Because of the project's preferred BSD license, which allows binary redistributions without the source code, many components are reused in proprietary and corporate-sponsored software projects. The firewall code in Apple's macOS is based on OpenBSD's PF firewall code, Android's Bionic C standard library is based on OpenBSD code, LLVM uses OpenBSD's regular expression library, and Windows 10 uses OpenSSH (OpenBSD Secure Shell) with LibreSSL. The word "open" in the name OpenBSD refers to the availability of the operating system source code on the Internet, although the word "open" in the name OpenSSH means "OpenBSD". It also refers to the wide range of hardware platforms the system supports. OpenBSD supports a variety of system architectures including x86-64, IA-32, ARM, PowerPC, and 64-bit RISC-V. Its default GUI is FVWM on X11.

MORE →
No preview image
Wikipedia

Simple Mail Transfer Protocol

The Simple Mail Transfer Protocol (SMTP) is an Internet standard communication protocol for electronic mail transmission. Mail servers and other message transfer agents use SMTP to send and receive mail messages. User-level email clients typically use SMTP only for sending messages to a mail server for relaying, and typically submit outgoing email to the mail server on port 465 or 587 per RFC 8314. For retrieving messages, IMAP and POP are widely used, but proprietary servers also often implement proprietary protocols, e.g., Exchange ActiveSync. SMTP's origins began in 1980, building on concepts implemented on the ARPANET since 1971. It has been updated, modified and extended multiple times. The protocol version in common use today has extensible structure with various extensions for authentication, encryption, binary data transfer, and internationalized email addresses. SMTP servers commonly use the Transmission Control Protocol on port number 25 (between servers) and 587 (for submission from authenticated clients), both with or without encryption, and 465 with encryption for submission.

MORE →
TOPIC OF THE DAY

Greenwood / Black Wall Street

Before the 1921 destruction of Tulsa’s Greenwood District, Black residents had created a remarkable center of business and community life. The district included stores, professional offices, entertainment venues and homes owned by Black citizens. Understanding Greenwood means learning what was built—not only what was burned.

MORE →
TRIVIA QUESTION OF THE DAY

Which Black woman became the first elected to the United States Congress?

Shirley Chisholm, elected in 1968.