mta-control

Article:HOWTO53708  |  Created: 2011-06-06  |  Updated: 2012-08-20  |  Article URL http://www.symantec.com/docs/HOWTO53708
Article Type
How To


Environment

Subject


Name

mta-control — control the MTA processes and backup and restore mail queues

SYNOPSIS

mta-control queue command

mta-control pause-mode mode

DESCRIPTION

The mta-control command lets you query MTA queues, and control specific elements within MTA message processing. For example, you can flush message queues.

Note:

Do not use the ~ (tilde) character when you specify output file names, paths, passwords, email addresses, and user names (for exporting). Specify the full path name.

ARGUMENTS

Specify one of the following MTA queues:

  • inbound

  • outbound

  • delivery

  • all

The following components are available:

  • start - Start the queue.

  • stop - Stop the queue.

  • status - Display the current status. The status can be: running, not running, enabled, or disabled.

  • restart - Restart the queue.

  • flush - Reattempt delivery for all queued messages.

  • delete-msgs-by-sender regexp - Delete from the queue all messages with Envelope Sender that matches the given Perl regular expression (case insensitive).

  • delete-msgs-by-rcpt regexp - Delete from the queue all messages with an Envelope Recipient that matches the given Perl regular expression (case insensitive).

    Note:

    This deletes the entire message, not just the recipient.

  • delete-msg-by-id queue-ID - Delete the message with the given queue-ID from the queue.

  • delete-all-msgs - Delete all messages from the queue.

  • active-routes - Print all active routes and the number of messages for each route.

  • num-messages-in-route route - Print the number of messages for the given route.

  • num-msgs-by-rcpt recipient - Print the number of messages by a given recipient

  • num-msgs-by-rcpt-all-routes recipient - Print the number of messages by a given recipient for all routes.

  • list-msgs route - Print the messages for the given route.

  • list-msg-details msgid - Given a message ID, print details about that message.

  • route-info route - Display DNS lookup information, destination, and number of messages for a route.

  • reroute src-routedst-route - Reroute messages from src-route to dst-route.

  • delete-msgs-by-sender perl regexp - Delete from the queue all messages with an envelope sender that matches the given Perl regular expression (case insensitive).

  • delete-msgs-by-rcpt perl regexp - Delete from the queue all messages with an envelope recipient that matches the given Perl regular expression. Note that this deletes the entire message, not just the recipient (case insensitive).

  • delete-msg-by-id queue-ID - Delete the message with the given queue-ID from the queue. Note that the ID is only unique per queue.

  • delete-all-msgs - Delete all messages from the queue.

  • import-queues url - Import an entire mail queue from backup. Specify all for the queue. Ensure that the MTA is running before importing a mail queue. To start the MTA, run mta-control all start. Specify the URL as described for the export-msg-by-id component.

  • export-queues url - Back up the mail queue to a URL. Specify all for the queue. Ensure that the MTA is stopped before exporting the mail queue. To stop the MTA, run mta-control all stop. Specify the URL as described for the export-msg-by-id component.

  • export-msg-by-id queue-ID [url] - Export the message with the given queue-ID from the queue and save it to the specified URL. If you do not specify a URL, the message data is displayed on the screen. If you do not specify the FTP password, mta-control prompts you for the password. If you specify a path that ends with '/', Symantec Messaging Gateway stores the file in that location using a default file name. Otherwise, Symantec Messaging Gateway stores the file with the file name that you specified in the path. The URL syntax is as follows:

    scp://'user'\@host/path (user is prompted for password)

    ftp://'user':'password'\@host[:port]/path

    ftp://'user'\@host[:port]/path

    Put a double-quote character before and after the URL. If any part of the URL contains special characters, such as full or double quotes, put a backslash before each special character.

  • query-queue - Query the message queue.

    • The following additional parameters are accepted:

    • sender_match=perl regexp

    • rcpt_match=perl regexp

    • deferred - selects the messages that are deferred

    • include_subject

    • start=N

    • limit=N

    • format=neat|xml

      The parameters sender_match, rcpt_match, and deferred are logically ANDed together if present. The intermediate result set after you apply these matches is sorted by date, and then the start and limit are applied: \$start messages are skipped and then \$limit messages are returned. The default is to show all messages in 'neat' format, which is meant to be human readable.

  • bad-msg-list - List the times and IDs of messages in the bad message queue. The queue is either inbound or outbound.

  • bad-msg-export queue-ID [url] - Export or display the message. See export-msg-by-id for URL format.

    To display the message on the screen, type mta-control queue bad-msg-export queue-ID.

    Specify the URL as described for the export-msg-by-id component.

  • bad-msg-delete queue-ID - Delete the message.

  • bad-msg-bypass queue-ID - Submit the message for delivery to the original recipients and bypass scanning.

  • bad-msg-forward queue-IDaddress - Submit a copy of the message for delivery to the given address and bypass scanning. The original bad message remains in the bad message queue.

  • bad-msg-retry queue-ID - Retry scanning the message as if it were new.

The six pause modes affect email scanning (scan), acceptance (accept), and delivery (delivery). Each pause mode sets scanning, acceptance, and delivery to a particular state as described below, regardless of the previous state of scan, accept, and delivery. Pause modes are as follows:

  • status - Display the current pause mode status. If you type mta-control pause-mode, mta-control displays the pause mode status.

  • pause-accept - Set scan to running and set accept to paused. The delivery state is not affected by pause-accept.

  • pause-deliver - Set delivery to paused. The accept and scan states are not affected by pause-deliver. This is equivalent to mta-control delivery stop.

  • pause-scan - Set scan to paused and set accept to running. The delivery state is not affected by pause-scan.

  • resume-accept - Set scan to running and set accept to running. The delivery state is not affected by resume-accept.

  • resume-deliver - Set delivery to running. The accept and scan states are not affected by resume-deliver. This is equivalent to mta-control delivery start.

  • resume-scan - Set scan to running and set accept to running. The delivery state is not affected by resume-scan.

EXAMPLES

Example 1

Show the status of the MTA (inbound, outbound, and delivery queues and whether they are running or not).

mta-control pause-mode status

Example 2

Do not accept any new mail on the appliance but scan mail in the queue. This command does not affect the delivery of email.

mta-control pause-mode pause-accept

Example 3

Accept email on the appliance, but do not scan it. This command does not affect the delivery of email.

mta-control pause-mode pause-scan

Example 4

Do not deliver email on the appliance.

mta-control pause-mode pause-deliver

Example 5

Accept and scan email on the appliance. This command does not affect the delivery of email.

mta-control pause-mode resume-accept

Example 6

Accept and scan email on the appliance. This command does not affect the delivery of email.

mta-control pause-mode resume-scan

Example 7

Deliver email on the appliance.

mta-control pause-mode resume-deliver

Example 8

Display the queue-id of messages in delivery queue.

mta-control delivery query-queue

Example 9

View a raw message in the delivery queue with a message queue-id.

mta-control delivery export-msg-by-id 00/00-25597-EFD46794

Example 10

Export a specific message from the delivery queue with a message queue-id. The message queue-id is 00/00-25597-EFD46794. Export it to the 192.168.159.99 SCP server in the /tmp directory with the support account. mta-control queries for the password.

mta-control delivery export-msg-by-id 00/00-25597-EFD46794 "scp://support\@192.168.159.99/tmp/"

Example 11

Export all message queues. Export the message queue file to the 192.168.159.99 FTP server in the /tmp directory with the sysadmin account. Since a password is not specified, mta-control queries for the password.

mta-control all export-queues "ftp://sysadmin\@192.168.159.99/tmp/"

Example 12

mta-control all query-queue

Show all messages currently in the inbound queue, the outbound queue, and the delivery queue.


Legacy ID



v25780707_v58306712


Article URL http://www.symantec.com/docs/HOWTO53708


Terms of use for this information are found in Legal Notices