Inbound E-mail to server

Hello,

I am still currently having a problem with RT and replying to an e-mail generated by RT. Whenever I try to reply to an e-mail (with the proper subject line flag) sent from RT. It doesn’t get updated on the website. Please help. We are using multiple queues but I only have one queue listed in /etc/aliases. Is it possible to reply to e-mail with another queue other than “general?”

RT Mail Queue Setup

rt: “|/opt/rt3/bin/rt-mailgate --queue general --action correspond --url http://server.domain.local/
rt-comment: “|/opt/rt3/bin/rt-mailgate --queue general --action comment --url http://server.domain.local/

trap decode to catch security attacks

decode: root

Person who should get root’s mail

root: serveralerts@domain.netmailto:serveralerts@domain.net

Thank you,
Eric

CONFIDENTIAL. This e-mail and any attached files are confidential and should be destroyed and/or returned if you are not the intended and proper recipient.

I had this problem the other day also.

Are you using sendmail on your
RT machine?

If so, you need to allow smrsh to run the mailgate script.

All you need to do is symlink the mailgate script into the directory
where smrsh looks. I don’t know for your system, but for Gentoo this
directory is ‘/usr/adm/sm.bin/’.

I believe on other distro’s it may be in
/etc/smrsh/?

HTH,

Andrew

On Tuesday, August 18, 2009 21:12, Andrew Bruce wrote,

I had this problem the other day also.

Are you using sendmail on your RT machine?

I’m using Sendmail.

If so, you need to allow smrsh to run the mailgate script.

All you need to do is symlink the mailgate script into the directory where smrsh looks. I don’t know for your system, but > for Gentoo this directory is ‘/usr/adm/sm.bin/’.

I believe on other distro’s it may be in /etc/smrsh/?

I already have a symlink in /etc/smrsh to mailgate. I’m using CentOS 5.1 x64 edition

[root@ ~ bin]# ls -la /etc/smrsh/
total 24
drwxr-xr-x 2 root root 4096 Aug 17 13:19 .
drwxr-xr-x 101 root root 12288 Aug 18 14:35 …
lrwxrwxrwx 1 root root 24 Aug 17 13:19 rt-mailgate → /opt/rt3/bin/rt-mailgate

Please, anyone, what else could be happening? I tried testing this again by replying to an e-mail generated by RT with the “flag” ( ie, [general #8]) in the subject line. Nothing gets parsed into ticket 8.

CONFIDENTIAL. This e-mail and any attached files are confidential and should be destroyed and/or returned if you are not the intended and proper recipient.

Is it possible to reply to e-mail with another queue other than “general?”
Under normal setups the reply address has nothing to do with where a
response ends up. As long as the subject contains the RT tag + ticket
number, it will be filed appropriately i.e; by ticket. The only thing that
-queue really affects is where to create new tickets. Thus, having multiple
aliases allows you to create tickets by email in various queues, and to
avoid confusion amongst users who might note that all correspondence
is occurring with rt@example.net; if you tell RT to use the corresponding
address for that queue.

As for the lack of message handling, have you checked you maillog,
RT’s log, or Apache? (Proceeding along the pipeline once you determine
everything is fine with the previous one). Are you running with
SELinux enabled? What happens if you feed a message to rt-mailgate
from the command line?

Cambridge Energy Alliance: Save money. Save the planet.

On Wednesday, August 19, 2009 11:07, Jerrad Pierce wrote,

Is it possible to reply to e-mail with another queue other than “general?”
Under normal setups the reply address has nothing to do with where a
response ends up. As long as the subject contains the RT tag + ticket
number, it will be filed appropriately i.e; by ticket. The only thing that
-queue really affects is where to create new tickets. Thus, having multiple
aliases allows you to create tickets by email in various queues, and to
avoid confusion amongst users who might note that all correspondence
is occurring with rt@example.net; if you tell RT to use the corresponding
address for that queue.

Cool.

As for the lack of message handling, have you checked you maillog,
RT’s log, or Apache? (Proceeding along the pipeline once you determine
everything is fine with the previous one). Are you running with
SELinux enabled? What happens if you feed a message to rt-mailgate
from the command line?

SELinux is disabled on our system. I checked the maillog, access_log, error_log and RT log. I didn’t see anything out of the ordinary.

In our organization, not only do we use a Linux environment, but we use a Windows Local Domain. I went in and created an Active Directory user called RT Admin. I then created a contact called RT Admin, giving it the e-mail address root@rtserver.local. For the RT Admin user account, I used the RT Admin contact to forward e-mail. I don’t know if that does anything.

I tried sending another e-mail from an account outside our Organization, having [QUEUE #TKT NUM] in the subject. I sent it to RT Admin user account. It still fails to parse into a corresponding ticket, but root does get the e-mail still, according to the emaillog! We also have root’s e-mail going to an AD distribution list.

CONFIDENTIAL. This e-mail and any attached files are confidential and should be destroyed and/or returned if you are not the intended and proper recipient.

What happens if you feed a message to rt-mailgate
from the command line?

[root@clehbrtrckr01 cron.daily]# printf “Testing…” | mail -s “[MIS #8] Another test” root

Root gets the e-mail but nothing gets parsed into ticket 8.

CONFIDENTIAL. This e-mail and any attached files are confidential and should be destroyed and/or returned if you are not the intended and proper recipient.

What happens if you feed a message to rt-mailgate
from the command line?

[root@clehbrtrckr01 cron.daily]# printf “Testing…” | mail -s “[MIS #8] Another test” root

Root gets the e-mail but nothing gets parsed into ticket 8.

That’s not feeding a message to rt-mailgate. What I proposed would be
something like (assuming an MH mail system):

% show cur |/opt/rt3/bin/rt-mailgate --queue general --action
correspond --url http://example.net/

Where “show cur” is essentially “cat fileContainingASingleMessage”
Cambridge Energy Alliance: Save money. Save the planet.

On Wednesday, August 19, 2009 15:13, Jerrad Pierce wrote,

What happens if you feed a message to rt-mailgate
from the command line?

[root@clehbrtrckr01 cron.daily]# printf “Testing…” | mail -s “[MIS #8]
Another test” root

Root gets the e-mail but nothing gets parsed into ticket 8.

T hat’s not feeding a message to rt-mailgate. What I proposed would be
something like (assuming an MH mail system):

% show cur |/opt/rt3/bin/rt-mailgate --queue general --action
correspond --url http://example.net/

Where “show cur” is essentially “cat fileContainingASingleMessage”

I get 404 not found. The correct link is listed too.

[root@ ~ lib]# printf “Testing…” |/opt/rt3/bin/rt-mailgate --queue MIS --action correspond --url http://clehbrtrckr01.broadvox.local/
An Error Occurred

404 Not Found
[root@ ~ lib]#

CONFIDENTIAL. This e-mail and any attached files are confidential and should be destroyed and/or returned if you are not the intended and proper recipient.

[root@ ~ lib]# printf “Testing…” |/opt/rt3/bin/rt-mailgate --queue MIS --action correspond --url http://clehbrtrckr01.broadvox.local/
An Error Occurred

404 Not Found
[root@ ~ lib]#
Well there’s your problem. The RT command used to pass mail to the
database (via HTTP) cannot locate the RT service. Your RT installation
is incomplete, check the Apache error log for the corresponding 404
and
additional details.

Although echoing test to rt-mailgate isn’t quite right either, the command
expects to receive a complete email message on STDIN.

Cambridge Energy Alliance: Save money. Save the planet.

On Wednesday, August 19, 2009 17:05, Jerrad Pierce wrote,

[root@ ~ lib]# printf “Testing…” |/opt/rt3/bin/rt-mailgate --queue MIS –
action correspond --url http://clehbrtrckr01.broadvox.local/
An Error Occurred

404 Not Found
[root@ ~ lib]#
Well there’s your problem. The RT command used to pass mail to the
database (via HTTP) cannot locate the RT service. Your RT installation
is incomplete, check the Apache error log for the corresponding 404
and
additional details.

There were no corresponding 404s in the error_log. This was the only error I saw with RT, related to rt-mailgate:

[Tue Aug 18 15:02:44 2009] [error] [client 127.0.0.1] File does not exist: /var/www/html/REST
[Tue Aug 18 15:04:03 2009] [error] [client 127.0.0.1] File does not exist: /var/www/html/REST

Although echoing test to rt-mailgate isn’t quite right either, the command
expects to receive a complete email message on STDIN.

I tried it again this way:

cat /opt/rt3/etc/RT_SiteConfig.pm |/opt/rt3/bin/rt-mailgate --queue MIS --action correspond --url http://clehbrtrckr01.broadvox.local/

I get the same error and /etc/httpd/logs/error_log reports this again:

[Wed Aug 19 16:11:14 2009] [error] [client 127.0.0.1] File does not exist: /var/www/html/REST
[Wed Aug 19 17:30:30 2009] [error] [client 127.0.0.1] File does not exist: /var/www/html/REST

CONFIDENTIAL. This e-mail and any attached files are confidential and should be destroyed and/or returned if you are not the intended and proper recipient.

On Wednesday, August 19, 2009 17:05, Jerrad Pierce wrote,

[root@ ~ lib]# printf “Testing…” |/opt/rt3/bin/rt-mailgate --queue MIS –
action correspond --url http://clehbrtrckr01.broadvox.local/
An Error Occurred

404 Not Found
[root@ ~ lib]#
Well there’s your problem. The RT command used to pass mail to the
database (via HTTP) cannot locate the RT service. Your RT installation
is incomplete, check the Apache error log for the corresponding 404
and
additional details.

I found the 404 in the access_log

Access_log details:

127.0.0.1 - - [19/Aug/2009:17:38:14 -0400] “POST //REST/1.0/NoAuth/mail-gateway HTTP/1.1” 404 320 “-” “libwww-perl/5.830”
127.0.0.1 - - [19/Aug/2009:17:46:15 -0400] “POST //REST/1.0/NoAuth/mail-gateway HTTP/1.1” 404 320 “-” “libwww-perl/5.830”

CONFIDENTIAL. This e-mail and any attached files are confidential and should be destroyed and/or returned if you are not the intended and proper recipient.

Again, rt-mailgate really wants to receive a complete email message on
STDIN, not random gibberish.

My guess would be that you are using name based virtual hosts,
but haven’t told Apache to do so for 127.0.0.1

Cambridge Energy Alliance: Save money. Save the planet.

On Thursday, August 20, 2009 09:43, Jerrad Pierce wrote,

Again, rt-mailgate really wants to receive a complete email message on
STDIN, not random gibberish.

Please, can you provide an example?

My guess would be that you are using name based virtual hosts,
but haven’t told Apache to do so for 127.0.0.1

Here is my RT Apache config. RT is the only application on this server. We don’t have any other Apache configs.

RT APACHE SETTINGS

<VirtualHost 172.16.5.74:80>
ServerName clehbrtrckr01.broadvox.local

DocumentRoot /opt/rt3/share/html
AddDefaultCharset UTF-8

# optional apache logs for RT
# ErrorLog /opt/rt3/var/log/apache2.error
# TransferLog /opt/rt3/var/log/apache2.access

PerlRequire "/opt/rt3/bin/webmux.pl"

<Location /NoAuth/images>
    SetHandler default
</Location>
<Location />
    SetHandler perl-script
    PerlResponseHandler RT::Mason
</Location>

CONFIDENTIAL. This e-mail and any attached files are confidential and should be destroyed and/or returned if you are not the intended and proper recipient.

<VirtualHost 172.16.5.74:80>
ServerName clehbrtrckr01.broadvox.local

/opt/rt3/bin/rt-mailgate --queue MIS --action correspond --url
http://clehbrtrckr01.broadvox.local/

127.0.0.1 - - [19/Aug/2009:17:38:14 -0400] “POST
//REST/1.0/NoAuth/mail-gateway HTTP/1.1” 404 320 “-”
“libwww-perl/5.830”

See the problem? Apache’s listening on 172… and rt-mailgate’s
connecting on loopback.
Presumably you have an alias in /etc/hosts
Cambridge Energy Alliance: Save money. Save the planet.

On Thursday, August 20, 2009 10:29, Jerrad Pierce wrote,

<VirtualHost 172.16.5.74:80>
ServerName clehbrtrckr01.broadvox.local

/opt/rt3/bin/rt-mailgate --queue MIS --action correspond --url
http://clehbrtrckr01.broadvox.local/

127.0.0.1 - - [19/Aug/2009:17:38:14 -0400] “POST
//REST/1.0/NoAuth/mail-gateway HTTP/1.1” 404 320 “-”
“libwww-perl/5.830”

See the problem? Apache’s listening on 172… and rt-mailgate’s
connecting on loopback.

I see it, thanks. I had both IPs in /etc/hosts. I hashed out the loopback in /etc/hosts, keeping the server IP listed there. I re-ran the command with no 404 error. This time there was a 200, which I’m assuming is HTTP 200 Ok.

172.16.5.74 - - [20/Aug/2009:10:51:24 -0400] “POST //REST/1.0/NoAuth/mail-gateway HTTP/1.1” 200 36 “-” “libwww-perl/5.830”

Will this correct the issue trying to send e-mail to the system and having it parse into the ticket? I just tried sending an e-mail to RT, having [QUEUE #TICKET NUM] in the subject line. It still doesn’t work and parse the information into the ticket. :confused:

CONFIDENTIAL. This e-mail and any attached files are confidential and should be destroyed and/or returned if you are not the intended and proper recipient.

Try changing your subject line to [$Organization #ticket_id]On 8/20/09 10:59 AM, “Eric Chatham” echatham@broadvox.com wrote:

On Thursday, August 20, 2009 10:29, Jerrad Pierce wrote,

<VirtualHost 172.16.5.74:80>
ServerName clehbrtrckr01.broadvox.local

/opt/rt3/bin/rt-mailgate --queue MIS --action correspond --url
http://clehbrtrckr01.broadvox.local/

127.0.0.1 - - [19/Aug/2009:17:38:14 -0400] “POST
//REST/1.0/NoAuth/mail-gateway HTTP/1.1” 404 320 “-”
“libwww-perl/5.830”

See the problem? Apache’s listening on 172… and rt-mailgate’s
connecting on loopback.

I see it, thanks. I had both IPs in /etc/hosts. I hashed out the loopback in
/etc/hosts, keeping the server IP listed there. I re-ran the command with no
404 error. This time there was a 200, which I’m assuming is HTTP 200 Ok.

172.16.5.74 - - [20/Aug/2009:10:51:24 -0400] “POST
//REST/1.0/NoAuth/mail-gateway HTTP/1.1” 200 36 “-” “libwww-perl/5.830”

Will this correct the issue trying to send e-mail to the system and having it
parse into the ticket? I just tried sending an e-mail to RT, having [QUEUE
#TICKET NUM] in the subject line. It still doesn’t work and parse the
information into the ticket. :confused:

CONFIDENTIAL. This e-mail and any attached files are confidential and should
be destroyed and/or returned if you are not the intended and proper recipient.


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

Drew Barnes
Applications Analyst
Network Resources Dept.
Raymond Walters College

On Thursday, August 20, 2009 11:05, Drew Barnes wrote,

Try changing your subject line to [$Organization #ticket_id]

No go. I even tried $rtname.> On 8/20/09 10:59 AM, “Eric Chatham” echatham@broadvox.com wrote:

On Thursday, August 20, 2009 10:29, Jerrad Pierce wrote,

<VirtualHost 172.16.5.74:80>
ServerName clehbrtrckr01.broadvox.local

/opt/rt3/bin/rt-mailgate --queue MIS --action correspond --url
http://clehbrtrckr01.broadvox.local/

127.0.0.1 - - [19/Aug/2009:17:38:14 -0400] “POST
//REST/1.0/NoAuth/mail-gateway HTTP/1.1” 404 320 “-”
“libwww-perl/5.830”

See the problem? Apache’s listening on 172… and rt-mailgate’s
connecting on loopback.

I see it, thanks. I had both IPs in /etc/hosts. I hashed out the loopback
in
/etc/hosts, keeping the server IP listed there. I re-ran the command with
no
404 error. This time there was a 200, which I’m assuming is HTTP 200 Ok.

172.16.5.74 - - [20/Aug/2009:10:51:24 -0400] “POST
//REST/1.0/NoAuth/mail-gateway HTTP/1.1” 200 36 “-” “libwww-perl/5.830”

Will this correct the issue trying to send e-mail to the system and having
it
parse into the ticket? I just tried sending an e-mail to RT, having [QUEUE
#TICKET NUM] in the subject line. It still doesn’t work and parse the
information into the ticket. :confused:

CONFIDENTIAL. This e-mail and any attached files are confidential and
should
be destroyed and/or returned if you are not the intended and proper
recipient.


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


Drew Barnes
Applications Analyst
Network Resources Dept.
Raymond Walters College

CONFIDENTIAL. This e-mail and any attached files are confidential and should be destroyed and/or returned if you are not the intended and proper recipient.

On Thursday, August 20, 2009 11:05, Drew Barnes wrote,

Try changing your subject line to [$Organization #ticket_id]

No go. I even tried $rtname.
Just to be clear, you’re using the value assigned to these variable
sin your site config,
and not the literal strings ‘$rtname’, correct? And a ticket with the
ID you’re using
already exists? And the account you’re emailing form has the necessary
ACLs to write
to the ticket?

Might I suggest going back and reading the initial installation instructions?

Cambridge Energy Alliance: Save money. Save the planet.

On Thursday, August 20, 2009 12:30, Jerrad Pierce wrote,

Try changing your subject line to [$Organization #ticket_id]

No go. I even tried $rtname.

Just to be clear, you’re using the value assigned to these variable
sin your site config,
and not the literal strings ‘$rtname’, correct? And a ticket with the
ID you’re using
already exists? And the account you’re emailing form has the necessary
ACLs to write
to the ticket?

Yes sir. $rtname = Broadvox from the Config. I’m using [Broadvox #8] in the subject line of the e-mail. Ticket 8 is an open and existing ticket. I tried e-mailing as root on the server and from my work e-mail.

Might I suggest going back and reading the initial installation instructions?

I’m reading RT Essentials.

CONFIDENTIAL. This e-mail and any attached files are confidential and should be destroyed and/or returned if you are not the intended and proper recipient.

-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-
bounces@lists.bestpractical.com] On Behalf Of Eric Chatham
Sent: Thursday, August 20, 2009 12:37
To: ‘Jerrad Pierce’
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Inbound E-mail to server

On Thursday, August 20, 2009 12:30, Jerrad Pierce wrote,

Try changing your subject line to [$Organization #ticket_id]

No go. I even tried $rtname.

Just to be clear, you’re using the value assigned to these variable
sin your site config,
and not the literal strings ‘$rtname’, correct? And a ticket with the
ID you’re using
already exists? And the account you’re emailing form has the necessary
ACLs to write
to the ticket?

I created a file called “mail” and tried sending it to the rt-mailgateway but I receive an e-mail “error.”

COMMAND:
cat mail | /opt/rt3/bin/rt-mailgate --queue MIS --action comment --url http://clehbrtrckr01.broadvox.local

MAIL Message:
FROM: root@server.domain.local
TO: root@server.domain.localSubject: [MIS #9] A test

Test

ERROR E-mail Message from the server:
FROM: root@server.domain.local
TO: root@server.domain.local
Subject: Could not load a valid user

RT could not load a valid user, and RT’s configuration does not allow for the creation of a new user for your email.

I’m guessing that root@server.domain.local is not the same as RTUSER, root.

Eric.

CONFIDENTIAL. This e-mail and any attached files are confidential and should be destroyed and/or returned if you are not the intended and proper recipient.