ESMTPRC(5)
πΈ ESMTPRC(5) πΈ
okay bestie, this is the esmtprc page from the File Formats Manual β yes, the same manual, we're just being cute about it π
. it's all about the esmtp configuration file and honestly? it's giving "tiny file, big power." let's go π¦
β¨ NAME β¨
esmtprc β the esmtp configuration file, aka the lil text file that tells esmtp how to behave π
π DESCRIPTION π
so an esmtp configuration file is literally just a bunch of options hanging out together, and every option looks like this:
keyword=value
the equals sign is optional β you can swap it for whitespace, no drama. and the value? you can wrap it in single or double quotes if you want, and then special characters get escaped exactly like in normal C strings. fancy β¨
comments start with the # character and run allll the way to the newline. periodt π
π OPTIONS π
hostname
set the SMTP host and service (port).
the format is:
host.example.org[:service]
with no whitespace surrounding the colon if you're specifying a service, okay? service can be a name pulled from /etc/services or just a decimal port number. if you don't specify it, the port defaults to 587 πΈ
note (straight from the libESMTP documentation, not me making stuff up): the default port number is set to587since this is the port that should be used for mail submission, see RFC 2476. by choosing this default now, the API does not change behavior unexpectedly in the future as use of the new standard becomes commonplace. the host-port notation simplifies things for the application β the user can type"localhost:smtp"or"localhost:25"where the application expects a host name. iconic of them honestly π«Ά
username
set the username for authentication with the SMTP server.
Do NOT set the username and password in the system configuration file unless you are the only user of this machine. Esmtp is not run with suid privileges therefore the system configuration file must be readable by everyone. if your SMTP server requires authentication and you are not the only user, then specify your personal SMTP account details in the user configuration file. bestie I am begging you, do not put your password in the shared file π
password
set the password for authentication with the SMTP server.
starttls
whether to use the StartTLS extension.
it can be one of enabled, disabled or required. it defaults to disabled β¨
certificate_passphrase
set the certificate passphrase for the StartTLS extension.
helo
set the hostname to identify as when sending HELO or EHLO commands.
(this is a per identity option, as it should be the name you are seen as from the connected host, which may vary with host to host due to NAT or different naming schemes. lowkey makes sense π§)
qualifydomain
make all local addresses to remote ones by adding @ and this name.
force sender
set a "Sender:" header and ignore those in the message. "%u" will be replaced with the username. "%%" by "%".
force reverse_path
set the envelope from address. the address given to -f will only be used as "From:" when the message contains none. "%u" will be replaced with the username. "%%" by "%".
message_id
whether to set the Message-ID field of the message before sending. normally the receiving MTA sets the Message-ID if missing, so you can turn this off if your sending host does not have a fully qualified domain name.
allowed values are either enabled or disabled. it defaults to enabled β¨
preconnect
shell command to execute prior to opening an SMTP connection.
this may be useful in conjunction with application-level transports (e.g. ssh with its port-forwarding functionality) to secure the SMTP connection. Esmtp will wait for the command to exit before proceeding. if the command returns a non-zero status, delivery will be aborted. π
identity
define an identity.
an identity is a set of options associated with a given address. for example:
identity = myself@somewhere.com
hostname = smtp.somewhere.com:25
username = "myself"
password = "secret"
identities are be selected by the address specified in the -f flag. you can have as many you like π
the options in the global section (up to the first identity option) constitute the default identity. if no options in the global section are given then the first defined identity is taken as the default one.
note that the default identity settings are not shared by the other identities. everything (username, password, etc.) must be specified for every identity even if they don't differ from the default identity. no shortcuts, sorry bestie π
mda
set the Mail Delivery Agent (MDA).
Esmtp relies upon a MDA for local mail delivery, i.e., addresses without a '@' character. a non-zero error status tells esmtp that delivery failed.
the local delivery addresses will be inserted into the MDA command wherever you place a %T. the mail message's From address will be inserted where you place an %F.
some common MDAs are "/usr/bin/procmail -d %T", "/usr/bin/deliver" and "/usr/lib/mail.local %T".
force_mda
force mail to be delivered by the MDA.
when set, any mail from anywhere to anywhere will instead be delivered to the value of force_mda. it will also only be delivered locally, via the mda. this will let you have a very minimal mail set-up, which can ONLY handle local mail.
for example:
mda = "procmail -d %T"
force_mda = "someuser"
π SEE ALSO π
π AUTHOR π
JosΓ© Fonseca β thank you for your service, king π«Ά
okay that's the whole page, no cap. this is the ESMTPRC(5) page from the File Formats Manual, and yes, the footer just says ESMTPRC(5) all over again because manpages love an echo. go configure something cute, bestie πβ¨ππ¦
π¦ where this page comes from
- debian bookworm: esmtp 1.2-18+b1 Β· GPL-2.0-only WITH OpenSSL exception
- debian trixie: esmtp 1.2-19 Β· GPL-2.0-only WITH OpenSSL exception
- ubuntu jammy: esmtp 1.2-18 Β· GPL-2.0-only WITH OpenSSL exception
- ubuntu noble: esmtp 1.2-18 Β· GPL-2.0-only WITH OpenSSL exception
- ubuntu questing: esmtp 1.2-19
- ubuntu resolute: esmtp 1.2-19build1 Β· GPL-2.0-only WITH OpenSSL exception
- ubuntu stonking: esmtp 1.2-19build1 Β· GPL-2.0-only WITH OpenSSL exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms