FW: rt-mailgate

This is what I get, but it does not create a ticket. I’m a newbie at this so I apologize if I sound ignorant of some commands.
I’ve also tried “sendmail -bv monitor@rttracker.denovis.com” and it comes back with “|/opt/rt3/bin/rt-mailgate --queue Monitor --action correspond --url http://localhost/”… deliverable: mailer prog, user “|/opt/rt3/bin/rt-mailgate --queue Monitor --action correspond --url http://localhost/

-bash-2.05b# cat my-mail | sendmail -v -t -oi monitor@rttracker.denovis.com
monitor@rttracker.denovis.com… Connecting to localhost.localdomain. via relay…
220 rttracker.denovis.com ESMTP Sendmail 8.12.5/8.12.5; Tue, 3 Jun 2003 16:36:11 -0400

EHLO rttracker.denovis.com
250-rttracker.denovis.com Hello localhost.localdomain [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
MAIL From:root@rttracker.denovis.com SIZE=5
250 2.1.0 root@rttracker.denovis.com… Sender ok
RCPT To:monitor@rttracker.denovis.com
DATA
250 2.1.5 monitor@rttracker.denovis.com… Recipient ok
354 Enter mail, end with “.” on a line by itself
.
250 2.0.0 h53KaBts000793 Message accepted for delivery
monitor@rttracker.denovis.com… Sent (h53KaBts000793 Message accepted for delivery)
Closing connection to localhost.localdomain.
QUIT
221 2.0.0 rttracker.denovis.com closing connection-----Original Message-----
From: Michael van Elst [mailto:mlelstv@dev.de.cw.net]
Sent: Tuesday, June 03, 2003 11:39 AM
To: Cassily, Ryan
Subject: Re: [rt-users] rt-mailgate

On Tue, Jun 03, 2003, Cassily, Ryan wrote:

I executed the following and it did create tickets in the proper queue.

cat test | ./rt-mailgate --action correspond --queue monitor --url http://localhost/

Yes. But the mailer probably runs under a different uid.

What happens when you pipe the mail though sendmail manually ? I.e.

cat test | sendmail -v -t -oi

Greetings,
,eM"“=. a”-. Michael van Elst
dWWMWM" - :GM==; mlelstv@dev.de.cw.net
:WWMWMw=–. "W=’ cable & wireless
9WWMm==-.
“-Wmw-” CABLE & WIRELESS

The log file is configured to be located at /opt/rt3/var/log but the directory is empty.

I have a quick question. There seems to be a testing section at the beginning of the rt-mailgate file. Is that run everytime rt-,ailgate is called by sendmail?

Thanks for your help-----Original Message-----
From: Michael van Elst [mailto:mlelstv@dev.de.cw.net]
Sent: Wednesday, June 04, 2003 4:57 AM
To: Cassily, Ryan
Subject: Re: FW: [rt-users] rt-mailgate

On Tue, Jun 03, 2003, Cassily, Ryan wrote:

This is what I get, but it does not create a ticket. I’m a newbie at this so I apologize if I sound ignorant of some commands.
I’ve also tried “sendmail -bv monitor@rttracker.denovis.com” and it comes back with “|/opt/rt3/bin/rt-mailgate --queue Monitor --action correspond --url http://localhost/”… deliverable: mailer prog, user “|/opt/rt3/bin/rt-mailgate --queue Monitor --action correspond --url http://localhost/

This seemed to be successful. RT should have logged either the success
or the problem. Depending on the RT configuration this is the standard
syslog (/var/adm/messages or /var/log/messages) or the file you specified
in the RT configuration.

Please check.

,eM""=.            a"-.                         Michael van Elst

dWWMWM" - :GM==; mlelstv@dev.de.cw.net
:WWMWMw=–. "W=’ cable & wireless
9WWMm==-.
“-Wmw-” CABLE & WIRELESS

I have a quick question. There seems to be a testing section at the beginning of the rt-mailgate file. Is that run everytime rt-,ailgate is called by sendmail?

no. that’s only run by te testing suite.

Thanks for your help

-----Original Message-----
From: Michael van Elst [mailto:mlelstv@dev.de.cw.net]
Sent: Wednesday, June 04, 2003 4:57 AM
To: Cassily, Ryan
Subject: Re: FW: [rt-users] rt-mailgate

This is what I get, but it does not create a ticket. I’m a newbie at this so I apologize if I sound ignorant of some commands.
I’ve also tried “sendmail -bv monitor@rttracker.denovis.com” and it comes back with “|/opt/rt3/bin/rt-mailgate --queue Monitor --action correspond --url http://localhost/”… deliverable: mailer prog, user “|/opt/rt3/bin/rt-mailgate --queue Monitor --action correspond --url http://localhost/

This seemed to be successful. RT should have logged either the success
or the problem. Depending on the RT configuration this is the standard
syslog (/var/adm/messages or /var/log/messages) or the file you specified
in the RT configuration.

Please check.


,eM"“=. a”-. Michael van Elst
dWWMWM" - :GM==; mlelstv@dev.de.cw.net
:WWMWMw=–. "W=’ cable & wireless
9WWMm==-.
“-Wmw-” CABLE & WIRELESS


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

Have you read the FAQ? The RT FAQ Manager lives at http://fsck.com/rtfm

Request Tracker... So much more than a help desk — Best Practical Solutions – Trouble Ticketing. Free.

I changed the config file to read the following yet the rt.log is still o bytes.
-rw-rw-rw- 1 root rt 0 Jun 4 16:24 rt.log

Mail loops will generate a critical log message.

Set($LogToSyslog , undef);
Set($LogToScreen , undef);
Set($LogToFile , ‘debug’);
Set($LogToFileNamed , “$LogDir/rt.log”); #log to rt.log..

The only thing being recorded is the maillog. Could there be a permission issue? What should the permissions look like on the rt3 directory? Mine is currently:

drwxr-xr-x 2 root rt 4096 Jun 3 10:57 bin
drwxr-xr-x 2 root rt 4096 Jun 4 17:17 etc
drwxr-xr-x 4 root bin 4096 May 30 07:39 lib
drwxr-xr-x 4 root nobody 4096 May 30 07:39 local
drwxr-xr-x 2 root rt 4096 May 30 07:39 sbin
drwxr-xr-x 3 root root 4096 May 30 07:39 share
drwxr-xr-x 5 root rt 4096 May 30 07:39 varFrom: Michael van Elst [mailto:mlelstv@dev.de.cw.net]
Sent: Wednesday, June 04, 2003 11:49 AM
To: Cassily, Ryan
Subject: Re: FW: [rt-users] rt-mailgate

The log file is configured to be located at /opt/rt3/var/log but the directory is empty.

In RT_SiteConfig.pm you need to have something like:

Set($LogToSyslog , undef);
Set($LogToFile , ‘debug’);

the default is the opposite:

Set($LogToSyslog , ‘debug’);
Set($LogToFile , undef);

so the log output is sent to to syslog.

You also must ensure that rt-mailgate (i.e you, when you run it)
have write access to the configured directory.

I have a quick question. There seems to be a testing section at the beginning of the rt-mailgate file. Is that run everytime rt-,ailgate is called by sendmail?

No, it isn’t.

Greetings,
,eM"“=. a”-. Michael van Elst
dWWMWM" - :GM==; mlelstv@dev.de.cw.net
:WWMWMw=–. "W=’ cable & wireless
9WWMm==-.
“-Wmw-” CABLE & WIRELESS

drwxr-xr-x 2 root rt 4096 Jun 3 10:57 bin

Hmm. Can you check the Mprog definition in your sendmail.cf ?
You might have defined a chroot directory.

,eM""=.            a"-.                         Michael van Elst

dWWMWM" - :GM==; mlelstv@dev.de.cw.net
:WWMWMw=–. "W=’ cable & wireless
9WWMm==-.
“-Wmw-” CABLE & WIRELESS

Here is the Mprog lines from the sendmail.cf file, along with Mprocmail and Mlocal.

Mprocmail, P=/usr/bin/procmail, F=DFMSPhnu9, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP/HdrFromSMTP,
T=DNS/RFC822/X-Unix,
A=procmail -Y -m $h $f $u

Mlocal, P=/usr/bin/procmail, F=lsDFMAw5:/|@qSPfhn9, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL,
T=DNS/RFC822/X-Unix,
A=procmail -t -Y -a $h -d $u

Mprog, P=/usr/sbin/smrsh, F=lsDFMoqeu9, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL, D=$z:/,
T=X-Unix/X-Unix/X-Unix,
A=smrsh -c $u-----Original Message-----
From: Michael van Elst [mailto:mlelstv@dev.de.cw.net]
Sent: Wednesday, June 04, 2003 6:39 PM
To: Cassily, Ryan
Cc: Rt-Users@Lists. Fsck. Com (E-mail)
Subject: Re: FW: [rt-users] rt-mailgate

On Wed, Jun 04, 2003, Cassily, Ryan wrote:

drwxr-xr-x 2 root rt 4096 Jun 3 10:57 bin

Hmm. Can you check the Mprog definition in your sendmail.cf ?
You might have defined a chroot directory.

,eM""=.            a"-.                         Michael van Elst

dWWMWM" - :GM==; mlelstv@dev.de.cw.net
:WWMWMw=–. "W=’ cable & wireless
9WWMm==-.
“-Wmw-” CABLE & WIRELESS

Mprog, P=/usr/sbin/smrsh, F=lsDFMoqeu9, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL, D=$z:/,
T=X-Unix/X-Unix/X-Unix,
A=smrsh -c $u

There we go. smrsh will only allow you to execute programs in
the sm.bin directory and will bail out with ‘Service unavailable’
if the program isn’t there.

The exact sm.bin path depends on your system, usually that’s
/usr/libexec/sm.bin or /var/adm/sm.bin.

You either have to copy rt-mailgate (or a small wrapper script) into
the sm.bin directory or you have to modify the sendmail configuration
to

Mprog, P=/usr/sbin/smrsh, F=lsDFMoqeu9, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL, D=$z:/,
T=X-Unix/X-Unix/X-Unix,
A=sh -c $u

which will allow you to run arbitrary programs to deliver mail.
It’s up to you to decide wether the more strict security of
smrsh is required on your system.

Greetings,
,eM"“=. a”-. Michael van Elst
dWWMWM" - :GM==; mlelstv@dev.de.cw.net
:WWMWMw=–. "W=’ cable & wireless
9WWMm==-.
“-Wmw-” CABLE & WIRELESS

Very interesting. I believe we’re making headway. I had to add a symbolic link in the /etc/smrsh directory to get sendmail to use rt-mailgate. However, I am now recieving an error in the mailog:

Jun 5 12:50:19 rttracker sendmail[711]: h55GoJSP000711: from=rcassily@DENOVIS.COM, size=516, class=0, nrcpts=1, msgid=B5A4987C50B02D4B8DB479C5796346243ECC6C@exchsrvr-1.ehealthdirect.com, proto=ESMTP, daemon=MTA, relay=exchsrvr-1.ehealthdirect.com [172.16.5.112]
Jun 5 12:50:20 rttracker sendmail[712]: h55GoJSP000711: to=“|rt-mailgate --queue Monitor --action correspond --url http:/localhost/”, ctladdr=monitor@rttracker.denovis.com (8/0), delay=00:00:01, xdelay=00:00:01, mailer=prog, pri=30749, dsn=4.0.0, stat=Deferred: prog mailer (/usr/sbin/smrsh) exited with EX_TEMPFAIL

and I get an error back after the relay times out after 4 hrs with:

The original message was received at Thu, 5 Jun 2003 08:30:24 -0400
from exchsrvr-1.ehealthdirect.com [172.16.5.112]

----- Transcript of session follows -----
Use of uninitialized value in pattern match (m//) at /usr/local/lib/perl5/site_perl/5.8.0/HTTP/Cookies.pm line 124, <> chunk 1.
An Error Occurred

500 Can’t connect to :80 (Bad hostname ‘’)
“|rt-mailgate --queue Monitor --action correspond --url http:/localhost/”… Deferred: prog mailer (/usr/sbin/smrsh) exited with EX_TEMPFAIL
Warning: message still undelivered after 4 hours
Will keep trying until message is 5 days old

Seems like I’m running into a dns issue now with it coming back with a bad hostname.-----Original Message-----
From: Michael van Elst [mailto:mlelstv@dev.de.cw.net]
Sent: Wednesday, June 04, 2003 7:14 PM
To: Cassily, Ryan
Cc: Rt-Users@Lists. Fsck. Com (E-mail)
Subject: Re: FW: [rt-users] rt-mailgate

On Wed, Jun 04, 2003, Cassily, Ryan wrote:

Mprog, P=/usr/sbin/smrsh, F=lsDFMoqeu9, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL, D=$z:/,
T=X-Unix/X-Unix/X-Unix,
A=smrsh -c $u

There we go. smrsh will only allow you to execute programs in
the sm.bin directory and will bail out with ‘Service unavailable’
if the program isn’t there.

The exact sm.bin path depends on your system, usually that’s
/usr/libexec/sm.bin or /var/adm/sm.bin.

You either have to copy rt-mailgate (or a small wrapper script) into
the sm.bin directory or you have to modify the sendmail configuration
to

Mprog, P=/usr/sbin/smrsh, F=lsDFMoqeu9, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL, D=$z:/,
T=X-Unix/X-Unix/X-Unix,
A=sh -c $u

which will allow you to run arbitrary programs to deliver mail.
It’s up to you to decide wether the more strict security of
smrsh is required on your system.

Greetings,
,eM"“=. a”-. Michael van Elst
dWWMWM" - :GM==; mlelstv@dev.de.cw.net
:WWMWMw=–. "W=’ cable & wireless
9WWMm==-.
“-Wmw-” CABLE & WIRELESS

500 Can’t connect to :80 (Bad hostname ‘’)
“|rt-mailgate --queue Monitor --action correspond --url http:/localhost/”… Deferred: prog mailer (/usr/sbin/smrsh) exited with EX_TEMPFAIL
Warning: message still undelivered after 4 hours
Will keep trying until message is 5 days old

Seems like I’m running into a dns issue now with it coming back with a bad hostname.

Seems like you forgot a / in that URL

(http:/localhost/ instead of http://localhost/)

-- Niels.

Thanks. Boy do I feel bad. Maybe I was just looking at this for too long.

Thanks to everyone for their help.From: Niels Bakker [mailto:niels=rt@bakker.net]
Sent: Thursday, June 05, 2003 1:52 PM
To: rt-users@lists.fsck.com
Subject: Re: FW: [rt-users] rt-mailgate

500 Can’t connect to :80 (Bad hostname ‘’)
“|rt-mailgate --queue Monitor --action correspond --url http:/localhost/”… Deferred: prog mailer (/usr/sbin/smrsh) exited with EX_TEMPFAIL
Warning: message still undelivered after 4 hours
Will keep trying until message is 5 days old

Seems like I’m running into a dns issue now with it coming back with a bad hostname.

Seems like you forgot a / in that URL

(http:/localhost/ instead of http://localhost/)

-- Niels.

rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

Have you read the FAQ? The RT FAQ Manager lives at http://fsck.com/rtfm

“|rt-mailgate --queue Monitor --action correspond --url http:/localhost/”… Deferred: prog mailer (/usr/sbin/smrsh) exited with EX_TEMPFAIL

There is a typo in the URL. I guess it should be

http://localhost/

with two / instead of

http:/localhost/

Greetings,
,eM"“=. a”-. Michael van Elst
dWWMWM" - :GM==; mlelstv@dev.de.cw.net
:WWMWMw=–. "W=’ cable & wireless
9WWMm==-.
“-Wmw-” CABLE & WIRELESS