EXTSMAIL.EXTERNALS(5)
π EXTSMAIL.EXTERNALS π
okay so this is the extsmail.externals page, from the File Formats Manual section β it's a file formats situation, manual 5, iykyk. sit down bestie, we're configuring which external commands send your mail, robustly. β¨
β¨ NAME β¨
extsmail.externals β the config file where you tell things which external commands to robustly send e-mail via π¦
πΈ DESCRIPTION πΈ
So extsmail.externals is literally the file that configures extsmaild(1). π
It's made up of one or more group declarations. Each group is zero or more match / reject clauses, and then one or more external declarations. And an external is just one or more assignments of key = value pairs. that's it, that's the whole structure. π
When it's actually sending messages, extsmaild(1) does this: first it searches through the externals file, in order, looking for a group whose match / reject clauses match the message in question. π If a group doesn't have any of those clauses, it just automatically matches all messages β no cap, it's a yes-man. Match / reject clauses currently only match against headers, and they use standard POSiX extended regular expressions (peep re_format(7) for the deets). Then extsmaild(1) tries each external in the group, in order, to send the message successfully. slay. π
The grammar for this file is, fr fr, exactly this:
group ::= { matches* external+ }
matches ::= match
| reject
match ::= MATCH HEADER string
reject ::= REJECT HEADER string
external ::= EXTERNAL ID { defn+ }
defn ::= ID = STRING
| ID = TIME
TIME ::= [0-9]+[dhms]
Valid assignments within an external are these two cuties π:
sendmailβ defines the external shell command used to send e-mail. that's the one doing the actual work, main character energy fr.timeoutβ ifextsmaild(1)is running in daemon mode, this value sets the length of timeextsmaild(1)will retry this external before giving up and trying the next external in the group. π Times are written as a number followed byd(days),h(hours),m(minutes), ors(seconds). But heads up bestie β ifextsmaild(1)is running in batch mode, thetimeoutvalue is ignored. periodt.
π FILES π
The extsmail configuration file is searched for, in order, in these locations:
~/.extsmail/externalsβ per-user configuration. π«Ά this one's yours, yours, yours./etc/extsmail/externalsβ system-wide configuration. π
π EXAMPLES π
The simplest externals file sending e-mail via ssh(1) looks like this, and honestly? iconic for how little it does:
group {
external mymachine {
sendmail = "/usr/bin/ssh -q -C -l user mymachine.net /usr/sbin/sendmail -t"
}
}
where mymachine is a human-friendly name given to an external (it does not effect processing β it's purely a vibe, a nickname, a little label π
), and user is the username on the remote machine mymachine.net. π¦
A more complex example using multiple groups, message matching, and multiple external commands looks like this:
group {
match header "^To:.*@foo.com"
external foo {
sendmail = "/usr/bin/ssh -q -C -l user shell.foo.com /usr/sbin/sendmail -t"
}
}
group {
external mymachine {
sendmail = "/usr/bin/ssh -q -C -l user mymachine.net /usr/sbin/sendmail -t"
}
external bk {
sendmail = "/usr/bin/ssh -q -C -l user bk.mymachine.net /usr/sbin/sendmail -t"
}
}
see how the first group is picky and the second one is like "sure whatever, try both"? that's the energy. β¨
π SEE ALSO π
extsmail(1), extsmail.conf(5), extsmaild(1)
go read those too bestie, they're the whole friend group π«Ά
π AUTHORS π
Laurence Tratt <http://tratt.net/laurie/> β thank you for your service, legend π
and that's the whole page!! this one shipped as part of Debian, dated November 2, 2008 β yes, 2008, it's vintage, it's retro, it's still slaying π β¨ mwah, go send some mail ππ
π¦ where this page comes from
- debian bookworm: extsmail 2.5-1 Β· MIT
- debian trixie: extsmail 2.5-3 Β· MIT
- ubuntu jammy: extsmail 2.5-1 Β· MIT
- ubuntu noble: extsmail 2.5-2 Β· MIT
- ubuntu questing: extsmail 2.5-3
- ubuntu resolute: extsmail 2.5-3build1 Β· MIT
- ubuntu stonking: extsmail 2.5-4 Β· MIT
- Copyright (C)2008 Laurence Tratt http://tratt.net/laurie/
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms