SUBMIT(8)
πΈ SUBMIT(8) πΈ
okay so bestie, you clicked into the SUBMIT(8) corner of the manual π and this whole page is credited to S. Varshavchik. Strap in, it's giving mail server internals and honestly? iconic. π¦
π NAME π
submit β Submit a new message to the Courier mail server β¨
π SYNOPSIS π
/usr/bin/submit [-expn=address] [-vrfy=address] [-vhost=address] [-bcc]
[-delay=n] [-rfc3848=type] {module} {"type; hostid"}
π DESCRIPTION π
okay so the submit program is the girl that hands messages over to the Courier mail server for processing. She is not for the end user, bestie, not even a little π
. She's used by the Courier mail server input modules only. Her global read and execute permissions are turned off, so literally the only way to run her is from a process that's a member of the courier group. And plot twist β submit is installed in the /usr/lib/courier/courier directory, not where you'd expect. π«Ά
submit always takes, like, exactly two command line arguments after any options. No more, no less:
moduleβ this one names the module that's running thesubmitcommand. It has to be one of the module names the Courier mail server already knows about, likelocal, oresmtp. This argument is the one bossing around the address rewriting rules."type; hostid"β one single argument (yes, quotes and all) that IDs where the message came from. It has to be suitable for theRemote-MTA:header in delivery status notifications, the way RFC 1894 says so. When a message shows up via ESMTP, this argument is typically"dns; helohost (hostname [ip.address])". π
Then comes the option menu, and the submit program takes all of these:
-expn=addressβ don't accept a message, "expand" the address instead. If the address you gave matches a locally-defined alias,submitprints all the addresses it expands to. If it does not match a locally-defined alias, the address just gets displayed by itself. no drama. π·-vrfy=addressβ don't accept a message, verify the address instead.submitprints a suitable message and sets the exit code to say whether that address is valid or not. Here's the flow, bestie: if the address matches a local alias βsubmitsays valid, exits. If it doesn't match a local alias,submitchecks whether any output protocol module can deliver it β if yes, valid, exits. Otherwise?submitprints a"User unknown"error message and exits. π-bccβ if no recipients are given, grab the recipient list fromBcc:headers only. Normally, when no recipients are specified,submitreads recipients from theTo:,Cc:andBcc:headers (andBcc:headers always get removed, periodt). The-bccoption makes it ignoreTo:andCc:headers for that purpose. Heads up though β this option is ignored if an explicit recipient list is specified (see below). π-delay=nβ waitnseconds before delivering the message. If you don't specify it, delivery starts after waiting however long the/etc/courier/submitdelayconfiguration time says (default: 0 seconds β immediate delivery, no waiting around π).-rfc3848=textβ specify the RFC 3848 transmission type label to be included in the message's βReceived:β header.-vhost=addressβ append β.addressβ to names of all configuration files Courier reads while processing this message.
π¬ RESPONSES FROM SUBMIT π¬
Every single reply from submit follows the format of SMTP responses, as defined in RFC822. Let's summarise because the girlies need the TL;DR β¨
The responses are one or more lines long. Every line in the response except the last one is: a three-digit numerical code, a dash, then arbitrary text. The last line (or the only line of the response) starts with a three-digit numerical code, a single space, and arbitrary text. π₯
The first digit of that numerical code is the vibe check β it tells you success or failure:
- first digit is
5β permanent failure π - first digit is
4β temporary failure (the message or the address should be resubmitted later, so like, try again bestie) - first digit is anything that isn't
4or5β success, or acceptance π
π MESSAGE SUBMISSION π
Unless either the -expn or the -vrfy option is specified, submit reads the message envelope and contents from standard input, like this. All input and output to submit consists of newline-terminated (NOT carriage return/newline terminated) lines of text. newline girlies only, no CRLF energy. π
submit reads the first line of text, which specifies the envelope sender address. That line is formatted like:
address<tab>format<tab>envid
<tab> there is the ASCII tab character, mhm. The address may be an empty string, optionally followed by tab, then format, another tab, then envid.
format is one or more characters that specify delivery status notification processing, and other message options. Breaking it down:
Fβ delivery status notifications should include the entire messageHβ just the headers of the message should be included- neither
FnorHpresent β no preference, she's chill S{keyword}β specifies the optional SECURITY extension keyword for this messageVβ sets the VERP extension flag for this message8β a flag saying the message was received via SMTP with aSMTPUTF8keyword, and this prepends βUTF8β to the transmission type passed in via-rfc3848
envid is the original message envelope ID, which will show up on any delivery status notifications. NOTE: envid must be specified using xtext encoding (see the relevant RFCs). π
After reading that first line of text, submit prints a response (see "RESPONSES FROM SUBMIT", above). If the response is a failure, submit terminates immediately, done, goodbye π. Otherwise, submit then reads one or more envelope recipients.
Each envelope recipient gets read as a single non-empty line of text, formatted like:
address<tab>dsn<tab>oreceipient
address is a non-empty recipient E-mail address, optionally followed by the tab character, then zero or more characters specifying dsn, then a tab character, then the oreceipient value.
dsn is zero or more of these characters:
Sβ send a delivery status notification upon a successful delivery to this addressFβ send a DSN upon a failed deliveryDβ send a DSN upon a mail delayNβ never send a DSN
oreceipient is the "Original Recipient", as specified in RFC1894, except that it is not encoded using xtext encoding, but in unencoded UTF-8. π§
submit will print a response to each recipient (see "RESPONSES FROM SUBMIT", above). If at least one recipient address has been successfully specified, a blank line is read to specify end of recipient list, followed by the entire message, headers and body. yes, the whole thing. πΊ
A single blank line terminates the list of recipients. That is followed by the message itself, all the way until end of file.
And plot twist β that blank line can be present before even the first recipient is specified. If so, submit obtains the list of recipients from the message's headers instead. main character flexibility β¨
submit reads the message headers and body until end-of-file. Then, submit prints a response (see above) indicating whether or not the message was accepted for delivery, and terminates. π«
π ADDRESS REWRITING π
Every recipient address β whether it was specified explicitly, or obtained from the message headers β gets rewritten according to the rewriting rules specified by the input module. And each address in the headers of the message gets rewritten too. Everybody gets a glow-up. π
After rewriting each recipient address, submit searches the aliases.dat file for this address, to see if it represents a locally defined alias. She looks in:
/usr/lib/courier/courier/modules/module/aliases.dat/etc/courier/aliases.dat
(actual locations may be changed by the system administrator, so don't come for her if they're different on your box π)
If the address is found, the recipient address gets replaced by the addresses defined in the aliases.dat file. slay. π
πΏ ENVIRONMENT VARIABLES πΏ
submit also reads these environment variables to further specify how the message is to be processed:
BLOCKβ if this variable is set to a non-empty value,submitwill reject every recipient (in effect, rejecting the message). The contents of the environment variable will be used as the error message. πDSNENVIDβ ifenvidis not specified, or is blank, and this environment variable is defined, the contents of this variable are used as the original envelope id field for DSNs. Heads up:DSNENVIDis copied verbatim into theOriginal-Envelope-Idfield (if the message is relayed to another MTA, the Courier mail server automatically xtext-encodes it). πDSNNOTIFYβ if thedsnfield for a recipient is empty, the contents of this environment variable are used in its place. Also, if the recipient list is read from the headers, the contents of this environment variable are used to set thedsnsetting. β¨DSNRETβ if theformatfield for this message is empty, the contents of this environment variable are used in its place.NOADDDATEβ normally the Courier mail server adds aDate:header to the message if it doesn't have one. If this environment variable is set, the Courier mail server will not add aDate:header. π°οΈNOADDMSGIDβ normally the Courier mail server adds aMessage-Id:header to the message if it doesn't have it. If this environment variable is set, the Courier mail server will not add aMessage-Id:header. πNOADDRREWRITEβ normally the Courier mail server rewrites addresses in theFrom:,To:, andCc:header fields. If this environment variable is set to1, the Courier mail server will not rewrite them. If it is set to a higher value, the Courier mail server will only rewrite it if noDKIM-Signature:header field was found. πMIMEβ normally the Courier mail server adds any missing RFC2045 headers to the message. TheMIMEenvironment variable can be set to the following values:none- do not do any RFC2045 processing whatsoever;7bit- if the message contains any 8-bit text, convert it to quoted-printable encoding;8bit-if the message contains any quoted-printable encoded text that can be representing as 8bit-encoded text, then convert it to 8bit encoding. π
π SEE ALSO π
courierpop3d(8)ΒΉcouriertcpd(8)Β²authlib(7)Β³
π AUTHOR π
Sam Varshavchik Author
π NOTES π
courierpop3d(8)β https://www.courier-mta.org/courierpop3d.htmlcouriertcpd(8)β https://www.courier-mta.org/couriertcpd.htmlauthlib(7)β https://www.courier-mta.org/authlib.html
and that's the whole page bestie, no cap π this was Courier Mail Server, dated 01/10/2026, filed under SUBMIT(8) β go forth and submit responsibly, mwah π«Άβ¨
π¦ where this page comes from
- ubuntu stonking: courier-mta 2.0.6-1 Β· GPL-3+~with-OpenSSL-exception
- Copyright 1998 - 2009 S. Varshavchik. See COPYING for -->
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms