MAILDIRWATCH(1)

πŸ“¦
version 4.0.4 Β· 2 versions
, in nixpkgs unstable, ubuntu stonking

πŸ‘‘ MAILDIRWATCH(1) πŸ‘‘

okay bestie, so this page ships with S. Varshavchik's manual, and it's fr fr one of those little tools that lowkey runs your whole mail-life. like, it's maildirwatch, and she waits for changes to a maildir. that's the whole vibe. πŸ’–


✨ NAME ✨

maildirwatch β€” wait for changes to a maildir 🌸


✨ SYNOPSIS ✨

maildirwatch {maildir} {command} [argument...]

like literally that's it. maildir, then command, then whatever args your command needs. slay. πŸ’…


✨ DESCRIPTION ✨

so maildirwatch repeatedly invokes command β€” with any of those optional argument...s you handed over, it's an external command bestie β€” and she does it like this:

  • The very first time command gets executed is immediately after maildirwatch starts. no waiting, no warming up, she's on it. ⚑
  • Every other invocation of command happens whenever there may be some kind of a change to the contents of the maildir. "may be" is doing a LOT of heavy lifting there, keep reading.

okay so here's the tea β˜•: maildirwatch does not determine what, if anything, changed in the maildir. like, she does not know. she's not nosy like that. maildirwatch might occasionally raise a false alarm and run the command even though nothing actually changed β€” but that's rare, ngl, it's giving rare actually.

and it's also possible that by the time command actually runs, whatever was changed in the maildir is no longer changed; it became what it was before it was changed. a mystery that will remain unsolved forever. πŸ’€ like genuinely, forever. nobody's solving that one. not today, not ever.

so yeah β€” it's up to the command to intelligently figure out if it needs to do something about whatever it finds in the maildir. she hands you the maildir, you do the thinking. main character energy, honestly. 🫢

maildirwatch is a rudimentary mechanism for writing shell scripts that deal with newly-delivered mail, in some form or fashion. rudimentary = simple, not fancy, but she WORKS and we love her. ✨


✨ EXIT CODE ✨

a non-zero exit code means the specified maildir does not exist or is corrupted. 🚨 like girl, something's wrong, she can't even.

otherwise (so, if the maildir is fine), maildirwatch runs until the command exits with a non-zero exit code. at that point:

  • maildirwatch prints command's exit code on standard output, and
  • terminates with an exit code of 0.

so maildirwatch herself is always the chill one, exiting clean at 0, while she tells you what the command said. πŸ‘‘

careful bestie: a non-zero exit from maildirwatch means the maildir doesn't exist or is corrupted β€” not that your command failed. don't get it twisted. πŸ’…

✨ SEE ALSO ✨


✨ AUTHOR ✨

Sam Varshavchik : Author πŸ’–


✨ NOTES ✨

  1. maildirmake(1) β€” [set $man.base.url.for.relative.links]/maildirmake.html 🌈

and that's the whole page, bestie! this one came from Courier Mail Server and it's stamped 01/10/2026 β€” that's the source, the version, and the date, all rolled into one cute little sign-off. go watch some maildirs. iykyk. πŸ¦‹βœ¨πŸ’œ

πŸ“¦ where this page comes from