Request Tracker RT 3.8.1 on Fedora: /etc/aliases: mail aliases for Queues
I am writing this more for future me than anything else. We’d set up our help desk (well, technically our .bash_profiles on our various servers) such that any root access would be logged to RT.
We’d originally set it up to go to our generic help desk queue, but that quickly proved annoying. First of all, we’re in the midst of bringing all sorts of web services online, and this requires a lot of root access. And second, I don’t want root access messages getting lost among the various “Freddy Can’t Print his Email” tickets.
RT makes this oh so easy. With a few caveats that really have nothing to do with RT, it has to do with mail.
The RT Queue
In RT, I created a queue called rootAccessAlerts. I set its Reply and Comment Address to root.access@my.rtserver.com.
/etc/smrsh and rt-mailgate
First, you should familiarize yourself with smrsh, the restricted shell that allows sendmail to execute commands found only in the /etc/smrsh directory. This looks to be a Fedora thing, according to this article, from which I gleaned this information. Take a look at the man page for smrsh to learn more.
In /etc/smrsh, I wrote shell scripts that sendmail would execute. First, I wrote rt-mailgate-gen:
1 2 | #!/bin/sh /opt/rt3/bin/rt-mailgate $* |
Next, after some gnashing of teeth, I figured out that I needed another script, as one of my queues had a space in its name – and $* was parsing it according to what shell wanted to do, and not what I wanted it to do. So, I wrote second script, called rt-mailgate-gen-helpdesk
1 2 | #/bin/sh /opt/rt3/bin/rt-mailgate --queue 'help desk' --action correspond --url http://my.rtserver.com/rt3 |
/etc/aliases
OK, now let’s add the alias for to root.access@my.rtserver.com email address. Edit /etc/aliases using your favorite text editor (or mine, which is vim), and add lines for the root.access alias:
root.access: "|rt-mailgate-gen --queue 'rootAccessAlerts' --action correspond --url http://my.rtserver.com/rt3" root.access-comment: "|rt-mailgate-gen --queue 'rootAccessAlerts' --action comment --url http://my.rtserver.com/rt3"
Once saved, run the newaliases command so sendmail knows about the .. uhh … new aliases.
All done!
hello,
I recently installed request tracker 3.8.1 on debian, i want that Rt accept tickets by email, so a tickets will be generated automatically when RT receive email. I found a document, it describe how integer this functionality( http://www.linux-mag.com/id/5811), but that doesn’t work.
I edited /var/log/syslog:
Jan 9 08:43:49 hanane RT: Use of uninitialized value $From in pattern match (m//) at /opt/rt3/bin/../lib/RT/Interface/Email.pm line 151. (/opt/rt3/bin/../llib/RT/Interface/Email.pm:151)
Jan 9 08:43:49 hanane RT: Use of uninitialized value $From in pattern match (m//) at /opt/rt3/bin/../lib/RT/Interface/Email.pm line 151. (/opt/rt3/bin/../llib/RT/Interface/Email.pm:151)
Jan 9 08:43:49 hanane RT: Use of uninitialized value $From in string eq at /opt/rt3/bin/../lib/RT/Interface/Email.pm line 151. (/opt/rt3/bin/../lib/RT/Interface/Email.pm:151)
Jan 9 08:43:49 hanane RT: Couldn’t find sender’s address (/opt/rt3/bin/../lib/RT/Interface/Email/Auth/MailFrom.pm:67)
Jan 9 08:43:49 hanane RT: Could not record email: Could not load a valid user (/opt/rt3/share/html/REST/1.0/NoAuth/mail-gateway:75)
I don’t understand what is the problem.
please can you help me.
best regards.
Hanan5656@hotmail.com
I’ve sent you email under separate cover as well, Hanan. Take a look at the SMTP section on this J. Mike Rollins page: http://www.wfu.edu/~rollins/rtir.html. I suspect that it’s one of the problem listed – for example, “Everyone” must be granted the “CreateTicket” rights. Also, I know you have to be careful in Fedora using queue names with spaces in them – to cure that problem see J. Mike Rollins’ section about smrsh. Hope this helps.
Hello,
Thank you very much, it really helped me to solve the problem.
Thanks.
Hello,
I installed RT-Extension-CommandByMail-0.06, all the commands work except those of custom fields,i don’t undestand why. Can you help me please.
Thank you.
Hanane.
Well I’m afraid I’m out of my league on that one; I’ve not installed that extension. I suggest you try the RT mailing list:
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
Best, M
Thank you,
Hanane.