POSTOFFICE(8)

NAME
postoffice - internet mail server

SYNOPSIS
postoffice [flags] [address ...]

DESCRIPTION
postoffice accepts and delivers mail on TCP/IP networks. It includes a mail greylist, uses TCP wrappers to restrict client access, and can be configured to run antivirus software before accepting mail for delivery.

With no flags, postoffice reads its standard input up to an end-of-file and sends a copy of the message found there to all of the addresses listed on the command line.

Local addresses are looked up in a file and aliased appropriately.

Flags are:

-a  Start SMTP servers with session auditing enabled. If session logging is enabled, postoffice will log all sorts of information about each SMTP session to the syslog. See mailaudit(5) for details about the format of the audit records.

-bd Run as a daemon. postoffice will fork and run in background listening on socket 25 for incoming SMTP connections.

-bD Run as a service. postoffice will run in the foreground listening on socket 25 for incoming SMTP connections.

-bi Initialize the alias database. @VHOST@If a @VHOST@.Ar host @VHOST@is passed on the command line, @VHOST@.Nm Postoffice @VHOST@will rebuild the aliases file for that virtual host, otherwise @VHOST@it will rebuild the system alias file @VHOST@.Ar /etc/aliases .

-bm Deliver mail in the usual way (default).

-bp Print a listing of the queue.

-bq Process messages in the queue.

-bs Use the SMTP protocol as described in RFC821 on standard input and output.

-Cfile
    Read options from the named configuration file instead of from @confdir@/postoffice.cf.

-d  When running as a daemon, postoffice will not fork and run in the background, but will instead stay attached to the controlling terminal.

-fname
    Sets the name of the ‘from’ person (i.e., the sender of the mail). -f can only be used by root or if the person you are trying to become is the same as the person you are.

-ox=value
    Set option x to the specified value. Options are described in the postoffice.cf(5) manpage.

-q  An alternate form of the -bq flag.

-qX Start a daemon to process the mail queue every X minutes.

-rname
    An alternate form of the -f flag.

-v  Go into verbose mode.

-V  Report version information for this copy of postoffice, then exit successfully.

Various processing options can be set when postoffice is started. Options may be set either on the command line using the -o flag, in the configuration file @confdir@/postoffice.cf, or in a configuration file specified by the -C flag.

In aliases, the first character of a name may be a vertical bar to cause interpretation of the rest of the name as a command to pipe the mail to. It may be necessary to quote the name to keep postoffice from suppressing the blanks from between arguments. For example, a common alias is:

    msgs: "|/usr/bin/msgs -s"

postoffice returns an exit status describing what it did. The codes are defined in <sysexits.h>:
EX_OK
    Successful completion on all addresses.
EX_NOUSER
    User name not recognized.
EX_UNAVAILABLE
    Catchall meaning necessary resources were not available.
EX_SYNTAX
    Syntax error in address.
EX_SOFTWARE
    Internal software error, including bad arguments.
EX_OSERR
    Temporary operating system error, such as “cannot fork”.
EX_OSFILE
    @confdir@/postoffice.cf or @confdir@ is world writable or is not owned by root.
EX_NOPERM
    You do not have sufficient permissions.
EX_IOERR
    postoffice was unable to create or write a file.

If invoked as newaliases, postoffice will rebuild the alias database. If invoked as mailq, postoffice will print the contents of the mail queue. If invoked as runq, postoffice will run through the mail queue and make what deliveries are possible. If invoked as smtpd, postoffice runs as a SMTP daemon.

FILES

@confdir@/postoffice.cf
    Default postoffice options.
/etc/aliases
    raw data for alias names.
/etc/aliases.db
    data base of alias names.
/etc/issue.smtp
    smtp server welcome banner.
/var/spool/mqueue/*
    temp files.
/var/db/smtpauth.db
    greylist database.

SEE ALSO
mail(1), rmail(1), syslog(3), aliases(5), @VHOST@.Xr domains.cf 5 , mailaudit(5), postoffice.cf(5), smtpauth(5), usermap(7), @VHOST@.Xr vhosts 7 , mailaddr(7), authexpire(8), sendmail(8), smtpd(8);

DARPA Internet Request For Comments