Problem with mail-gateway conf

Hi.
I’m at the first time RT startup.
I’ve correctly installed the 3.0.7_01 release.
The web ui goes well, but I’m not able to make work the mail features
and so to open new ticket by mail and so to obtain rt mail feedback.

I set the following alias in /etc/aliases:
rt:"|/home/rt/rt-yogitech/bin/rt-mailgate --queue ITgroup --action
correspond

but when I try to send an e-mail to rt account, after a lot I obtain a
reply that says something like:

----- The following addresses had permanent fatal errors -----
"|/home/rt/rt-yogitech/bin/rt-mailgate --queue ITgroup --action correspond
(reason: Operating system error)
(expanded from: rt@localhost)

what’s going wrong?
Someone may help me?

Thanks in advance.

stefano

stefano wrote:

I set the following alias in /etc/aliases:
rt:"|/home/rt/rt-yogitech/bin/rt-mailgate --queue ITgroup --action
correspond

but when I try to send an e-mail to rt account, after a lot I obtain a
reply that says something like:

----- The following addresses had permanent fatal errors -----
"|/home/rt/rt-yogitech/bin/rt-mailgate --queue ITgroup --action correspond
(reason: Operating system error)
(expanded from: rt@localhost)

what’s going wrong?

What MTA do you use? If you use sendmail, you may need to put a symlink
to rt-mailgate in /etc/smrsh and use that instead. It’s a safety feature
that some distributions compile into sendmail by default. This will
affect .forward files as well.

I’ve been getting good results by using procmail instead of
/etc/aliases. Create a user to receive RT’s mail, and use that user’s
.procmailrc to filter the mail and sort it into the proper queue. It’s a
lot more flexible and doesn’t require root privileges. It also allows
you to do spam filtering on a per-queue basis (otherwise, your abuse
queue would always be strangely empty).

Hi Jorey,
I’ve tried to add a symlink in /etc/smrsh pointing to rt-mailgate and
now the error I obtain is:

----- The following addresses had permanent fatal errors -----
"|/home/rt/rt-yogitech/bin/rt-mailgate --queue ITgroup --action correspond
(reason: Service unavailable)
(expanded from: rt@localhost)

----- Transcript of session follows -----
553 5.0.0 “|/home/rt/rt-yogitech/bin/rt-mailgate --queue ITgroup --action correspond… Unbalanced '”’
smrsh: “rt-mailgate” not available for sendmail programs (stat failed)
554 5.0.0 Service unavailable

stefano

Jorey Bump wrote:

stefano wrote:

Hi Jorey,
I’ve tried to add a symlink in /etc/smrsh pointing to rt-mailgate and
now the error I obtain is:

----- The following addresses had permanent fatal errors -----
"|/home/rt/rt-yogitech/bin/rt-mailgate --queue ITgroup --action correspond
(reason: Service unavailable)
(expanded from: rt@localhost)

----- Transcript of session follows -----
553 5.0.0 “|/home/rt/rt-yogitech/bin/rt-mailgate --queue ITgroup
–action correspond… Unbalanced '”’
smrsh: “rt-mailgate” not available for sendmail programs (stat failed)
554 5.0.0 Service unavailable

It’s better to approach this systematically:

First, find out if your version of sendmail is using smrsh:

sendmail -d0.20 -bv | grep smrsh

If it is, then add a symlink:

cd /etc/smrsh
ln -s /home/rt/rt-yogitech/bin/rt-mailgate rt-mailgate

Then in /etc/aliases put this (on one line):

rt: “|/etc/smrsh/rt-mailgate --queue ITgroup --action correspond
–url http://itgroup.example.com/

Save the file and generate your new aliases table:

newaliases

Check your log for errors. If there aren’t any, send a message to RT. It
should work.

I followed exactly your suggestions:

-bash-2.05b# sendmail -d0.20 -bv | grep smrsh
mailer 0 (prog): P=/usr/sbin/smrsh S=EnvFromL/HdrFromL R=EnvToL/HdrToL
M=0 U=0:0 F=9DFMeloqsu L=0 E=\n T=X-Unix/X-Unix/X-Unix r=100 A=smrsh -c $u

So I think smrsh is used by sendmail.

Then I put the rt-mailgate symlink inside /etc/smrsh
and I modified the /etc/aliases adding the following line:

rt:"|/etc/smrsh/rt-mailgate --queue ITgroup --action correspond
–url=http://rt.yogitech.int:9091
then I run the newaliases command to refresh them.
But when I try to send an e-mail to the rt mail account, I got the mail
reply with the following body:

----- The following addresses had permanent fatal errors -----
“|/etc/smrsh/rt-mailgate --queue ITgroup --action correspond --url=http://rt.yogitech.int:9091
(reason: Service unavailable)
(expanded from: rt@localhost)

----- Transcript of session follows -----
smrsh: “rt-mailgate” not available for sendmail programs (stat failed)

Looking the /var/log/maillog file, the messages logged are:

Dec 10 11:17:19 jose sendmail[13247]: hBAAHJTG013247: from=stefano.razzauti@yogitech.com, size=777, class=0, nrcpts=1, msgid=3FD6E4DE.5040103@yogitech.com, bodytype=7BIT, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Dec 10 11:17:19 jose sendmail[13249]: hBAAHJTG013247: Warning: program /usr/sbin/smrsh unsafe: Group writable file
Dec 10 11:17:19 jose smrsh: uid 8: attempt to use “rt-mailgate --queue ITgroup --action correspond --url=http://rt.yogitech.int:9091” (stat failed)
Dec 10 11:17:19 jose sendmail[13248]: hBAAHJTG013247: to=“|/etc/smrsh/rt-mailgate --queue ITgroup --action correspond --url=http://rt.yogitech.int:9091”, ctladdr=rt@localhost (8/0), delay=00:00:00, xdelay=00:00:00, mailer=prog, pri=30962, dsn=5.0.0, stat=Service unavailable
Dec 10 11:17:19 jose sendmail[13248]: hBAAHJTG013247: hBAAHJTG013248: DSN: Service unavailable
Dec 10 11:17:25 jose sendmail[13248]: hBAAHJTG013248: to=stefano.razzauti@yogitech.com, delay=00:00:06, xdelay=00:00:05, mailer=relay, pri=31986, relay=mail.yogitech.com. [194.153.172.36], dsn=2.0.0, stat=Sent (hBA94S918691 Message accepted for delivery)

ste
554 5.0.0 Service unavailable

Jorey Bump wrote:

Dec 10 11:17:19 jose sendmail[13249]: hBAAHJTG013247: Warning: program
/usr/sbin/smrsh unsafe: Group writable file

Pretty clear, isn’t it? Check the permissions of that file, should be
555 owner/group root/root, most likely.

-- Niels.

I’ve just modified that permissions to 755, but I suppose this is only a
warning message, not the reason why
my mail-gateway doesn’t work.

Do you know what the other messages mean?

ste

Niels Bakker wrote:

You shouldn’t change the aliases line, just create the symlink in
/etc/smrsh and all should be well.

If you are using a newer distro (RH9 for example) you will also need to
modify your sendmail.mc to allow outside emails and then regenerate
the sendmail.cf

Gary Lawrence Murphy garym@teledyn.com
www.teledyn.com/mt - www.teledyn.com - sbp.teledyn.com
You don’t play what you know; you play what you hear.

I’ve just modified that permissions to 755, but I suppose this is only a
warning message, not the reason why
my mail-gateway doesn’t work.

Do you know what the other messages mean?

Actually I wasn’t paying attention either, the problem lies here:

| Dec 10 11:17:19 jose smrsh: uid 8: attempt to use “rt-mailgate --queue
| ITgroup --action correspond --url=http://rt.yogitech.int:9091” (stat
| failed)

Are you sure /etc/smrsh/ is the correct directory, and the symlink is
there correctly? If so, tried copying the script there directly?

-- Niels.

Great!! I copied the rt-mailgate file inside the /etc/smrsh directory
and it works.

thanks a lot

stefano

Niels Bakker wrote: