POSTOFFICE(8)

NAME
postoffice - internet mail server

SYNOPSIS
postoffice [flags] [address ...]
mailq
newaliases
runq [-v]
smtpd [flags]

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.

-bi Initialize the alias database.

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

-bp Print a listing of the queue.

-bq Process saved 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.

-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 below.

-q  An alternate form of the -bd flag.

-rname
    An alternate form of the -f flag.

-v  Go into verbose mode.

When postoffice is running as a SMTP server, there are a number of processing options that may be set. Options may be set either on the command line using the -o flag or in a configuration file. The options are:

checkhelo
    Check the arguments passed with the HELO and EHLO SMTP command and refuse to do an SMTP conversation with the client if they claim to be the mail server.

clients=N
    Allow only N clients at a time to connect to the server.

debug
    Enable the ESMTP ‘DEBUG’ command, which displays various compile and runtime settings, as well as the current state of the mail envelope.

delay=N
    Set the greylisting delay to N seconds. The delay may be specified as a tagged number, with ‘m’ being minutes. and ‘h’ being hours.

load=N
    When the load average is above N, postoffice will not accept SMTP connections (the default is 4).

nodaemon
    Do not accept mail from <>. This can be useful for blocking spammers and viruses, but it also violates and means that nobody at your site (including mailing lists) will ever get bounce messages when mail cannot be delivered. If your machine is connected to a public network, DON'T SET THIS OPTION unless you're under attack from a malicious spammer.

paranoid
    Do not accept connections from clients that are not registered in the DNS.

hops=N
    Set the hop count to N. The hop count is incremented every time the mail is processed. When it reaches this limit, the mail is returned with an error message,

localmx
    Treat connections from sites that use this machine as an MX as if they were local, and give them the permissions that local clients have.

relay
    Allow all clients to relay mail through this server. If your machine is connected to a public network, DON'T SET THIS OPTION, unless you really want to end up on every antispam blacklist on the planet.

size=size
    Sets the largest message size that postoffice will accept. size is given as a tagged number, with ‘k’ being kilobytes, and ‘m’ being megabytes.

timeout=timeout
    Drop the connection to a client if they are idle longer than timeout. This option violates the word (if not the intent) of the SMTP specification, so the timeout should probably be fairly large. The timeout may be specified as a tagged number, with ‘m’ being minutes, ‘h’ being hours, and ‘d’ being days. For example, ‘timeout=60m’ or ‘timeout=1h’ both set the timeout to one hour.

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_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

/etc/aliases
    raw data for alias names
/etc/aliases.db
    data base of alias names
/var/log/mail.stat
    collected statistics
/var/spool/mqueue/*
    temp files
/var/db/smtpauth.db
    greylist database.

SEE ALSO
mail(1), rmail(1), syslog(3), aliases(5), mailaudit(5), smtpauth(5), mailaddr(7), authexpire(8), sendmail(8), smtpd(8);

DARPA Internet Request For Comments