new-inject(1)
NAME
new-inject - preprocess a mail message
SYNOPSIS
new-inject [ -nNaAhHFIMRS ] [ -fsender ] [ recip ... ]
DESCRIPTION
With the (default) -N option, new-inject reads a mail mes
sage from its standard input, rewrites the message header,
and feeds the rewritten message to qmail-queue.
With the -n option, new-inject prints the message rather
than feeding it to qmail-queue.
See http://pobox.com/~djb/proto/immhf.html for a complete
description of the Internet mail message header format.
The FIMRS options can be set as letters inside the $QMAIL
INJECT environment variable.
ADDRESS REWRITING
new-inject transforms each address according to the con
trol files defaultdomain, defaulthost, me, plusdomain, and
rewrite. See rewriting(5) for further details. If you
set the environment variable $QMAILREWRITEFILE, and that
file exists, it overrides rewrite.
ENVELOPE ADDRESSES
new-inject builds an envelope for the message: a list of
recipient addresses that will receive the message, and a
sender address that will receive bounces.
If new-inject is printing the message rather than feeding
it to qmail-queue, it prints an Envelope-Sender field and
an Envelope-Recipients field at the top of the new message
header.
With the -a option, new-inject builds the envelope recipi
ent list from the argument recipients, i.e., all recip
addresses listed on the command line. With the -h option,
new-inject builds the envelope recipient list from the
header recipients, i.e., all addresses listed in the
incoming message under Envelope-Recipients, or under To,
Cc, Bcc, and Apparently-To if Envelope-Recipients is not
supplied. With the -H option, new-inject uses both argu
ment recipients and header recipients. With the (default)
-A option, new-inject uses argument recipients, or header
recipients if there are no argument recipients.
The envelope sender is set by the -f option if it is sup
plied; otherwise, the incoming Envelope-Sender field, if
there is one; otherwise, the incoming Return-Path field,
if there is one, and if the -S option is not set; other
wise, the default envelope sender, as described below.
Incoming Envelope-Sender and Return-Path fields are
removed in any case.
The default envelope sender contains a user name, a permessage VERP, a per-recipient VERP, and a host name. The
user name is set by an environment variable: $QMAILSUSER,
$QMAILUSER, $MAILUSER, $USER, or $LOGNAME, whichever comes
first. If the -M option is set, the per-message VERP
contains a dash, the current time, and the process ID;
otherwise it is empty. If the -R option is set, the perrecipient VERP contains a dash, the envelope recipient
user name, an equals sign, and the envelope recipient host
name; otherwise it is empty. (If there are several recip
ients, each recipient sees a different sender address.)
The host name is set by $QMAILSHOST, $QMAILHOST, $MAIL
HOST, or the empty string, subject to rewriting.
RECIPIENTS
new-inject rewrites addresses in To, Cc, and NoticeRequested-Upon-Delivery-To fields. It cleans up the spac
ing, adds missing commas, trims extra commas, adds missing
quotes, wraps lines at a reasonable length, converts
source routes into comments, etc. If there are several To
fields, new-inject merges them into a single To field.
new-inject removes all incoming Bcc and Apparently-To
fields.
SENDERS
new-inject rewrites addresses in From and Sender fields.
If the incoming message does not contain a From field,
new-inject creates a new From field.
If the -F option is set, new-inject discards any incoming
From field, and creates a new From field.
The new From field contains a personal name, a user name,
and a host name. The personal name is set by $QMAILNAME,
$MAILNAME, or $NAME, whichever comes first; if none of
these variables are set, the personal name is omitted.
The user name is set by $QMAILUSER, $MAILUSER, $USER, or
$LOGNAME. The host name is set by $QMAILHOST, $MAILHOST,
or the empty string, subject to rewriting.
RESPONSE TARGETS
new-inject rewrites addresses in Reply-To, Mail-Reply-To,
and Mail-Followup-To fields.
If the environment variable $QMAILMFTFILE is set, newinject reads a list of mailing list addresses, one per
line, from that file. If To+Cc includes one of those
addresses (without regard to case), and if the incoming
message does not contain a Mail-Followup-To field, newinject adds a Mail-Followup-To field with all the To+Cc
addresses.
DATE FIELDS
If the incoming message has comprehensible Date fields,
new-inject takes the last one and rewrites it in a stan
dard format. It transforms 2-digit (and 3-digit) years
into 4-digit years. It also transforms obsolete time zone
names into numeric time zones.
Otherwise new-inject makes a new Date field with the cur
rent time in UTC, counting leap seconds.
THREADING
If the incoming message does not contain a Message-ID field, new-inject creates a new Message-ID field.
If the -I option is set, new-inject discards any incoming Message-ID field, and creates a new Message-ID field.
new-inject uses the control file idhost (overridden by he
environment variable $QMAILIDHOST; defaulting to me) in
its new Message-ID field. idhost need not be the current
host's name. It is your responsibility to obtain autho
rization from the owner of the idhost domain.
MISCELLANY
new-inject puts Received, Delivered-To, Errors-To, ReturnReceipt-To, Resent-Sender, Resent-From, Resent-Reply-To,
Resent-To, Resent-Cc, Resent-Bcc, Resent-Date, and ResentMessage-ID fields at the top of the header. It does not
rewrite any of these fields; it follows the 822bis
approach of treating Resent-* as trace fields.
new-inject discards incoming Content-Length fields.