<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://rt-wiki.bestpractical.com/index.php?action=history&amp;feed=atom&amp;title=Qmail</id>
	<title>Qmail - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://rt-wiki.bestpractical.com/index.php?action=history&amp;feed=atom&amp;title=Qmail"/>
	<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=Qmail&amp;action=history"/>
	<updated>2026-08-22T19:04:51Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=Qmail&amp;diff=2671&amp;oldid=prev</id>
		<title>Admin: 2 revisions imported</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=Qmail&amp;diff=2671&amp;oldid=prev"/>
		<updated>2016-04-06T20:20:30Z</updated>

		<summary type="html">&lt;p&gt;2 revisions imported&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Adding RT Mailgate aliases to a qmail system ==&lt;br /&gt;
&lt;br /&gt;
This is ridiculously easy:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# vi /var/qmail/alias/.qmail-rt&lt;br /&gt;
 |/opt/rt3/bin/rt-mailgate --queue general --action correspond --url http://your.rt.server/your/rt/path/&lt;br /&gt;
 &lt;br /&gt;
 # vi /var/qmail/alias/.qmail-rt-comment&lt;br /&gt;
 |/opt/rt3/bin/rt-mailgate --queue general --action comment --url http://your.rt.server/your/rt/path/&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it. You don&amp;#039;t need to restart, just make sure the qmail group can read the files.&lt;br /&gt;
&lt;br /&gt;
If you want one of them to send an e-mail to an address AND hit mailgate:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# vi /var/qmail/alias/.qmail-rt-comment&lt;br /&gt;
 user@wherever.com&lt;br /&gt;
 |/opt/rt3/bin/rt-mailgate --queue general --action comment --url http://your.rt.server/your/rt/path/&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- Anonymous&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039; Each queue must be identified and handled individually (to create a ticket in the appropriate queue if the message is not a reply to an existing ticket).&lt;br /&gt;
&lt;br /&gt;
== FastForward aliases fail ==&lt;br /&gt;
&lt;br /&gt;
If you use qmail&amp;#039;s &amp;lt;code&amp;gt;fastforward&amp;lt;/code&amp;gt; utility, to implement a sendmail-like &amp;lt;code&amp;gt;/etc/aliases&amp;lt;/code&amp;gt; file, be aware that it doesn&amp;#039;t launch piped commands properly. The following aliases added to the file will do nothing:&lt;br /&gt;
&lt;br /&gt;
 rt: &amp;quot;|/opt/rt3/bin/rt-mailgate --queue general --action correspond --url http://your.rt.server/your/rt/path/&amp;quot;&lt;br /&gt;
 rt-comment: &amp;quot;|/opt/rt3/bin/rt-mailgate --queue general --action comment --url http://your.rt.server/your/rt/path/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Removing the quotes results in fastforward&amp;#039;s &amp;lt;code&amp;gt;newaliases&amp;lt;/code&amp;gt; command complaining about not being able to deliver to a file and not rebuilding the alias database.&lt;br /&gt;
&lt;br /&gt;
Stick with the qmail extensions for its alias user, as described in the top section of this page.&lt;br /&gt;
&lt;br /&gt;
- Ed Eaglehouse&lt;br /&gt;
&lt;br /&gt;
== Taking Advantage of qmail User Extension Addresses ==&lt;br /&gt;
&lt;br /&gt;
We can leverage &amp;lt;code&amp;gt;qmail&amp;lt;/code&amp;gt;&amp;#039;s ability to handle &amp;quot;user extension&amp;quot; addresses (user name followed by a hyphenated string) to significantly reduce the number of aliases we have to maintain. Because the general email address for RT is [mailto:rt@your.rt.server rt@your.rt.server], &amp;lt;code&amp;gt;qmail&amp;lt;/code&amp;gt; still needs the &amp;lt;code&amp;gt;.qmail-rt&amp;lt;/code&amp;gt; alias. A link to &amp;lt;code&amp;gt;.qmail-rt-default&amp;lt;/code&amp;gt; works well.&lt;br /&gt;
&lt;br /&gt;
For all the other addresses that are created as we add new ticket queues to RT, we can use a single preprocessing script that will invoke &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; with appropriate arguments. Create an RT default alias file that will direct all addresses of the form &amp;#039;&amp;#039;&amp;#039;rt-/anything/&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# vi /var/qmail/alias/.qmail-rt-default&lt;br /&gt;
 |/usr/local/bin/pre-rt-mailgate&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;pre-rt-mailgate&amp;lt;/code&amp;gt; script, listed below, parses the message headers and invokes &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; with the necessary arguments. This script must be edited minimally to customize the default URL and &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; script location to match your RT installation. Look for the conspicuous commented sections.&lt;br /&gt;
