Previous Page TOC Index Next Page


Post.Office Utilities

This chapter discusses the several special purpose utilities which are distributed with Post.Office. These utilities allow you to interact with Post.Office from the command line and facilitate the handling of large groups of repetitive transactions. The topics in the this chapter include:


11.1 Executing the Utilities

This section pertains to the execution of the Post.Office command-line utilities for account management, mailing list management, and system configuration. This information does not apply to the sendmail replacement utility. The sendmail replacement utility is described in Section 11.5.

Note that the instructions differ by operating system. Please refer to the appropriate section below for instructions

11.1.1OSX

To execute the account and mailing list management utilities, you must log in to the server system as root. Most utilities can be executed whether Post.Office is running or not, so you may shut down Post.Office before using the utilities if you wish.

The utilities are installed in the /usr/local/post.office/cmdutils directory. However, because many utilities create files which can clutter up this directory, you should execute them from a working directory where you plan to store the user profiles, list profiles, or other information returned by the utilities. This directory is not added to the system’s PATH environment variable on installation, so if you want to use the utilities, you should update your PATH to include this directory.


11.2 System Utilities

The system utilities provide you with directory locations of Post.Office files on the server file system. This information is useful during troubleshooting. Although these directory locations can be viewed in the Licensing/Configuration Form described in Chapter 4, Post.Office must be running and you must log in to the web interface to access this form. The system utilities, on the other hand, can get this information regardless of whether Post.Office is running.
Utility Comment
getmailboxdir returns the Post.Office mailboxes directory
getspooldir returns the Post.Office spool directory

11.2.1 getmailboxdir – Get Mailbox Directory Utility

The getmailboxdir utility displays the full path on the server file system to the Post.Office mailbox directory.

Usage

11.2.2 getspooldir – Get Spool Directory Utility

The getspooldir utility displays the full path on the server file system to the Post.Office spool directory.

Usage


11.3 Account Management Utilities

The account management utilities have been designed to aid administrators of larger installations in routine account maintenance, and provide a facility for executing high-volume operations, such as the creation of multiple user accounts. These utilities can also help to automate the moving of accounts from one installation of Post.Office to another, or from another mail server into Post.Office.

11.3.1 Utilities Summary

The following table summarizes the Post.Office account management utilities. Each utility is described in greater detail later in this section.
Utility Comment
addacct adds a user account to Post.Office
changeacct modifies an existing account
delacct deletes an existing account
getacct gets the user profile for an existing account
getpopmbox gets the full path to the user’s mailbox directory on the server file system
getuid gets the account UID (the unique identifier) of an existing account
listacct lists specified account info, for specific accounts or all accounts
lockacct locks an account, preventing POP delivery and user modification
reportusage reports the POP mailbox usage
unlockacct unlocks an account, restoring POP delivery and allowing user modification

11.3.2 Definitions

The following terms are used in this section:

address. SMTP e-mail address of a user, in the format user@host.domain.

user account. User information stored in the Post.Office user accounts database (MTA-Accounts).

user profile. A formatted text file containing the information of a user account. User profiles are named after the account UID, with an .acct file extension. Examples of user profiles are given in the next section.

Name. The real name of a user as found in the Name field of a user profile. This name corresponds to the Real Name field of the Post.Office Account Data Form.

UID. A unique string used to identify an account within Post.Office. By default, the UID for an account is the Real Name, with spaces and other non-alphanumeric characters replaced by underscore (_) characters. The UID of an account is set at time of account creation and cannot be modified. The UID of an account is displayed at the bottom of the Account Data Form.

POP name. The POP3 login name of the specified user (does not contain the "@" symbol or host/domain names).

11.3.3 User Profile Form

Creating and modifying Post.Office accounts with the addacct and changeacct utilities requires a user profile, a specifically-formatted text form that contains account information. User profiles can be passed to these utilities from a file or from the standard input. When given in a file, the file must be named after the account UID, with a .acct file extension. For example, modifying the account associated with the UID John_Doe requires a file named John_Doe.acct which contains the properly-formatted new account values.

