Can I restrict autoreplies to the local domain?

Hi

Has anyone got a way of restricting RT’s autoreply function to a single domain?

I don’t want users outside rbg.vic.gov.au to receive communication from my RT system.

It’s v3.4.4, running on Ubuntu Dapper 6.06, with postfix, apache2 and mysql as the backend.

Chris

Chris Wenn
IT Support Officer

Royal Botanic Gardens
Royal Botanic Gardens Melbourne
PH: (03) 9252 2354 FAX: (03) 9252 2442
EMAIL: Chris.Wenn@rbg.vic.gov.au
WEB: http://www.rbg.vic.gov.au

Hi,On Sep 19, Chris Wenn wrote:

Has anyone got a way of restricting RT’s autoreply function to a single domain?

I don’t want users outside rbg.vic.gov.au to receive communication from my RT system.

It’s v3.4.4, running on Ubuntu Dapper 6.06, with postfix, apache2 and mysql as the backend.

Chris

If you have a little knowledge of perl you may take a look at
lib/RT/Action/SendEmail.pm. Should not be too hard to match $TO
against your domain name and either rewrite the address or discard it.
This would be a nice feature IMO.

Perhaps using postfix’s canonical maps may work, too. But i am not
sure whether it is possible to rewrite TO only if From matches your RT
email address.

regards,
Andreas Putzo

We use a second queue for this purpose. In our procmail script that
feeds RT, we detect email that shouldn’t get an autoreply and
feed it to the alternate queue. That queue has an “On Create”
script that simply changes the queue to the main support queue.
There is an autoreply action only on the main support queue, not
on the secondary queue. As well, you can have different, or no,
watchers on the secondary queue if you are also trying to reduce
possibly noise email to your watchers.

Chuck Boeheim
boeheim@slac.stanford.eduOn Sep 19, 2006, at 3:16 AM, Andreas Putzo wrote:

Hi,

On Sep 19, Chris Wenn wrote:

Has anyone got a way of restricting RT’s autoreply function to a
single domain?

I don’t want users outside rbg.vic.gov.au to receive communication
from my RT system.

It’s v3.4.4, running on Ubuntu Dapper 6.06, with postfix, apache2
and mysql as the backend.

Chris

If you have a little knowledge of perl you may take a look at
lib/RT/Action/SendEmail.pm. Should not be too hard to match $TO
against your domain name and either rewrite the address or discard it.
This would be a nice feature IMO.

Perhaps using postfix’s canonical maps may work, too. But i am not
sure whether it is possible to rewrite TO only if From matches your RT
email address.


regards,
Andreas Putzo


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

We divert all incoming mail from outside the domain to a separate queue
and enable autoreply only on the internal queue. (I.e., we removed the
global autoreply scrips and recreated them on the internal queue.)

We’re a help-desk operation serving internal users who sometimes send
requests from external email accounts. Such requests get moved to the
internal queue and the Respondor value is corrected to the internal
account name for the user.

All remaining tickets in the external queue are spam and dealt with
accordingly.

Gary> “Chris Wenn” Chris.Wenn@rbg.vic.gov.au wrote

Hi

Has anyone got a way of restricting RT’s autoreply function to a single domain?

I don’t want users outside rbg.vic.gov.au to receive communication from my RT system.

It’s v3.4.4, running on Ubuntu Dapper 6.06, with postfix, apache2 and mysql as the backend.

Chris

Gary Hall hall@fas.sfu.ca | Voice (604) 291-5925
Faculty of Applied Sciences | Fax (604) 291-5404
Simon Fraser University |
Burnaby, B.C. V5A 1S6 |

My Perl knowledge is very little indeed! But surely there’s a better way than hacking core RT modules?

Chris

Chris Wenn
IT Support Officer

Royal Botanic Gardens
Royal Botanic Gardens Melbourne
PH: (03) 9252 2354 FAX: (03) 9252 2442
EMAIL: Chris.Wenn@rbg.vic.gov.au
WEB: http://www.rbg.vic.gov.au

Andreas Putzo putzoa@gmx.de 19/09/2006 8:16:29 pm >>>
Hi,On Sep 19, Chris Wenn wrote:

Has anyone got a way of restricting RT’s autoreply function to a single domain?

I don’t want users outside rbg.vic.gov.au to receive communication from my RT system.

It’s v3.4.4, running on Ubuntu Dapper 6.06, with postfix, apache2 and mysql as the backend.

Chris

If you have a little knowledge of perl you may take a look at
lib/RT/Action/SendEmail.pm. Should not be too hard to match $TO
against your domain name and either rewrite the address or discard it.
This would be a nice feature IMO.

Perhaps using postfix’s canonical maps may work, too. But i am not
sure whether it is possible to rewrite TO only if From matches your RT
email address.

Hm

Has potential for my situation, but I’m trying to figure out how you actually identify the mail coming from other domains. I suppose what I want is something simple that says “if the mail is from rbg.vic.gov.au, autoreply. if not, don’t autoreply but continue processing as normal” but my perl-fu is too weak to figure it out!

Chris

Chris Wenn
IT Support Officer

Royal Botanic Gardens
Royal Botanic Gardens Melbourne
PH: (03) 9252 2354 FAX: (03) 9252 2442
EMAIL: Chris.Wenn@rbg.vic.gov.au
WEB: http://www.rbg.vic.gov.au

Gary Hall hall@fas.sfu.ca 20/09/2006 2:38:24 am >>>
We divert all incoming mail from outside the domain to a separate queue
and enable autoreply only on the internal queue. (I.e., we removed the
global autoreply scrips and recreated them on the internal queue.)

We’re a help-desk operation serving internal users who sometimes send
requests from external email accounts. Such requests get moved to the
internal queue and the Respondor value is corrected to the internal
account name for the user.

All remaining tickets in the external queue are spam and dealt with
accordingly.

Gary> “Chris Wenn” Chris.Wenn@rbg.vic.gov.au wrote

Hi

Has anyone got a way of restricting RT’s autoreply function to a single domain?

I don’t want users outside rbg.vic.gov.au to receive communication from my RT system.

It’s v3.4.4, running on Ubuntu Dapper 6.06, with postfix, apache2 and mysql as the backend.

Chris

Gary Hall hall@fas.sfu.ca | Voice (604) 291-5925
Faculty of Applied Sciences | Fax (604) 291-5404
Simon Fraser University |
Burnaby, B.C. V5A 1S6 |

I neglected to say in my original email that we identify the source of the
email using procmail prior to piping incoming email messages to rt-mailgate.

E.g, if there’s an account “helpdesk” to which users send help requests,
in ~helpdesk/.procmailrc:

Messages from inside go to internal queue

:0

  • ^From: .+@(.+.)*mysite.ca>?$
    {

    • ^TOhelpdesk_cmt@
      |/opt/rt3/bin/rt-prodn-mailgate --queue “Internal” --action comment --url
      https://helpdesk.sfu.ca/

    By default, messages are assumed to be correspondence to the main queue

    :0
    |/opt/rt3/bin/rt-prodn-mailgate --queue “Internal” --action correspond
    –url https://helpdesk.sfu.ca/
    }

Remaining messages are from outside

:0 E
{
:0

  • ^TOhelpdesk_cmt@
    |/opt/rt3/bin/rt-prodn-mailgate --queue “External” --action comment --url
    https://helpdesk.sfu.ca/

:0
|/opt/rt3/bin/rt-prodn-mailgate --queue “External” --action correspond
–url https://helpdesk.sfu.ca/
}


Subject:
[rt-users] Re: Can I restrict autoreplies to the local domain?
From:
“Chris Wenn” Chris.Wenn@rbg.vic.gov.au
\

Hm

Has potential for my situation, but I’m trying to figure out how you actually identify the mail coming from other domains. I suppose what I want is something simple that says “if the mail is from rbg.vic.gov.au, autoreply. if not, don’t autoreply but continue processing as normal” but my perl-fu is too weak to figure it out!

Chris

Gary Hall hall@fas.sfu.ca 20/09/2006 2:38:24 am >>>
We divert all incoming mail from outside the domain to a separate queue
and enable autoreply only on the internal queue. (I.e., we removed the
global autoreply scrips and recreated them on the internal queue.)

We’re a help-desk operation serving internal users who sometimes send
requests from external email accounts. Such requests get moved to the
internal queue and the Respondor value is corrected to the internal
account name for the user.

All remaining tickets in the external queue are spam and dealt with
accordingly.

Gary

Gary Hall hall@fas.sfu.ca | Voice (604) 291-5925
Faculty of Applied Sciences | Fax (604) 291-5404
Simon Fraser University |
Burnaby, B.C. V5A 1S6 |

Hi Isaac

I did post a solution, but I’ll reprint it here for completeness:

–Quote–

I found a solution to this myself! Thanks to everyone who provided possible fixes. It’s probably not elegant but it seems to fit ok.

The trick was in this post to RTIR [Rtir] Disabling Autoresponder to specific addresses, which I adapted for Ubuntu.

I found that copying /usr/share/request-tracker3.4/lib/RT/Action/Autoreply.pm to /usr/local/share/request-tracker3.4/lib/RT/Action/Autoreply.pm and replacing

sub SetRecipients {
my $self=shift;

push(@{$self->{'To'}}, $self->TicketObj->Requestors->MemberEmailAddresses);

return(1);

}

with

no warnings qw(redefine);

sub SetRecipients {
my $self=shift;

if(defined($RT::AllowAutoReplyRegexp) && defined($RT::DenyAutoReplyRegexp)) {
    foreach($self->TicketObj->Requestors->MemberEmailAddresses) {
    push(@{$self->{'To'}}, $_)
      if ( ( ! $RT::AllowAutoReplyRegexp || /$RT::AllowAutoReplyRegexp/oi )
	&&  ! ( $RT::DenyAutoReplyRegexp && /$RT::DenyAutoReplyRegexp/oi ) );
    }
} else {
    push(@{$self->{'To'}}, $self->TicketObj->Requestors->MemberEmailAddresses);
}

return(1);

}

worked.

In /etc/request-tracker3.4/RT_SiteConfig.pm add the lines

Set($AllowAutoReplyRegexp, ‘@([\w.-]+.)?your.domain.com$’);
Set($DenyAutoReplyRegexp,
‘^(Post(ma?(st(e?r)?|n)|of|ficl)|(send)?Mail(er)?|daemon|m(mdf|ajordomo)|n?uucp|LIST(SERV|proc)|NETSERV|o(wner|ps)|r(e(quest|sponse)|oot)|b(ounce|bs.smtp)|echo|mirror|s(erv(ices?|er)|mtp(error)?|ystem)|A(dmin(istrator)?|MMGR|utoanswer))@’);

near the end.

So there you go.

Chris

Chris Wenn
IT Support Officer

Royal Botanic Gardens
Royal Botanic Gardens Melbourne
PH: (03) 9252 2354 FAX: (03) 9252 2442
EMAIL: Chris.Wenn@rbg.vic.gov.au
WEB: http://www.rbg.vic.gov.au

Isaac Vetter ivetter@math.purdue.edu 14/11/2006 2:58:08 am >>>
Good Morning Chris;

Did you ever figure out a nice way to do this? The easiest way is
probably a procmail script, if that’s what you ended up using, would you
mind posting it to the list?

Thanks,

Isaac Vetter

Chris Wenn wrote: