SENDMAIL(1)
π SENDMAIL(1) π
okay bestie, gather round, because this is sendmail from the General Commands Manual and it is lowkey iconic β it's the Postfix to Sendmail compatibility interface. yes, that means it speaks fluent Old Sendmail so your ancient scripts don't have a meltdown π«Ά
π NAME
sendmail β Postfix to Sendmail compatibility interface
π SYNOPSIS
sendmail [option ...] [recipient ...]
mailq
sendmail -bp
newaliases
sendmail -I
π¦ DESCRIPTION
The Postfix sendmail(1) command implements the Postfix to Sendmail compatibility interface. And because existing applications are out here living their lives, some Sendmail command-line options are recognized but silently ignored. they just get a lil nod and then we move on π
By default, Postfix sendmail(1) reads a message from standard input until EOF, or until it reads a line with only a . character, and then arranges for delivery. It leans on the postdrop(1) command to create a queue file in the maildrop directory. teamwork makes the dream work β¨
Specific command aliases are provided for other common modes of operation:
mailqβ List the mail queue. Each entry shows the queue file ID, message size, arrival time, sender, and the recipients that still need to be delivered. If mail could not be delivered upon the last attempt, the reason for failure is shown. The queue ID string is followed by an optional status character:*β The message is in the active queue, i.e. the message is selected for delivery.!β The message is in the hold queue, i.e. no further delivery attempt will be made until the mail is taken off hold.#β The message is forced to expire. See thepostsuper(1)options-eor-f.
This mode of operation is implemented by executing the postqueue(1) command.
newaliasesβ Initialize the alias database. If no input file is specified (with the-oAoption, see below), the program processes the file(s) specified with thealias_databaseconfiguration parameter. If no alias database type is specified, the program uses the type specified with thedefault_database_typeconfiguration parameter. This mode of operation is implemented by running thepostalias(1)command.
Note: it may take a minute or so before an alias database update becomes visible. Use the "postfix reload" command to eliminate this delay. (the way that one command just fixes your whole patience problem π)
These and other features can be selected by specifying the appropriate combination of command-line options. Some features are controlled by parameters in the main.cf configuration file.
The following options are recognized:
β¨ OPTIONS β¨
-Amβ (ignored) π-Acβ (ignored). Postfix sendmail uses the same configuration file regardless of whether or not a message is an initial submission.-B body_typeβ The message body MIME type:7BITor8BITMIME.-bdβ Go into daemon mode. This mode of operation is implemented by executing the"postfix start"command.-bhβ (ignored) π-bHβ (ignored). Postfix has no persistent host status database. (no memory, no drama, we simply forget π§)-biβ Initialize alias database. See thenewaliasescommand above.-blβ Go into daemon mode. To accept only local connections as with Sendmail's-bloption, specify"inet_interfaces = loopback"in the Postfixmain.cfconfiguration file.-bmβ Read mail from standard input and arrange for delivery. This is the default mode of operation. π-bpβ List the mail queue. See themailqcommand above.-bsβ Stand-alone SMTP server mode. Read SMTP commands from standard input, and write responses to standard output. In stand-alone SMTP server mode, mail relaying and other access controls are disabled by default. To enable them, run the process as themail_owneruser.
This mode of operation is implemented by running the smtpd(8) daemon.
-bvβ Do not collect or deliver a message. Instead, send an email report after verifying each recipient address. This is useful for testing address rewriting and routing configurations.
This feature is available in Postfix version 2.1 and later.
-C config_file-C config_dirβ The path name of the Postfixmain.cffile, or of its parent directory. This information is ignored with Postfix versions before 2.3.
With Postfix version 3.2 and later, a non-default directory must be authorized in the default main.cf file, through the alternate_config_directories or multi_instance_directories parameters.
With all Postfix versions, you can specify a directory pathname with the MAIL_CONFIG environment variable to override the location of configuration files.
-F full_nameβ Set the sender full name. This overrides theNAMEenvironment variable, and is used only with messages that have noFrom:message header.-f senderβ Set the envelope sender address. This is the address where delivery problems are sent to. With Postfix versions before 2.1, theErrors-To:message header overrides the error return address.-Gβ Gateway (relay) submission, as opposed to initial user submission. Either do not rewrite addresses at all, or update incomplete addresses with the domain information specified withremote_header_rewrite_domain.
This option is ignored before Postfix version 2.3.
-h hop_countβ (ignored). Hop count limit. Use thehopcount_limitconfiguration parameter instead.-Iβ Initialize alias database. See thenewaliasescommand above.-iβ When reading a message from standard input, don't treat a line with only a.character as the end of input.-L labelβ (ignored). The logging label. Use thesyslog_nameconfiguration parameter instead.-mβ (ignored). Backwards compatibility.-N dsnβ (default:'delay, failure') Delivery status notification control. Specify either a comma-separated list with one or more offailure(send notification when delivery fails),delay(send notification when delivery is delayed), orsuccess(send notification when the message is delivered); or specifynever(don't send any notifications at all).
This feature is available in Postfix 2.3 and later.
-nβ (ignored). Backwards compatibility.-oAalias_databaseβ Non-default alias database. Specify pathname ortype:pathname. Seepostalias(1)for details.-O option=valueβ (ignored). Set the named option to value. Use the equivalent configuration parameter inmain.cfinstead.-o7β (ignored) π-o8β (ignored). To send 8-bit or binary content, use an appropriate MIME encapsulation and specify the appropriate-Bcommand-line option.-oiβ When reading a message from standard input, don't treat a line with only a.character as the end of input.-omβ (ignored). The sender is never eliminated from alias etc. expansions.-o x valueβ (ignored). Set option x to value. Use the equivalent configuration parameter inmain.cfinstead.-r senderβ Set the envelope sender address. This is the address where delivery problems are sent to. With Postfix versions before 2.1, theErrors-To:message header overrides the error return address.-R returnβ Delivery status notification control. Specify"hdrs"to return only the header when a message bounces,"full"to return a full copy (the default behavior).
The -R option specifies an upper bound; Postfix will return only the header, when a full copy would exceed the bounce_size_limit setting.
This option is ignored before Postfix version 2.10.
-qβ Attempt to deliver all queued mail. This is implemented by executing thepostqueue(1)command.
Warning: flushing undeliverable mail frequently will result in poor delivery performance of all other mail. (fr fr, don't spam the flush button bestie π)
-qintervalβ (ignored). The interval between queue runs. Use thequeue_run_delayconfiguration parameter instead.-qIqueueidβ Schedule immediate delivery of mail with the specified queue ID. This option is implemented by executing thepostqueue(1)command, and is available with Postfix version 2.4 and later.-qRsiteβ Schedule immediate delivery of all mail that is queued for the named site. This option accepts only site names that are eligible for the"fast flush"service, and is implemented by executing thepostqueue(1)command. Seeflush(8)for more information about the"fast flush"service.-qSsiteβ This command is not implemented. Use the slower"sendmail -q"command instead. (we love an honest icon π«Ά)-tβ Extract recipients from message headers. These are added to any recipients specified on the command line.
With Postfix versions prior to 2.1, this option requires that no recipient addresses are specified on the command line.
-Uβ (ignored). Initial user submission.-V envidβ Specify the envelope ID for notification by servers that support DSN.
This feature is available in Postfix 2.3 and later.
-XVβ (Postfix 2.2 and earlier:-V) Variable Envelope Return Path. Given an envelope sender address of the formowner-listname@origin, each recipientuser@domainreceives mail with a personalized envelope sender address.
By default, the personalized envelope sender address is owner-listname+user=domain@origin. The default + and = characters are configurable with the default_verp_delimiters configuration parameter.
-XVxyβ (Postfix 2.2 and earlier:-Vxy) As-XV, but uses x and y as the VERP delimiter characters, instead of the characters specified with thedefault_verp_delimitersconfiguration parameter.-vβ Send an email report of the first delivery attempt (Postfix versions 2.1 and later). Mail delivery always happens in the background. When multiple-voptions are given, enable verbose logging for debugging purposes.-X log_fileβ (ignored). Log mailer traffic. Use thedebug_peer_listanddebug_peer_levelconfiguration parameters instead.
and that's only part one, bestie β there is SO much more coming, don't you dare close the tab π
π SECURITY π
okay bestie, this is the part where we get serious for a sec, because it's giving "safety briefing" energy and you need to actually read it π
By design, this program is not set-user (or group) id. She's built different β she's prepared to handle message content from untrusted, possibly remote, users. π
However. And this is a big however, like, main-character-plot-twist however: like most Postfix programs, this one does not enforce a security policy on its command-line arguments. Nope. Instead, she relies on the UNIX system to enforce access policies based on the effective user and group IDs of the process. Concretely, this means that running Postfix commands as root (from sudo or equivalent) on behalf of a non-root user is likely to create privilege escalation opportunities. π¨
fr fr, that's the dangerous bit. not exaggerating, not being dramatic. that's a real "privilege escalation" situation and privilege escalation is never a vibe.
If an application runs any Postfix programs on behalf of users that do not have normal shell access to Postfix commands, then that application MUST restrict user-specified command-line arguments to avoid privilege escalation. No cap, this is a MUST.
- Filter all command-line arguments, for example arguments that contain a pathname or that specify a database access method. These pathname checks must reject user-controlled symlinks or hardlinks to sensitive files, and must not be vulnerable to TOCTOU race attacks. π΅οΈβοΈ
- Disable command options processing for all command arguments that contain user-specified data. For example, the Postfix
sendmail(1)command line MUST be structured as follows:
/path/to/sendmail system-arguments -- user-arguments
Here, the -- disables command option processing for all user-arguments that follow. π
Without the --, a malicious user could enable Postfix sendmail(1) command options, by specifying an email address that starts with -. And like, an email address starting with a dash should just be a weird email address, not a secret cheat code for your flags. π
π©Ί DIAGNOSTICS π©Ί
Problems are logged to syslogd(8) or postlogd(8), and to the standard error stream. So when something's wrong, she's not ghosting you β she's logging it in three different places, lowkey thorough of her. β¨
π± ENVIRONMENT π±
MAIL_CONFIGβ Directory with Postfix configuration files. πMAIL_VERBOSE(value does not matter) β Enable verbose logging for debugging purposes. She's gonna talk. A lot. π£οΈMAIL_DEBUG(value does not matter) β Enable debugging with an external command, as specified with thedebugger_commandconfiguration parameter. πNAMEβ The sender full name. This is used only with messages that have noFrom:message header. See also the-Foption above. π
βοΈ CONFIGURATION PARAMETERS βοΈ
The following main.cf parameters are especially relevant to this program. The text below provides only a parameter summary β like, the lil sparknotes version. See postconf(5) for more details including examples, because she wrote a whole essay over there. π
π§© COMPATIBILITY CONTROLS
Available with Postfix 2.9 and later:
sendmail_fix_line_endings(always) β Controls how the Postfixsendmailcommand converts email message line endings from<CR><LF>into UNIX format (<LF>). cute little glow-up for your line endings. β¨
π οΈ TROUBLE SHOOTING CONTROLS
The DEBUG_README file gives examples of how to troubleshoot a Postfix system. (We'll get to README_FILES later, keep scrolling bestie π)
debugger_command(empty) β The external command to execute when a Postfix daemon program is invoked with the-Doption.debug_peer_level(2) β The increment in verbose logging level when a nexthop destination, remote client or server name or network address matches a pattern given with thedebug_peer_listparameter.debug_peer_list(empty) β Optional list of nexthop destination, remote client or server name or network address patterns that, if matched, cause the verbose logging level to increase by the amount specified in$debug_peer_level.
π ACCESS CONTROLS
Available in Postfix version 2.2 and later:
authorized_flush_users(static:anyone) β List of users who are authorized to flush the queue.authorized_mailq_users(static:anyone) β List of users who are authorized to view the queue. πauthorized_submit_users(static:anyone) β List of users who are authorized to submit mail with thesendmail(1)command (and with the privilegedpostdrop(1)helper command).
βοΈ RESOURCE AND RATE CONTROLS
bounce_size_limit(50000) β The maximal amount of original message text that is sent in a non-delivery notification.fork_attempts(5) β The maximal number of attempts tofork()a child process.fork_delay(1s) β The delay between attempts tofork()a child process.hopcount_limit(50) β The maximal number ofReceived:message headers that is allowed in the primary message headers. π£οΈqueue_run_delay(300s) β The time between deferred queue scans by the queue manager; prior to Postfix 2.4 the default value was1000s. (yes, she changed her mind in 2.4, growth era π )
πβοΈ FAST FLUSH CONTROLS
The ETRN_README file describes configuration and operation details for the Postfix "fast flush" service. β‘
fast_flush_domains($relay_domains) β Optional list of destinations that are eligible for per-destination logfiles with mail that is queued to those destinations.
π¦ VERP CONTROLS
The VERP_README file describes configuration and operation details of Postfix support for variable envelope return path addresses.
default_verp_delimiters(+=) β The two default VERP delimiter characters.verp_delimiter_filter(-=+) β The characters Postfix accepts as VERP delimiter characters on the Postfixsendmail(1)command line and in SMTP commands.
π MISCELLANEOUS CONTROLS
alias_database(seepostconf -doutput) β The alias databases forlocal(8)delivery that are updated with"newaliases"or with"sendmail -bi".command_directory(seepostconf -doutput) β The location of all postfix administrative commands.config_directory(seepostconf -doutput) β The default location of the Postfixmain.cfandmaster.cfconfiguration files.daemon_directory(seepostconf -doutput) β The directory with Postfix support programs and daemon programs.default_database_type(seepostconf -doutput) β The default database type for use innewaliases(1),postalias(1)andpostmap(1)commands.delay_warning_time(0h) β The time after which the sender receives a copy of the message headers of mail that is still queued.import_environment(seepostconf -doutput) β The list of environment variables that a privileged Postfix process will import from a non-Postfix parent process, orname=valueenvironment overrides.mail_owner(postfix) β The UNIX system account that owns the Postfix queue and most Postfix daemon processes. πqueue_directory(seepostconf -doutput) β The location of the Postfix top-level queue directory.remote_header_rewrite_domain(empty) β Rewrite or add message headers in mail from remote clients if theremote_header_rewrite_domainparameter value is non-empty, updating incomplete addresses with the domain specified in theremote_header_rewrite_domainparameter, and adding missing headers.syslog_facility(mail) β The syslog facility of Postfix logging.syslog_name(seepostconf -doutput) β A prefix that is prepended to the process name in syslog records, so that, for example,"smtpd"becomes"prefix/smtpd".
Postfix 3.2 and later:
alternate_config_directories(empty) β A list of non-default Postfix configuration directories that may be specified with"-c config_directory"on the command line (in the case ofsendmail(1), with the"-C"option), or via theMAIL_CONFIGenvironment parameter.multi_instance_directories(empty) β An optional list of non-default Postfix configuration directories; these directories belong to additional Postfix instances that share the Postfix executable files and documentation with the default Postfix instance, and that are started, stopped, etc., together with the default Postfix instance.
π FILES π
/var/spool/postfix, mail queue π¬/etc/postfix, configuration files ποΈ
π SEE ALSO π
pickup(8), mail pickup daemonqmgr(8), queue managersmtpd(8), SMTP serverflush(8), fast flush servicepostsuper(1), queue maintenancepostalias(1), create/update/query alias databasepostdrop(1), mail posting utilitypostfix(1), mail system controlpostqueue(1), mail queue controlpostlogd(8), Postfix loggingsyslogd(8), system logging
π README_FILES π
Use "postconf readme_directory" or "postconf html_directory" to locate this information. β¨
DEBUG_README, Postfix debugging howtoETRN_README, Postfix ETRN howtoVERP_README, Postfix VERP howto
π LICENSE π
The Secure Mailer license must be distributed with this software. periodt. π
π AUTHOR(S) π
Wietse Venema IBM T.J. Watson Research P.O. Box 704 Yorktown Heights, NY 10598, USA
Wietse Venema Google, Inc. 111 8th Avenue New York, NY 10011, USA
and that's a wrap on the SENDMAIL(1) page bestie!! π this was the Postfix sendmail(1) manual page, and yes, the same legend Wietse Venema wrote both of those addresses, king behavior honestly π go forth and send your mail responsibly, always use that --, and stay hydrated π¦π
π¦ where this page comes from
- fedora 43: postfix 2:3.10.14-1.fc43 Β· (IPL-1.0 OR EPL-2.0) AND GPL-2.0-or-later AND BSD-4-Clause-UC
- fedora 43: postfix 2:3.10.3-3.fc43 Β· (IPL-1.0 OR EPL-2.0) AND GPL-2.0-or-later AND BSD-4-Clause-UC
- fedora 44: postfix 2:3.10.14-1.fc44 Β· (IPL-1.0 OR EPL-2.0) AND GPL-2.0-or-later AND BSD-4-Clause-UC
- fedora 44: postfix 2:3.10.7-2.fc44 Β· (IPL-1.0 OR EPL-2.0) AND GPL-2.0-or-later AND BSD-4-Clause-UC
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms