imta test -rewrite

imta test -rewrite provides a test facility for examining the IMTA's address rewriting and channel mapping process without actually sending a message. Various qualifiers can be used to control whether imta test -rewrite uses the configuration text files or the compiled configuration (if present), the amount of output produced, and so on.

If a test address is specified on the command line, imta test -rewrite applies the IMTA address rewriting to that address, reports the results, and exits. If no test address is specified, imta test -rewrite enters a loop, prompting for an address, rewriting it, and prompting again for another address. imta test -rewrite exits when CTRL-D is entered.

When testing an email address corresponding to a restricted distribution list, imta test -rewrite uses as the posting address the return address of the local postmaster, which is usually postmaster@localhost unless specified by the IMTA option RETURN_ADDRESS in the IMTA Option file.


Syntax

 
imta test -rewrite options
 

The options for this command are:

-address=address  

The argument to the -address option specifies the test address to be rewritten. If this option is omitted, then imta test -rewrite prompts for an address.  

-alias_file=filename  

Specifies an alternate file for imta test -rewrite to use. imta test -rewrite normally consults the default alias file named by the IMTA_ALIAS_FILE option of the IMTA tailor file, /etc/opt/SUNWmail/imta/imta_tailor, during the rewriting process. This option has no effect unless -noimage_file is specified or no compiled configuration exists; any compiled configuration precludes reading any sort of alias file.  

-check_expansions

-nocheck_expansions  

Controls checking of alias address expansion. Normally the IMTA considers the expansion of an alias to have been successful if any of the addresses to which the alias expands are legal. The -check_expansions option causes a much stricter policy to be applied: imta test -rewrite -check_expansions checks each expanded address in detail and reports a list of any addresses, expanded or otherwise, that fail to rewrite properly.  

-configuration_file=file  

Specifies an alternate file to use in place of the file named by IMTA_CONFIG_FILE. Normally, imta test -rewrite consults the default configuration file named by the IMTA_CONFIG_FILE option of the IMTA tailor file, /etc/opt/SUNWmail/imta/imta_tailor, during the rewriting process. This option has no effect unless -noimage_file is specified or no compiled configuration exists; any compiled configuration precludes reading any sort of configuration file.  

-database=database-list  

Disables references to various databases or redirects the database paths to nonstandard locations. imta test -rewrite normally consults the usual IMTA databases during its operation. The allowed list items are alias, noalias, domain, nodomain, general, nogeneral, reverse, and noreverse. The list items beginning with "no" disable use of the corresponding database. The remaining items require an associated value, which is taken to be the name of that database.  

-debug

-nodebug  

Enables the production of the additional, detailed explanations of the rewriting process.This option is disabled by default.  

-delivery_receipt

-nodeliver_receipt  

Sets the corresponding receipt request flags. These options can be useful when testing the handling of sent or received receipt requests when rewriting forwarded addresses or mailing lists.  

-destination_channel=channel  

Controls to which destination or target channel imta test -rewrite rewrites addresses. Some address rewriting is destination channel specific; imta test -rewrite normally pretends that its channel destination is the local channel l.  

-grey=setting  

Controls the setting of the Grey Book flag. By default, this flag has a value of 0.  

-image_file=filename

-noimage_file  

Instructs imta test -rewrite to unconditionally ignore any previously compiled configuration and to read configuration information from the various text files instead. When the -image_file option is specified without an optional file name, imta test -rewrite loads the compiled configuration from the file named by the IMTA_CONFIG_DATA option into the IMTA tailor file, /etc/opt/SUNWmail/imta/imta_tailor, which is usually /etc/opt/SUNWmail/imta/imta.cnf. If, instead, a file name is specified, then imta test -rewrite loads the compiled configuration from the specified file.  

-input=input-file  

Specifies a source for input to imta test -rewrite. By default, imta test -rewrite takes input from stdin.  

-local_alias=value

-nolocal_alias  

Controls the setting of an alias for the local host. The IMTA supports multiple "identities" for the local host; the local host may have a different identity on each channel. This option may be used to set the local host alias to the specified value; appearances of the local host in rewritten addresses are replaced by this value.  

-mapping_file=file

-nomapping_file  

Instructs imta test -rewrite to use the specified mapping file rather than the default mapping file named by the IMTA_MAPPING_FILE option in the IMTA tailor file, /etc/opt/SUNWmail/imta/imta_tailor, which is usually the file named /etc/opt/SUNWmail/imta/mappings. This option has no effect unless -noimage_file was specified or no compiled configuration exists; any compiled configuration precludes reading the mappings file. Use of the -nomapping_file option will prevent the IMTA_MAPPING_FILE file from being read in when there is no compiled configuration.  

-option_file=filename

-nooption_file  

Instructs imta test -rewrite to use the specified option file rather than the default option file named by the IMTA_OPTION_FILE option in the IMTA tailor file, /etc/opt/SUNWmail/imta/imta_tailor, which is usually the file /etc/opt/SUNWmail/imta/options.dat. This option has no effect unless -noimage_file is specified or no compiled configuration exists; any compiled configuration precludes reading any sort of option file. Use of the -nooption_file option prevents the IMTA_OPTION_FILE file from being read in when there is no compiled configuration.  

-output=output_file  

Directs the output of imta test -rewrite. By default, imta test -rewrite writes output to stdout.  

-read_receipt

-noread_receipt  

Sets the corresponding receipt request flags. This option can be useful when testing the handling of receipt requests at the time of rewriting forwarded addresses or mailing lists.  

-restricted=setting  

Controls the setting of the restricted flag. By default, this flag has value 0. When set to 1, -restricted=1, the restricted flag is set on and addresses are rewritten using the restricted mailbox encoding format recommended by RFC 1137. This flag is used to force rewriting of address mailbox names in accordance with the RFC 1137 specifications.  

-source_channel=channel  

Controls for which source channel rewrites addresses. Some address rewriting is source channel-specific; imta test -rewrite normally assumes that the channel source for which it is rewriting is the local channel l.  


Example

This example shows typical output generated by imta test -rewrite. The most important piece of information generated by imta test -rewrite is displayed on the last few lines of the output, which shows the channel to which imta test -rewrite would submit a message with the specified test address and the form in which the test address would be rewritten for that channel. This output is invaluable when debugging configuration problems.

 
# imta test -rewrite
 
Address: joe.blue
 
channel                = l
 
  channel description    = 
 
  channel flags #1       = BIDIRECTIONAL MULTIPLE IMMNONURGENT 
NOSERVICEALL
 
  channel flags #2       = NOSMTP POSTHEADBODY HEADERINC NOEXPROUTE
 
  channel flags #3       = LOGGING NOGREY NORESTRICTED
 
  channel flags #4       = EIGHTNEGOTIATE NOHEADERTRIM NOHEADERREAD RULES
 
  channel flags #5       = 
 
  channel flags #6       = LOCALUSER NOX_ENV_TO RECEIPTHEADER
 
  channel flags #7       = ALLOWSWITCHCHANNEL NOREMOTEHOST DATEFOUR 
DAYOFWEEK 
 
  channel flags #8       = NODEFRAGMENT EXQUOTA REVERSE 
NOCONVERT_OCTET_STREAM 
 
  channel flags #9       = NOTHURMAN INTERPRETENCODING
 
  text/plain charset def = (7) US-ASCII 5 (8) ISO-8859-1 51
 
  channel envelope address type = SOURCEROUTE
 
  channel header address type = SOURCEROUTE
 
  channel official host  = mailserver.eng.alpha.com
 
  channel local alias    = 
 
  channel queue name     = 
 
  channel after param    = 
 
  channel daemon name    = 
 
  channel user name      = 
 
  notices                = 
 
  channel group ids      = 
 
  header To: address     = joe.blue@mailserver.eng.alpha.com
 
  header From: address   = joe.blue@mailserver.eng.alpha.com
 
  envelope To: address   = joe.blue@mailserver.eng.alpha.com  (route 
(mailserver.eng.alpha.com,mailserver.eng.alpha.com))
 
  envelope From: address = joe.blue@mailserver.eng.alpha.com
 
  name                   = 
 
  mbox                   = joe.blue
 
Extracted address action list: joe.blue@mailserver.eng.alpha.com
 
Extracted 733 address action list: joe.blue@mailserver.eng.alpha.com
 
Expanded address: 
 
  joe.blue@mailserver.eng.alpha.com
 
Submitted address list:
 
  sims-ms                         
 
    joe.blue@sims-ms-daemon (sims-ms-daemon) *NOTIFY FAILURES* *NOTIFY 
DELAYS*
 

 
Submitted notifications list:
 

 
Address:
 
#
 




Copyright © 1999 Sun Microsystems, Inc. All Rights Reserved.