&lt;br /&gt;
Now as long as you stick to some normalized email address formats - by default &amp;#039;&amp;#039;&amp;#039;rt-/queue/-/action/&amp;#039;&amp;#039;&amp;#039; - the script will identify the proper arguments to pass to &amp;lt;code&amp;gt;rt-mailgate&amp;lt;/code&amp;gt; and you shouldn&amp;#039;t have to create any other aliases or touch the script again. By the way, the optional /queue/ and /action/ items must not be hyphenated themselves or the regular expression used to identify the components may produce predictably bad results. But it reduces my administrative workload, and that&amp;#039;s always good!&lt;br /&gt;
&lt;br /&gt;
Some examples:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;| Email Address                        | Queue      | Action     | URL                      |&lt;br /&gt;
 | rt@your.rt.server                    | general    | correspond | http://your.rt.server/rt |&lt;br /&gt;
 | rt-admin@your.rt.server              | rt-admin   | correspond | http://your.rt.server/rt |&lt;br /&gt;
 | rt-admin-comment@your.rt.server      | rt-admin   | comment    | http://your.rt.server/rt |&lt;br /&gt;
 | rt-otherqueue@your.rt.server         | otherqueue | correspond | http://your.rt.server/rt |&lt;br /&gt;
 | rt-otherqueue-comment@your.rt.server | otherqueue | comment    | http://your.rt.server/rt |&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;pre-rt-mailgate&amp;lt;/code&amp;gt; script:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;#!/usr/bin/perl -w&lt;br /&gt;
 #&lt;br /&gt;
 # This software was written by Edward F Eaglehouse of Automated Solutions&lt;br /&gt;
 # Corporation and derives code distributed with the RT Request Tracking&lt;br /&gt;
 # system written by Best Practical Solutions, LLC.&lt;br /&gt;
 #&lt;br /&gt;
 # COPYRIGHT&lt;br /&gt;
 #&lt;br /&gt;
 # This script is intended for use with Request Tracker in accordance with the&lt;br /&gt;
 # stated contribution policy of Best Practical Solutions, LLC.&lt;br /&gt;
 #&lt;br /&gt;
 # LICENSE:&lt;br /&gt;
 #&lt;br /&gt;
 # This work is made available to you under the terms of Version 2 of&lt;br /&gt;
 # the GNU General Public License.&lt;br /&gt;
 #&lt;br /&gt;
 # CUSTOMIZATION:&lt;br /&gt;
 #&lt;br /&gt;
 # Look for the code sections beginning with &amp;quot;#===&amp;quot; comment blocks.&lt;br /&gt;
 &lt;br /&gt;
 =head1 NAME&lt;br /&gt;
 &lt;br /&gt;
 pre-rt-mailgate - Preprocessor for mail interface to RT3.&lt;br /&gt;
 &lt;br /&gt;
 =cut&lt;br /&gt;
 &lt;br /&gt;
 use strict;&lt;br /&gt;
 use warnings;&lt;br /&gt;
 &lt;br /&gt;
 use Getopt::Long;&lt;br /&gt;
 &lt;br /&gt;
 use constant EX_TEMPFAIL =&amp;amp;gt; 75;&lt;br /&gt;
 use constant BUFFER_SIZE =&amp;amp;gt; 8192;&lt;br /&gt;
 &lt;br /&gt;
 my %opts;&lt;br /&gt;
 GetOptions( \%opts, &amp;quot;help&amp;quot;, &amp;quot;debug&amp;quot; );&lt;br /&gt;
 &lt;br /&gt;
 if ( $opts{&amp;#039;help&amp;#039;} ) {&lt;br /&gt;
    require Pod::Usage;&lt;br /&gt;
    import Pod::Usage;&lt;br /&gt;
    pod2usage(&amp;quot;RT Mail Gateway preprocessor\n&amp;quot;);&lt;br /&gt;
    exit 1;    # Don&amp;#039;t want to succeed if this is really an email!&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 #===============================================================================&lt;br /&gt;
 # Customize public default values and special queue mappings here.&lt;br /&gt;
 # Depending on your preferences, you may also need to modify the behavior of&lt;br /&gt;
 # the get_mailgate_args function below.&lt;br /&gt;
 #===BEGIN=======================================================================&lt;br /&gt;
 our $mailgate_command = &amp;quot;/usr/local/rt3/bin/rt-mailgate&amp;quot;;&lt;br /&gt;
 our %param_defaults = (&lt;br /&gt;
    &amp;quot;queue&amp;quot;  =&amp;amp;gt; &amp;quot;general&amp;quot;,&lt;br /&gt;
    &amp;quot;action&amp;quot; =&amp;amp;gt; &amp;quot;correspond&amp;quot;,&lt;br /&gt;
    &amp;quot;url&amp;quot;    =&amp;amp;gt; &amp;quot;http://your.rt.server/rt&amp;quot;&lt;br /&gt;
 );&lt;br /&gt;
 our %special_queues = (&lt;br /&gt;
    &amp;quot;admin&amp;quot; =&amp;amp;gt; &amp;quot;rt-admin&amp;quot;,&lt;br /&gt;
 );&lt;br /&gt;
 #===END=========================================================================&lt;br /&gt;
 &lt;br /&gt;
 # Read the message in from STDIN&lt;br /&gt;
 my %message = write_down_message();&lt;br /&gt;
 &lt;br /&gt;
 unless( $message{&amp;#039;filename&amp;#039;} || $message{&amp;#039;content&amp;#039;} ) {&lt;br /&gt;
    print STDERR &amp;quot;$0: couldn&amp;#039;t read message: $!\n&amp;quot;;&lt;br /&gt;
    exit EX_TEMPFAIL;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 # Find the message recipient so we can identify the default RT queue.&lt;br /&gt;
 my %header_info = parse_headers(message_content(%message));&lt;br /&gt;
 &lt;br /&gt;
 if ( !defined($header_info{&amp;#039;to&amp;#039;})) {&lt;br /&gt;
    # Message recipient is required in order to continue.&lt;br /&gt;
    print STDERR &amp;quot;$0: message contained no recipient\n&amp;quot;;&lt;br /&gt;
    exit EX_TEMPFAIL;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 # Define rt-mailgate arguments from parsed headers.&lt;br /&gt;
 my %params = get_mailgate_args(%header_info);&lt;br /&gt;
 &lt;br /&gt;
 # Build command line to launch rt-mailgate.&lt;br /&gt;
 # Parameters without defined values get only an option keyword.&lt;br /&gt;
 my @args = ( $mailgate_command );&lt;br /&gt;
 for my $param (keys %params) {&lt;br /&gt;
    @args = ( @args, &amp;quot;--$param&amp;quot; );&lt;br /&gt;
    @args = ( @args, $params{$param} ) if (defined($params{$param}));&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 # Turn debugging on to see the command to be executed.&lt;br /&gt;
 print STDERR &amp;quot;exec: $mailgate_command @args&amp;quot;.&amp;quot;\n&amp;quot; if $opts{&amp;#039;debug&amp;#039;};&lt;br /&gt;
 &lt;br /&gt;
 # Pipe message through rt-mailgate with parsed arguments.&lt;br /&gt;
 open(OUTPUT, &amp;#039;|-&amp;#039;) || exec { $args[0] } @args;&lt;br /&gt;
 print OUTPUT message_content(%message);&lt;br /&gt;
 close(OUTPUT);&lt;br /&gt;
 exit;&lt;br /&gt;
 &lt;br /&gt;
 END {&lt;br /&gt;
    unlink $message{&amp;#039;filename&amp;#039;} if $message{&amp;#039;filename&amp;#039;};&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # Save content of message so we can reuse it later.&lt;br /&gt;
 # Returns &amp;#039;filename&amp;#039; element if input was copied to a temporary file.&lt;br /&gt;
 # Returns &amp;#039;content&amp;#039; element if input was stored in memory.&lt;br /&gt;
 sub write_down_message {&lt;br /&gt;
    use File::Temp qw(tempfile);&lt;br /&gt;
 &lt;br /&gt;
    local $@;&lt;br /&gt;
    my ($fh, $filename) = eval { tempfile() };&lt;br /&gt;
    if ( !$fh || $@ ) {&lt;br /&gt;
        print STDERR &amp;quot;$0: Couldn&amp;#039;t create temp file, using memory\n&amp;quot;;&lt;br /&gt;
        print STDERR &amp;quot;error: $@\n&amp;quot; if $@;&lt;br /&gt;
 &lt;br /&gt;
        my $message = \do { local (@ARGV, $/); &amp;amp;lt;&amp;amp;gt; };&lt;br /&gt;
        unless ( $$message =~ /\S/ ) {&lt;br /&gt;
            print STDERR &amp;quot;$0: no message passed on STDIN\n&amp;quot;;&lt;br /&gt;
            exit 0;&lt;br /&gt;
        }&lt;br /&gt;
        $$message = $opts{&amp;#039;headers&amp;#039;} . $$message if $opts{&amp;#039;headers&amp;#039;};&lt;br /&gt;
        return ( content =&amp;amp;gt; $message );&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    binmode $fh;&lt;br /&gt;
    binmode \*STDIN;&lt;br /&gt;
 &lt;br /&gt;
    print $fh $opts{&amp;#039;headers&amp;#039;} if $opts{&amp;#039;headers&amp;#039;};&lt;br /&gt;
 &lt;br /&gt;
    my $buf; my $empty = 1;&lt;br /&gt;
    while(1) {&lt;br /&gt;
        my $status = read \*STDIN, $buf, BUFFER_SIZE;&lt;br /&gt;
        unless ( defined $status ) {&lt;br /&gt;
            print STDERR &amp;quot;$0: couldn&amp;#039;t read message: $!\n&amp;quot;;&lt;br /&gt;
            exit EX_TEMPFAIL;&lt;br /&gt;
        } elsif ( !$status ) {&lt;br /&gt;
            last;&lt;br /&gt;
        }&lt;br /&gt;
        $empty = 0 if $buf =~ /\S/;&lt;br /&gt;
        print $fh $buf;&lt;br /&gt;
    };&lt;br /&gt;
    close $fh;&lt;br /&gt;
 &lt;br /&gt;
    if ( $empty ) {&lt;br /&gt;
        print STDERR &amp;quot;$0: no message passed on STDIN\n&amp;quot;;&lt;br /&gt;
        exit 0;&lt;br /&gt;
    }&lt;br /&gt;
    print STDERR &amp;quot;$0: temp file is &amp;#039;$filename&amp;#039;\n&amp;quot; if $opts{&amp;#039;debug&amp;#039;};&lt;br /&gt;
    return (filename =&amp;amp;gt; $filename);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # Get selected information from message header lines.&lt;br /&gt;
 # $info{&amp;#039;to&amp;#039;} gets the local mail address.&lt;br /&gt;
 # $info{&amp;#039;domain&amp;#039;} gets the domain of the mail address.&lt;br /&gt;
 sub parse_headers {&lt;br /&gt;
    my ( $content ) = @_;&lt;br /&gt;
    my %info;&lt;br /&gt;
    local ( $_ );&lt;br /&gt;
    foreach $_ (split(/\n/, $content)) {&lt;br /&gt;
        /^To:\s+([^@]+)(@(.*))?$/ &amp;amp;amp;&amp;amp;amp; do {&lt;br /&gt;
            # Grab recipient and domain from message recipient.&lt;br /&gt;
            $info{&amp;#039;to&amp;#039;} = $1;&lt;br /&gt;
            $info{&amp;#039;domain&amp;#039;} = $3 if defined($3);&lt;br /&gt;
            last;&lt;br /&gt;
        };&lt;br /&gt;
 &lt;br /&gt;
        # Ignore lines beyond message header.&lt;br /&gt;
        last if /^\s+$?/;&lt;br /&gt;
    }&lt;br /&gt;
    print STDERR &amp;quot;$0: parsed headers\n&amp;quot; if $opts{&amp;#039;debug&amp;#039;};&lt;br /&gt;
    return ( %info );&lt;br /&gt;
 } # parse_headers()&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # Get arguments for rt-mailgate from parsed header information.&lt;br /&gt;
 sub get_mailgate_args {&lt;br /&gt;
    my ( %header_info ) = @_;&lt;br /&gt;
    my $recipient = lc($header_info{&amp;#039;to&amp;#039;});&lt;br /&gt;
    my $domain = lc($header_info{&amp;#039;domain&amp;#039;});&lt;br /&gt;
    my $queue;&lt;br /&gt;
    my $action;&lt;br /&gt;
    my $url;&lt;br /&gt;
 &lt;br /&gt;
    #===========================================================================&lt;br /&gt;
    # Expected regex pattern is &amp;quot;rt&amp;quot; &amp;quot;-&amp;quot; queue &amp;quot;-&amp;quot; action.&lt;br /&gt;
    # Customize your address pattern and variable assignments here.&lt;br /&gt;
    #===BEGIN===================================================================&lt;br /&gt;
    my $address_regex = &amp;#039;^rt(-(\w+)(-(.*))?)?$&amp;#039;;&lt;br /&gt;
 &lt;br /&gt;
    ( undef, $queue, undef, $action, undef ) =&lt;br /&gt;
        $recipient =~ /$address_regex/;&lt;br /&gt;
    #===END=====================================================================&lt;br /&gt;
 &lt;br /&gt;
    # Identify queue.&lt;br /&gt;
    # Suggestion: define any non-standard queue names in %special_queues.&lt;br /&gt;
    if (defined($queue)) {&lt;br /&gt;
        $queue = lc($queue);&lt;br /&gt;
        if (exists($special_queues{$queue})) {&lt;br /&gt;
            # Handle special queue mappings.&lt;br /&gt;
            $queue = $special_queues{$queue};&lt;br /&gt;
        }&lt;br /&gt;
    } else {&lt;br /&gt;
        # Use default queue name.&lt;br /&gt;
        $queue = $param_defaults{&amp;#039;queue&amp;#039;};&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    # Identify action.&lt;br /&gt;
    if (defined($action)) {&lt;br /&gt;
        $action = lc($action);&lt;br /&gt;
    } else {&lt;br /&gt;
        $action = $param_defaults{&amp;#039;action&amp;#039;};&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    # Identify url.&lt;br /&gt;
    # Suggestion: you can select the RT url based on the recipient domain.&lt;br /&gt;
    $url = $param_defaults{&amp;#039;url&amp;#039;};&lt;br /&gt;
 &lt;br /&gt;
    # Return hash array of parameters and assigned values.&lt;br /&gt;
    return (&lt;br /&gt;
        &amp;#039;queue&amp;#039;  =&amp;amp;gt; $queue,&lt;br /&gt;
        &amp;#039;action&amp;#039; =&amp;amp;gt; $action,&lt;br /&gt;
        &amp;#039;url&amp;#039;    =&amp;amp;gt; $url&lt;br /&gt;
    );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 # Return message content as a string.&lt;br /&gt;
 sub message_content {&lt;br /&gt;
    my %message = @_;&lt;br /&gt;
    my $content;&lt;br /&gt;
    local ( $_, $/ );&lt;br /&gt;
 &lt;br /&gt;
    if ($message{&amp;#039;content&amp;#039;}) {&lt;br /&gt;
        # Message content is stored in memory.&lt;br /&gt;
        return $message{&amp;#039;content&amp;#039;};&lt;br /&gt;
    } else {&lt;br /&gt;
        # Message content is stored in temporary file.&lt;br /&gt;
        open INPUT, &amp;quot;&amp;amp;lt;&amp;quot;, $message{&amp;#039;filename&amp;#039;} or do {&lt;br /&gt;
                print STDERR &amp;quot;$0: unable to read temporary file: $!\n&amp;quot;;&lt;br /&gt;
                exit EX_TEMPFAIL;&lt;br /&gt;
        };&lt;br /&gt;
        $content = &amp;amp;lt;INPUT&amp;amp;gt;;&lt;br /&gt;
        close INPUT;&lt;br /&gt;
    }&lt;br /&gt;
    return $content;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 =head1 SYNOPSIS&lt;br /&gt;
 &lt;br /&gt;
     pre-rt-mailgate --help : this text&lt;br /&gt;
 &lt;br /&gt;
 Usual invocation (from MTA):&lt;br /&gt;
 &lt;br /&gt;
     pre-rt-mailgate [ --debug ]&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 See C&amp;amp;lt;man rt-mailgate&amp;amp;gt; for more.&lt;br /&gt;
 &lt;br /&gt;
 =head1 OPTIONS&lt;br /&gt;
 &lt;br /&gt;
 =over 3&lt;br /&gt;
 &lt;br /&gt;
 =item C&amp;amp;lt;--debug&amp;amp;gt; OPTIONAL&lt;br /&gt;
 &lt;br /&gt;
 Print debugging output to standard error&lt;br /&gt;
 &lt;br /&gt;
 =head1 DESCRIPTION&lt;br /&gt;
 &lt;br /&gt;
 Preprocesses messages destined for C&amp;amp;lt;rt-mailgate&amp;amp;gt;. It is intended to&lt;br /&gt;
 normalize how they are routed to appropriate RT queues and actions.&lt;br /&gt;
 This program extracts information from the message headers,&lt;br /&gt;
 then calls C&amp;amp;lt;rt-mailgate&amp;amp;gt; with arguments derived from that information.&lt;br /&gt;
 &lt;br /&gt;
 An email address containing a queue name and action will have&lt;br /&gt;
 that information extracted and passed to C&amp;amp;lt;rt-mailgate&amp;amp;gt;. This can reduce&lt;br /&gt;
 the amount of configuration that must be done for your MTA and&lt;br /&gt;
 possibly eliminate ongoing maintenance as queues are added and&lt;br /&gt;
 deleted from RT. Ideally this will be a one-time setup.&lt;br /&gt;
 &lt;br /&gt;
 =head1 SETUP&lt;br /&gt;
 &lt;br /&gt;
 As originally configured, mail to an address of the form&lt;br /&gt;
 rt-I&amp;amp;lt;queue&amp;amp;gt;-I&amp;amp;lt;action&amp;amp;gt; will be routed to C&amp;amp;lt;rt-mailgate&amp;amp;gt; with the options&lt;br /&gt;
 C&amp;amp;lt;--queue&amp;amp;gt; set to I&amp;amp;lt;queue&amp;amp;gt;, C&amp;amp;lt;--action&amp;amp;gt; set to I&amp;amp;lt;action&amp;amp;gt;, and C&amp;amp;lt;--url&amp;amp;gt; set to&lt;br /&gt;
 your RT default URL.&lt;br /&gt;
 &lt;br /&gt;
 The optional I&amp;amp;lt;action&amp;amp;gt; defaults to C&amp;amp;lt;correspond&amp;amp;gt;. The optional I&amp;amp;lt;queue&amp;amp;gt;&lt;br /&gt;
 defaults to C&amp;amp;lt;general&amp;amp;gt;. The URL defaults to your primary RT URL. All&lt;br /&gt;
 this was designed to be fairly easy to modify.&lt;br /&gt;
 &lt;br /&gt;
 Edit the contents of this script to assign appropriate defaults if&lt;br /&gt;
 you dislike what is already there. Based on the format of email&lt;br /&gt;
 addresses you will use to communicate with RT, you can modify the&lt;br /&gt;
 C&amp;amp;lt;get_mailgate_args&amp;amp;gt; function to change the regular expression&lt;br /&gt;
 and customize the behavior of parameter value assignment.&lt;br /&gt;
 &lt;br /&gt;
 This script as distributed must be customized. At the minumum,&lt;br /&gt;
 the default URL and the path to the rt-mailgate command must be&lt;br /&gt;
 edited to match your RT installation.&lt;br /&gt;
 &lt;br /&gt;
 If any invalid parameter values are submitted, this program simply&lt;br /&gt;
 passes them to C&amp;amp;lt;rt-mailgate&amp;amp;gt; to handle.&lt;br /&gt;
 &lt;br /&gt;
 =head1 ENVIRONMENT&lt;br /&gt;
 &lt;br /&gt;
 =over 4&lt;br /&gt;
 &lt;br /&gt;
 This program runs in the same environment as C&amp;amp;lt;rt-mailgate&amp;amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
 =back 4&lt;br /&gt;
 &lt;br /&gt;
 =cut&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # EOF: pre-rt-mailgate&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- Ed Eaglehouse&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>