The following is a blank user profile file. The new data for each account attribute is provided between the brackets next to the appropriate field label.
Access-Domains: []
AutoReply-Info: []
AutoReply-Mode: []
Directory-Access: []
Finger-Access: []
Finger-Info: []
Forward-Delivery: []
Handler-Delivery: []
Home-URL: []
Local-Delivery: []
Logon-Id: []
Mailbox-Quota: []
Name: []
POP-Address: []
ProgDel-Account: []
Program-Deliver-Info: []
Raw-Password: []
SMTP-Address: []
SMTP-RewriteStyle: []
Use-Logon-PW: []

Items in the profile for which no data is specified will assume the default value during account creation, or the existing value during account modification. However, when creating accounts, the following items require data to be provided: Name, Password, SMTP-Address, and either Local-Delivery or Forward-Delivery.

Some items in the user profile form can contain only single values, while others allow for multiple values. Some are also limited to a range of specific values. The following table lists the attributes of each user profile item:
Item Values Limited to
Access-Domains multiple legal hostnames, domains, or IP addresses
AutoReply-Info multiple ASCII text
AutoReply-Mode single must be one of: vacation, reply, echo
Directory-Access single any of: d (default), l (local only), r (local and remote), u (unlisted)
Finger-Access multiple legal hostnames, domains, or IP addresses
Finger-Info multiple ASCII text
Forward-Delivery multiple legal RFC821 addresses (e.g., user@domain)
Handler-Delivery single empty string or AutoReply-Handler
Home-URL single fully-qualified URL, including the protocol identifier (http, ftp, etc.)
Local-Delivery multiple one or more of: Mailbox, UNIX, Program
Logon-Id single Username of NT account corresponding to Post.Office account (NT platforms only)
Mailbox-Quota single integer, units in Kbytes
Name single ASCII text
Password single 6 characters minimum, cannot start or end with space/tab
POP-Address single cannot contain spaces or ‘@’
ProgramDel-Account single Username of account that has access to execute Program Delivery applications (NT platforms only)
Program-Deliver-Info multiple ASCII text
Raw-Password single Encrypted password value. This value should not be modified.
SMTP-Address multiple legal RFC821 addresses (e.g., user@domain)
SMTP-RewriteStyle single must be one of: comment, quoted, none
UNIX-UserName single same restrictions as UNIX user names (UNIX platforms only)
Use-Logon-PW single yes/no (NT platforms only)

Multiple values are represented separately in bracket pairs on different lines. For example, in the following user profile, the SMTP-Address field specifies multiple e-mail addresses for this account:

Access-Domains: [software.com]
AutoReply-Info: [Attending E-Mail World in Chicago,]
[returning June 17.]
AutoReply-Mode: [vacation]
Directory-Access: [d]
Finger-Access: []
Finger-Info: []
Forward-Delivery: [SMTP <mojo@someisp.net>]
Handler-Delivery: []
Home-URL: [http://home.software.com/~mojo]
Local-Delivery: [Mailbox]
Logon-Id: []
Mailbox-Quota: [1000]
Name: [Max Johnson]
POP-Address: [mojo]
ProgDel-Account: []
Program-Deliver-Info: []
Raw-Password: [be813fdc029ec0dcf2aec1bb4f7bc7b88605855f]
SMTP-Address: [max@software.com]
[maxj@software.com]
[max.johnson@software.com]
[mojo@software.com]
SMTP-RewriteStyle: [comment]
Use-Logon-PW: [no]

11.3.4 addacct – Add Account Utility

The addacct utility adds a user account to Post.Office, given a user profile. By default, user profile information is taken from a file, but can be taken instead from standard input by including "-" on the command line after the account UID. The required structure for a user profile is illustrated in the previous section.

Usage

Example

This command creates an e-mail account, based on the user profile contained in the file named John_Doe.acct.

Redirects output of program your_program to addacct, which uses it as the user profile data for account John_Doe.

11.3.5 changeacct – Change Account Data Utility

The changeacct utility updates an existing account with information from a given user profile. By default, user profile information is taken from a file, but can be taken instead from standard input by including "-" on the command line after the account UID.

Usage

Example

Updates the account corresponding to the UID John_Doe with information contained in the user profile file John_Doe.acct.

Redirects output of program your_program to changeacct, which uses it as the user profile data for account John_Doe.

11.3.6 delacct – Delete Account Utility

The delacct utility deletes an existing account, given an account UID or address. This utility does not operate directly on the accounts database (as do the other utilities), so Post.Office must be running when you use this utility.

Usage

Example

Deletes the account associated with this UID.

11.3.7 getacct – Get User Account Profile Utility

The getacct utility gets the user profile for a Post.Office account, given an account UID. The user profile is returned to the standard output, or to a file named UID.acct.

Although the account password is one of the items returned by getacct, this value is returned in encrypted format, which can be subsequently used by other Post.Office utilities. Unencrypted passwords cannot be retrieved from the accounts database.

Usage

Example

Returns user profile information to the file John_Doe.acct.

Prints the user profile for this account to standard output.

11.3.8 getpopmbox – Get POP Mailbox Directory Utility

The getpopmbox utility returns the full path to a user’s POP mailbox on the server file system, given an account UID. This information is useful for system operations such as moving mailboxes from one drive to another.

Usage

Example

This command returns the full path to the POP mailbox directory for the account John_Doe.

11.3.9 getuid – Get User ID Utility

The getuid utility returns the account UID corresponding to a given address, POP login name, or account Real Name to the standard output.

Usage

Example

Retrieves the account UID for the account associated with this address and prints it to the standard output.

Gets the account UID for the account associated with this Real Name.

11.3.10 listacct – List Account Data Utility

The listacct utility returns specified user profile account attributes, for all users or for a specific user, to the standard output. The requested account attributes are included as command line parameters, and can include any of the following items:

Although the account password is one of the items that can be returned by listacct, this value is returned in encrypted format, which can be subsequently used by other Post.Office utilities. Unencrypted passwords cannot be retrieved from the accounts database.

By default, requested values are comma-separated. However, you can specify a different separator by using the -s flag, which must be followed by the new separator (enclosed in ‘single quotes’).

Usage

Example

Prints the UID and Real Name values for all e-mail accounts to the standard output. Values are comma separated.

Prints the POP-Address for the account associated with UID John_Doe.

Prints the account UID and POP name for all accounts, using the colon (:) character to separate values.

11.3.11 lockacct – Lock Account Utility

The lockacct utility locks the specified account. Locking an account prevents user access to account information, and also prevents delivery of mail via POP. Accounts remain locked until unlocked with the unlockacct utility or via the web interface.

Usage

Example

Locks the account associated with the UID John_Doe, preventing POP mail delivery and account modification.

11.3.12 reportusage – Report POP Mailbox Usage Utility

The reportusage utility returns the POP mailbox usage for the specified Post.Office account to the standard output.

Usage

Example

Reports the current POP mailbox usage for the account associated with the UID John_Doe.

11.3.13 unlockacct – Unlock Account Utility

The unlockacct utility is used to unlock previously locked accounts.

Usage

Example

Unlocks the account associated with the UID John_Doe, allowing POP mail delivery and account modification.


11.4 Mailing List Management Utilities

Like the account management utilities, the mailing list management utilities have been designed to aid administrators of larger installations in routine mailing list maintenance, and provide a facility for executing high-volume operations, such as the creation of multiple mailing lists.

11.4.1 Utilities Summary

The following table summarizes the Post.Office mailing list management utilities. Each utility is described in greater detail later in this section.
Utility Comment
addlist adds a mailing list to Post.Office (requires all mailing list data)
addlistshort adds a mailing list to Post.Office (requires minimum list data)
changelist modifies an existing mailing list
deletelist deletes an existing mailing list
getlist gets the mailing list profile for a mailing list
listmlists gets the ULID of a specific mailing list or all mailing lists
listsubscribers gets the list of subscribers for a mailing list
subscribe subscribes a user to a mailing list, regardless of list policies
unsubscribe unsubscribes a user from a mailing list, regardless of list policies

11.4.2 Definitions

The following terms are used in this section:

list profile. A formatted text file containing the information of a mailing list. List profiles are named after the list ULID, with a .list file extension. Examples of list profiles are given in the next section.

ULID. A unique string used to identify an mailing list within Post.Office. The ULID for a mailing list is always the same as its List Name, so you think of this as the List Name if you’d like. Like the List Name, the ULID is set at time of mailing list creation and cannot be modified. The ULID of a mailing list is displayed at the bottom of the Mailing List Data Form.

11.4.3 List Profile Form

Creating and modifying mailing lists with the addlist and changelist utilities requires a list profile, a specifically-formatted text form that contains mailing list information. List profiles can be passed to these utilities from a file or from the standard input. When given in a file, the file must be named after the list ULID, with a .list file extension. For example, modifying the mailing list associated with the ULID employees requires a file named employees.list which contains the properly-formatted new mailing list values.

The following is a blank list profile file. The new data for each mailing list attribute is provided between the brackets next to the appropriate field label.

Subscriber-List-Access: []
Finger-Access: []
Finger-Info: []
List-Address-Expansion-Style: []
List-Approved-Posters: []
List-Digest-Restriction: []
List-Digest-Schedule: []
List-Epilogue: []
List-Headers-To-Add: []
List-Headers-To-Remove: []
List-Local-Domains: []
List-Local-Subscriber-Policy: []
List-Locked: []
List-Long-Info: []
List-Max-Kbytes-Per-Day: []
List-Max-Message-Kbytes: []
List-Max-Messages-Per-Day: []
List-Max-Subscribers: []
List-Moderate-Unsubscriptions: []
List-Moderation-Method: []
List-Name: []
List-Nonsubscriber-Posting-Policy: []
List-Other-Rewrites: []
List-Owners: []
List-Priority: []
List-Prologue: []
List-Remote-Subscriber-Policy: []
List-Remove-X-Headers: []
List-Request-Detection: []
List-Short-Info: []
List-Stats-Mode: []
List-Subscriber-Posting-Policy: []
List-Suppress-Duplicates: []
List-Suppress-Notifications: []
List-Unsubscribe-Info: []
List-Verify-Subscriptions: []
List-Verify-Unsubscriptions: []
List-Welcome-Info: []
ListMgr-SMTP-Address: []
ListOwner-SMTP-Address: []
SMTP-Address: []

Items in the list profile for which no data is specified will assume the default value during mailing list creation, or the existing value during mailing list modification. Some items in the list profile form can contain only single values, while others allow for multiple values. Some are also limited to a range of specific values. The following table lists the attributes of each list profile item:
Item Values Limited to
Finger-Access multiple legal hostnames, domains, or IP addresses
Finger-Info single ASCII text
List-Address-Expansion-Style single One of the following: none, group, expand
List-Approved-Posters multiple legal RFC821 addresses (user@domain)
List-Digest-Restriction single One of the following: none, digest-only, immediate-only
List-Digest-Schedule multiple One or more of the following: daily, weekly. Individual days and times can also be specified as in the Mailing List Data Form; see Chapter 7 for the correct format
List-Epilogue single ASCII text
List-Headers-To-Add multiple legal RFC821 headers (X-Post-Office:)
List-Headers-To-Remove multiple legal RFC821 headers (X-Post-Office:)
List-Local-Domains multiple legal host and domain names
List-Local-Subscriber-Policy single One of the following: open, moderated, closed-notify, closed
List-Locked single yes/no
List-Long-Info single ASCII text
List-Max-Kbytes-Per-Day single integer, units in Kbytes
List-Max-Message-Kbytes single integer, units in Kbytes
List-Max-Messages-Per-Day single integer
List-Max-Subscribers single integer
List-Moderate-Unsubscriptions single yes/no
List-Moderation-Method single One of the following: queue-no-mail, queue-notify, noqueue-fwd-nomime. These correspond to the moderation modes Web Only, Web and E-mail, and E-mail Only.
List-Name single letters (A-Z, a-z), numbers (0-9), addition (+), subtraction (-), and underscore (_)
List-Nonsubscriber-Posting-Policy single One of the following: open, moderated, closed-notify, closed
List-Other-Rewrites multiple See Chapter 7 for the correct syntax for defining header rewriting
List-Owners multiple legal RFC821 addresses (user@domain) for a local user account
List-Priority single One of the following: low, normal
List-Prologue single ASCII text
List-Remote-Subscriber-Policy single One of the following: open, moderated, closed-notify, closed
List-Remove-X-Headers single yes/no
List-Request-Detection single yes/no
List-Short-Info single ASCII text
List-Stats-Mode single on/off
List-Subscriber-Posting-Policy single One of the following: open, moderated, closed-notify, closed
List-Suppress-Duplicates single yes/no
List-Suppress-Notifications multiple One or more of: FilterBounceNotice, OverLimitNotification
List-Unsubscribe-Info single ASCII text
List-Verify-Subscriptions single yes/no
List-Verify-Unsubscriptions single yes/no
List-Welcome-Info single ASCII text
ListMgr-SMTP-Address multiple legal RFC821 addresses (user@domain)
ListOwner-SMTP-Address multiple legal RFC821 addresses (user@domain)
SMTP-Address multiple legal RFC821 addresses (user@domain)
Subscriber-List-Access multiple legal hostnames, domains, or IP addresses

Multiple values are represented separately in bracket pairs on different lines. For example, in the following list profile, the addresses fields specify multiple e-mail addresses for this mailing list:

Subscriber-List-Access: [subscribers]
Finger-Access: []
Finger-Info: [To subscribe to this mailing list, send a]
['subscribe' request to the following address:]
[anglers-request@software.com]
List-Address-Expansion-Style: [none]
List-Approved-Posters: [<postmaster@software.com>]
List-Digest-Restriction: [none]
List-Digest-Schedule: [daily 5 pm]
List-Epilogue: [---------------------------------]
[To unsubscribe from this list, send an ]
['unsubscribe' request to the following address:]
[]
[anglers-request@software.com]
List-Headers-To-Add: [Reply-To: anglers@software.com]
List-Headers-To-Remove: [Reply-To:]
List-Local-Domains: [rex.software.com]
List-Local-Subscriber-Policy: [moderated]
List-Locked: [no]
List-Long-Info: [This is a group of folks here in Santa Barbara, ]
[CA who like fishin'.]
List-Max-Kbytes-Per-Day: [1000]
List-Max-Message-Kbytes: [10]
List-Max-Messages-Per-Day: [20]
List-Max-Subscribers: [50]
List-Moderate-Unsubscriptions: [yes]
List-Moderation-Method: [queue-notify]
List-Name: [anglers]
List-Nonsubscriber-Posting-Policy: [closed-notify]
List-Other-Rewrites: [prefix subject: "anglers: "]
List-Owners: [<john.doe@software.com>]
List-Priority: [low]
List-Prologue: [--> The Anglers Mailing List <--]
List-Remote-Subscriber-Policy: [moderated]
List-Remove-X-Headers: [yes]
List-Request-Detection: [yes]
List-Short-Info: [Angler society of Santa Barbara]
List-Stats-Mode: [on]
List-Subscriber-Posting-Policy: [open]
List-Suppress-Duplicates: [no]
List-Suppress-Notifications: [FilterBounceNotice]
[OverLimitNotification]
List-Unsubscribe-Info: [Goodbye, angler ... may your bait be ]
[lively, and your catch plentiful. To come ]
[back into our fishin' family, send your ]
[subscription request to:]
[anglers-request@software.com]
List-Verify-Subscriptions: [no]
List-Verify-Unsubscriptions: [yes]
List-Welcome-Info: [Welcome, fellow fisherperson, to the angler's ]
[mailing list. Send your insightful fishing ]
[comments to:]
[anglers@software.com]
ListMgr-SMTP-Address: [<anglers-request@software.com>]
ListOwner-SMTP-Address: [<owner-anglers@software.com>]
SMTP-Address: [anglers@software.com]
[anglers@rex.software.com]

11.4.4 addlist – Add Mailing List Utility

The addlist utility creates a mailing list in Post.Office, given a list profile. By default, list profile information is taken from a file, but can be taken instead from standard input by including "-" on the command line after the list ULID. The required structure for a list profile is illustrated in the previous section.

Usage

Example

This command creates a mailing list, based on the list profile contained in the file named employees.list.

Redirects output of program your_program to addlist, which uses it as the list profile data for the mailing list employees.

11.4.5 addlistshort – Add Mailing List Utility

The addlistshort utility offers a shortcut for creating mailing lists, and is similar to the New Mailing List – Short Form described in Chapter 7. It requires only a ULID and e-mail address for the owner of the new mailing list, and does not require a list profile. All other mailing list data for the new list is taken from the data specified in the Default Mailing List Data Form in the web interface.


Note: Only one list owner can be specified when creating mailing lists with the addlistshort utility. To create mailing lists that have more then one owner, use addlist.

Usage

Example

Creates a new mailing list which has the ULID employees and which is owned by the local user who has the e-mail address john.doe@software.com.

11.4.6 changelist – Change List Data Utility

The changelist utility updates an existing mailing list with information from a given list profile. By default, list profile information is taken from a file, but can be taken instead from standard input by including "-" on the command line after the list ULID.

Usage

Example

Updates the mailing list corresponding to the ULID employees with information contained in the list profile file employees.list.

Redirects output of program your_program to changelist, which uses it as the list profile data for the mailing list employees.

11.4.7 deletelist – Delete List Utility

The deletelist utility deletes an existing mailing list, given a ULID. This utility does not operate directly on the lists database (as do the other utilities), so Post.Office must be running when you use this utility.

Usage

Example

Deletes the list associated with this ULID.

11.4.8 getlist – Get List Profile Utility

The getlist utility gets the list profile for a Post.Office mailing list, given a ULID. The list profile is returned to standard output, or to a file named ULID.list. By default, list profile information is written to a file, but can be printed instead to standard output by including "-" on the command line after the list ULID.

Usage

Example

Returns list profile information to the file employees.list.

Prints the list profile for this mailing list to standard output.

11.4.9 listmlists – Get List ULID Utility

The listmlists utility generates a list of mailing lists in Post.Office. It can also optionally display the current number of subscribers for each mailing list.

By default, the output of listmlists contains the names of all mailing lists. However, to display only those lists which are available for local subscription (i.e., the mailing lists that are visible to local users through the web and e-mail interfaces), you can include the UID of an existing Post.Office account as a command-line parameter.

Usage

Example

Returns the ULID of all Post.Office mailing lists to the standard output.

Returns the ULID of all Post.Office mailing lists that are available to the local user whose UID is John_Doe.

Returns the ULID and subscriber count (separated by a colon character) of all Post.Office mailing lists. For example:

11.4.10 listsubscribers – Get List Subscribers Utility

The listsubscribers utility returns the list of subscribers for the mailing list corresponding to a given ULID.

Usage

Example

Returns the list of subscribers for the mailing list employees.

11.4.11 subscribe – Add Subscribers Utility

The subscribe utility adds users to a mailing list. This command can be used in a variety of ways, depending on how you want the users to be subscribed, and the source of the subscriber addresses. In all cases, the ULID of a specific mailing list must be included as an argument.

By default, this utility submits a subscription request for the given user(s) – a request which is subject to verification and list owner moderation. However, you can instead add the user directly to the subscriber list, regardless of subscription policies, by including the -f flag.

The address of the new subscriber must be either given as a command-line argument, entered from standard input, or specified in a file. Only one subscriber address can be specified on the command-line, so subscribing multiple addresses requires you to enter the subscriber addresses from standard input (specified by entering "-i -"), or from a file of addresses (specified by "-i filename").

Another option for this command is the -q flag, which suppresses the sending of welcome messages. By default, subscribers added to a mailing list with the subscribe utility receive the list’s welcome message, just as if they had subscribed themselves to the mailing list. When -q is included, users who are added to the selected mailing list do not receive the welcome message.

Finally, you can request the mode of delivery (digest or immediate) for the new subscribers by specifying the appropriate keyword as the final command-line argument. You can omit a delivery mode if you like; in this case, the subscribers are added using the immediate mode of delivery (unless this mode is not supported by the list).

Usage

Example

Requests subscription for user susie.queue@software.com to the mailing list employees. This request may be denied, moderated, or subject to verification, depending on the subscription policies of the mailing list. The user will receive a welcome message if added to the list.

Immediately adds the user john.doe@software.com to the mailing list employees, regardless of the subscription policies of this mailing list.

Immediately adds multiple subscribers to the mailing list League, with the addresses of the new subscribers entered from standard input. These subscribers will not receive a welcome message, and are added with the digest mode of delivery.

Immediately adds the addresses specified in the file roster.txt to the mailing list baseball_team. These subscribers receive the list’s welcome message, and are added with the immediate mode of delivery.

11.4.12 Unsubscribe – Remove Subscribers Utility

The unsubscribe utility removes users from mailing lists. This command can be used in three ways: The first removes a particular subscriber from one or more mailing lists. The second removes multiple subscribers from one or more mailing lists, with the users entered from standard input (indicated by specifying "-i -"). The third option is similar to the second, but takes subscriber addresses from a file (indicated by specifying "-i filename") instead of from standard input.

For all three uses of this command, you can either specify the ULID of a particular list, or use the -a flag to remove the specified user(s) from all mailing lists.

As with the subscribe command, the unsubscribe command includes a -f option to circumvent the unsubscription policies of the selected list(s). If this flag is omitted, the unsubscribe utility will simply make unsubscription requests, which are subject to verification and list owner moderation.

Yet another option is the -q flag, which suppresses the sending of farewell messages. By default, subscribers removed from a mailing list with the unsubscribe utility receive the list’s farewell message, just as if they had unsubscribed themselves from the mailing list. When the -q is included, users who are removed from the selected mailing list(s) do not receive the farewell message.

The typical usage of the unsubscribe utility is the removal of a particular user from all mailing lists (either because the account has been discontinued, or because the user has violated some policy). In this case, verification, moderation, and the farewell message are not desirable, so you would execute unsubscribe with the -f, -q, and -a flags (as shown in the first example below).

Usage

Note that any execution of this utility requires either the -a flag or the ULID of an existing mailing list.

Example

Immediately removes the user bugs.meany@software.com from all Post.Office mailing lists, and does not send farewell messages to this user.

Immediately removes the users entered from standard input from all Post.Office mailing lists, and does not send farewell messages to these users.

Immediately removes from the mailing list baseball_team the users whose addresses are listed in the file cutlist.txt. These users receive a farewell message to inform them that they have been removed from the list.


11.6 sendmail



Post.Office includes a utility that replaces the standard OSX sendmail utility. This Post.Office utility, also named sendmail, actually has fairly limited use since practically all of the functions of the standard UNIX sendmail are performed by Post.Office. However, this additional Post.Office sendmail utility is needed for compatibility with many mail programs that employ the standard sendmail utility to deliver their mail, rather than using SMTP. It can also be used to start up the Post.Office mail system, and check and deliver the mail queue.


Note: Sorry, we know it can be confusing to talk about two different UNIX programs which are both named sendmail. For clarity, we’ll refer to the regular ol’ sendmail as the standard sendmail, with our own version referred to as the Post.Office sendmail utility, or the sendmail replacement.

Probably the most important reason to have the Post.Office replacement sendmail program is to maintain compatibility with existing software that delivers mail using the sendmail command. This software runs the sendmail command and feeds it the message to be delivered. It is then left up to sendmail to deliver the message to all the recipients.

Some examples of commands that work for sending mail are:

/usr/lib/sendmail -t < /tmp/message

cat file1 | /usr/lib/sendmail -oem recip1,recip2

For a complete list of command-line switches and options related to sending mail, see the reference section that follows (11.6.4).

11.6.1 Starting Post.Office with sendmail

Since the standard sendmail comes installed on most UNIX-based machines, many scripts such as system boot scripts exist to start up sendmail. This is done with a command like:

/usr/lib/sendmail -bd -q30m

The sendmail replacement provided with Post.Office recognizes this and starts up Post.Office if it is not already running. The -q30m switch is ignored in this command since queue intervals are set up in the system configuration of Post.Office.

11.6.2 Checking the Mail Queue

Many system administrators are used to typing `mailq' to check for queued messages. The sendmail replacement provided with Post.Office will respond to this command with the contents of the mail queue. However, most users prefer to use the Post.Office List of Queued Mail Forms (both web and e-mail), which makes processing the queue a little easier. We recommend that you use these forms (as described in Chapter 8) when dealing with queued mail.

11.6.3 Other Modes

The standard sendmail program has a few other operating modes which are not necessary or are not supported in Post.Office. For a complete list of supported operating modes, command-line switches and options, see the reference section below.

11.6.4 Reference Guides

This reference section lists all the available command-line arguments that the Post.Office sendmail replacement program recognizes, along with the behavior that can be expected when they are used. Certain options are recognized (via the -o command-line switch) and their effects are noted in a separate table.

Alternate Names for sendmail

The standard sendmail program can be run under several names as a shorthand way to specify the action to perform. The sendmail replacement program recognizes several alternate names. The behavior that results from invoking the sendmail replacement with one of the alternate names is summarized in the following table.
Name Default Behavior
sendmail Send a single mail message
newaliases Prints an error message since the aliases file is not used
mailq Report the contents of the mail queue
smtpd Run the Post.Office daemon
bsmtp Prints an error message since batch SMTP is not supported

It is important to note that the behavior listed in the above table is the behavior that will result if no other behavior is specified using a command-line option such as -b or -I.

sendmail Command Line Switches

Command-line switches are processed using getopt(3) as in V8 sendmail. All of the switches supported by V8 sendmail, IDA sendmail and other versions of the standard sendmail are recognized, and the extent of support for these switches is noted in the following table.

Switch Impact on Behavior
-B If set to 7bit, the high bit is stripped from every byte of the input message
-b Changes the mode of operation. The following modes are supported: -bd Start the Post.Office mail system
-bm Send a single mail message
-bp Show the status of the mail queue
These modes are recognized but not supported: -ba Use Arpanet protocols
-bb Do batch SMTP on standard input
-bi Initialize the aliases database
-bs Do SMTP on standard input
-bt Go into address testing mode
-bz Freeze the configuration
-C None. There is no configuration file, so this switch is ignored.
-c None. This switch is obsolete.
-d None. This switch is ignored since there is no debug mode.
-e Sets the error reporting mode (see option ‘e’ below).
-F Sets the full name of the sender. If the user running sendmail is not either root, daemon, uucp, smtp, mail, or sendmail, then a header is added to the message indicating the actual sender.
-f Sets the e-mail address of the sender. The same precaution is taken as in the -F switch above.
-h None. The hop count is determined by counting the number of Received headers in the message.
-I Runs as if invoked as ‘newaliases’ which just prints an informational message.
-i None. This is the default behavior. If sendmail is run interactively, a single ‘.’ will end the message. If it is run non-interactively, e.g. via a pipe to standard input, then the end-of-file condition determines the end of the message.
-M The entire queue is processed regardless of the specified Message ID.
-m None. This is the default behavior. The sender is never removed from the list of recipients if it is listed as a recipient.
-n None. This switch is not supported.
-o Sets an option. See the next section for a list of supported options.
-p None. This switch is not supported.
-q The deferred message queue is processed. If a time interval is given (as in ‘sendmail -bd -q30m’) then this switch is ignored. If specified as -qR, -qS, or -qI (as in V8 sendmail), then the behavior is the same as -R, -S, or -M respectively.
-R Attempts to process the queue for hosts matching the pattern provided (e.g. sendmail -Rabc will start delivery of queued messages for all hosts containing the string ‘abc’).
-r Same as -f switch above.
-S The entire queue is processed regardless of the specified sender.
-s None. This switch is obsolete.
-T None. This switch is obsolete.
-t Recipients are gathered from both the command line and the message header and the message is delivered.
-v Output is more verbose when sending mail.
-x None. This is an illegal switch which is only recognized to prevent printing an error message.
-Z None. There is no frozen configuration file or even a regular configuration file for that matter.

sendmail Options

The sendmail replacement provided with Post.Office does not need a configuration file (sendmail.cf), yet most of sendmail’s options can be set from the command line. Many of the options are meant for the sendmail daemon, but some of them are relevant to the normal operation of sending mail.

All of the options supported by V8 sendmail are recognized and the extent of the support for these options is shown below. Note that the options below only refer to the replacement sendmail program, not to Post.Office as a whole. Many of the options not supported by the sendmail replacement are supported by Post.Office in one way or another. Refer to the relevant sections of the manual to determine how to set parameters within Post.Office.

Option Impact on Behavior
7 If set, the high bit is stripped from every byte of the input message. Also see the -B command-line switch
B This is always set to ‘.’ and can not be changed.
d Currently none. Since messages are always posted to the local SMTP server, the turn-around time is fairly quick so the ‘i’ or interactive mode is always used. However, support for other delivery modes may be added in the future.
e Changes the error reporting mode. Valid modes are ‘e’, ‘m’, ‘p’, ‘q’, and ‘w’. The behavior for each mode is the same as sendmail. However, if the local SMTP server is unavailable for some reason and mode ‘m’ is chosen, the error message will not be deliverable either. In this case, the message is saved in the sender’s ~/dead.letter file.
f None. When a "From " line is received, it is changed to "X-UNIX-From:" to be RFC822 compliant.
I None. See the -i command-line switch for details.
o None. This is the default behavior and can not be disabled.
v Turns on verbose output. Also see the -v command-line switch.
others No other options have any effect. All other options, even invalid ones, are silently ignored.

Post.Office ©Software.com, Inc. 1994-1998

Previous Page Page Top TOC Index Next Page