nullmailer-inject(1)
π nullmailer-inject β the inject-y one (section 1 of the General Commands Manual, bestie) β¨
okay so real talk: this is nullmailer-inject, and she's the little gremlin that takes your messy lil email, gives it a glow-up, and yeets it into the queue. let's get into it π«Ά
β¨ SYNOPSIS β¨
nullmailer-inject [-a] [-b] [-e] [-f sender] [-h] [recipient [recipient
...]]
πΈ DESCRIPTION πΈ
so basically: this program reads an email message from standard input, reformats its header so it complies with RFC822, and then sends the resulting message to the queue. that's the whole vibe. no cap. π
π HEADER FIELDS π
these lines get parsed for recipient addresses: To, Cc, Bcc, Apparently-To, Resent-To, Resent-Cc, and Resent-Bcc.
these sender address lines get parsed and rewritten: Sender, From, Reply-To, Return-Path, Return-Receipt-To, Errors-To, Resent-Sender, Resent-From, and Resent-Reply-To. and listen β if the Return-Path header field is present and contains a single address, its contents will be used to set the envelope sender address. she's got main character energy like that. π
if the message contains any of these fields, it is treated as a resent message: Resent-Sender, Resent-From, Resent-Reply-To, Resent-To, Resent-Cc, Resent-Bcc, Resent-Date, Resent-Message-ID. and if the message is resent, only the recipient fields prefixed with Resent- are examined for addresses. iykyk.
any occurrences of Bcc, Resent-Bcc, Return-Path, or Content-Length are discarded after they are parsed (if necessary). gone. deleted. not me ghosting your Bcc π«₯
if the header lacks a Message-Id field, a unique string is generated and added to the message. if the header lacks a Date field, the current local date and time in RFC822 format is appended to the message. and if the message has no To or Cc fields, the following line is appended to the message:
Cc: recipient list not shown: ;
π¦ ADDRESS LISTS π¦
address lists are expected to follow the syntax set out in RFC822. here's a simplified explanation of the syntax, bestie, because the full RFC is a lot:
an address list is a list of addresses separated by commas. an individual address may have one of the following three forms: user@fqdn, comment<user@fqdn>, or phrase:address-list;. any of the first two forms may be used within the address list of the third form. any word containing special characters must be placed in double quotes and the special characters must be preceded with a backslash. comments may be placed between addresses in parenthesis. all comments are ignored. (the comments, not you. you're seen. π)
address lists are reformatted as they are parsed, for ease of later re-parsing when the message reaches the destination(s). and if an address is missing a fqdn, nullmailer-inject adds one. she's fixing you up, no questions asked β¨
π OPTIONS π
-aβ use only the command line arguments as recipient addresses. ignore the header recipient lines entirely. bye π-bβ use both the command line arguments and data from the message header as recipient addresses. why not both, honestly-eβ use either the command line arguments (if there are any) or data from the message header (if there are no arguments) as the recipient addresses-fsender β set the envelope sender address to sender-hβ use only data from the message header as the recipient addresses-nβ do not queue the message, but print the reformatted contents to standard output. just lookin', not sending π-vβ print out the envelope (sender and recipient addresses) preceding the message when printing the message to standard output
β RETURN VALUE β
exits 0 if it was successful. otherwise it prints a diagnostic message to standard error and exits 1. slay or flop, no in-between π
π ENVIRONMENT π
the environment variable NULLMAILER_FLAGS is parsed and the behavior of nullmailer-inject is modified if any of the following letters are present:
cβ use"address (comment)"style in the generatedFromfield instead of the default"comment <address>"stylefβ ignore and remove anyFromheader lines and always insert a generated oneiβ ignore and remove anyMessage-Idheader linessβ ignore and remove anyReturn-Pathheader linestβ insert aToline containing a list of the recipients if the header does not contain either aToor aCcfield. if the message is determined to be a resent message (see above π), aResent-Tofield is added if the header does not contain either aResent-Toor aResent-Ccfield
the user name is set by NULLMAILER_USER, MAILUSER, USER, or LOGNAME, whichever comes first. if none of the above are set, the name is taken from the password file, or set to unknown if that fails. (so mysterious of her β¨)
the host name is set by the canonicalized value of NULLMAILER_HOST, MAILHOST, or HOSTNAME, whichever comes first, or the defaulthost config file if none of the above are set (see below).
the full name of the user is set by NULLMAILER_NAME, MAILNAME, NAME, or the user name above, whichever comes first.
the user and host name of the envelope sender default to the user and host name set above, but may be overridden by NULLMAILER_SUSER and NULLMAILER_SHOST.
if NULLMAILER_QUEUE is set, the program named is used in place of nullmailer-queue to queue the formatted message.
π§ CONTROL FILES π§
when reading the following files, a single line is read and stripped of all leading and trailing whitespace characters. (she's not here for your extra spaces, bestie π§Ό)
defaultdomainβ the content of this file is appended to any host name that does not contain a period (exceptlocalhost), includingdefaulthostandidhost. defaults to the value of the/etc/mailnamesystem file, if it exists, otherwise the literal namedefauldomain.defaulthostβ the content of this file is appended to any address that is missing a host name. defaults to the value of the/etc/mailnamesystem file, if it exists, otherwise the literal namedefaulthost.idhostβ the content of this file is used when building themessage-idstring for the message. defaults to the canonicalized value ofdefaulthost./etc/mailnameβ the fully-qualifiled host name of the computer running nullmailer. defaults to the literal nameme.
π SEE ALSO π
π NOTES π
this document glosses over very many details of how address parsing and rewriting actually works (among other things). yeah. it's giving "trust the process". π
and that's the whole page, bestie!! this was nullmailer-inject(1) from the General Commands Manual β version/date footer energy: nullmailer-inject(1) π go forth and inject responsibly πβ¨π¦
π¦ where this page comes from
- debian bookworm: nullmailer 1:2.2-4 Β· GPL-2.0-or-later
- debian trixie: nullmailer 1:2.2+10~g7ed88a0-6.1 Β· GPL-2.0-or-later
- ubuntu jammy: nullmailer 1:2.2-3build1 Β· GPL-2.0-or-later
- ubuntu noble: nullmailer 1:2.2+10~g7ed88a0-2build2 Β· GPL-2.0-or-later
- ubuntu questing: nullmailer 1:2.2+10~g7ed88a0-6.1
- ubuntu resolute: nullmailer 1:2.2+10~g7ed88a0-6.1build1 Β· GPL-2.0-or-later
- ubuntu stonking: nullmailer 1:2.2+10~g7ed88a0-6.1build1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms