RT with Qmail HOWTO

Hi,
Very many people on the RT Users mailing list seem to have problems
getting Qmail and RT working happily together. It’s not difficult at all.

I just put this together in about 5 minutes. I thought that it would be
nice to make a contribution to the RT user manual. Feel free to add this
text to RTFM. The current Qmail portion is woefully inadequate (no
offense intended to the original author) :slight_smile:

Comments, flames, criticism are all welcome!

RT with Qmail HOWTO

The following instructions will work for very small setups, as well
as for setups with a thousand support queues.

Without further adieu, let’s proceed.

  1. cd /var/qmail/users

  2. edit assign

=test:rt:4040:501:/home/rt:-:test:
=test-comment:rt:4040:501:/home/rt:-:test-comment:
=backup-support:rt:4040:501:/home/rt:-:backup-support:
=backup-support-comment:rt:4040:501:/home/rt:-:backup-support-comment:
=db-support:rt:4040:501:/home/rt:-:db-support:
=db-support-comment:rt:4040:501:/home/rt:-:db-support-comment:
=ldap-support:rt:4040:501:/home/rt:-:ldap-support:
=ldap-support-comment:rt:4040:501:/home/rt:-:ldap-support-comment:
.

NOTES:

In the above example, email addresses are created for 4 RT queues. The
fields are delimited by the : character. The third field is the rt
user’s UID, the fourth field is his GID, and the fifth field is his
home directory. Make sure those fields match your local configuration.

The last line of the assign file must be a single dot.

  1. while in the /var/qmail/users directory, execute:

    …/bin/qmail-newu

NOTE: you have to repeat step 5 every time you make a change to the assign file

  1. add aliases to rt’s home directory, 2 per queue, matching the assign file:

bella:root:/home/rt

ls -al

total 68
drwxr-xr-x 4 rt rt 4096 May 12 12:17 .
drwxr-xr-x 6 root root 4096 Mar 31 13:08 …
-rw-r–r-- 1 rt rt 155 May 12 12:16 .qmail-backup-support
-rw-r–r-- 1 rt rt 152 May 12 12:16 .qmail-backup-support-comment
-rw-r–r-- 1 rt rt 151 May 12 12:14 .qmail-db-support
-rw-r–r-- 1 rt rt 148 May 12 12:15 .qmail-db-support-comment
-rw-r–r-- 1 rt rt 153 May 12 12:17 .qmail-ldap-support
-rw-r–r-- 1 rt rt 150 May 12 12:17 .qmail-ldap-support-comment
-rw-r–r-- 1 rt rt 89 Mar 13 10:06 .qmail-test
-rw-r–r-- 1 rt rt 86 Mar 13 10:06 .qmail-test-comment

bella:root:/home/rt

cat .qmail-backup-support

| /var/qmail/bin/preline /usr/local/rt2/bin/rt-mailgate --queue backup-support --action correspond

bella:root:/home/rt

cat .qmail-backup-support-comment

| /var/qmail/bin/preline /usr/local/rt2/bin/rt-mailgate --queue backup-support --action comment

  1. If you created those .qmail files as root, then you need to

    chown rt:rt .qmail-*

  2. install the perl-suidperl rpm if you’re using linux. If not, then figure it out on your own.

  3. configure rt-mailgate to use suid-perl (or qmail will refuse to deliver)

bella:root:/usr/local/rt2/bin

head -n 2 rt-mailgate

#!/usr/bin/suidperl -w

EOF

Hint for Qmail+YP-Users

  1. edit assign

=test:rt:4040:501:/home/rt:-:test:
=test-comment:rt:4040:501:/home/rt:-:test-comment:

  1. while in the /var/qmail/users directory, execute:

…/bin/qmail-newu

If you generate your user-Table by running ‘qmail-pw2u’
this creates the File ‘assign’, so you have to make
those entries/changes of Step 2 in a file called ‘append’
which is added to ‘assign’ when ‘q�ail-pw2u’ is run.

So Step 2 with YP is

  1. edit append
    …same entries in there…

rerun qmail-pw2u
run qmail-newu

Just a hint, maybe somebody needs the difference.
(Sorry, I can not really test it, as we have
an YP-qmail-Mailhost but RT on an extra-system)

Stucki (postmaster of {math,inf,mi}.fu-berlin.de)

Looks all good, but I still can’t get it going. What it looks like in
your Howto is that you cover how to process mail once it is received, or
does this have anything to do with outgoing mail as well?

I have no need to process incoming mail, I would just like updates and
such to be sent to the apropriate watchers when tickets are updated, and
or changed. Here is what my logs put out

[Fri May 16 21:50:43 2003] [info]: RT::Scrip=HASH(0x9393f90): Couldn’t
prepare Open Tickets (/usr/local/RT/lib/RT/Scrip_Overlay.pm:338)
[Fri May 16 21:50:44 2003] [info]:
rt-3.0.0-14-47.0.78319641793847@garnetws.com #14/47 - Scrip 4
(/usr/local/RT/lib/RT/Action/SendEmail.pm:91)
[Fri May 16 21:50:44 2003] [info]:
rt-3.0.0-14-47.0.78319641793847@garnetws.com sent To: Cc: Bcc:
exothermic@softhome.net (/usr/local/RT/lib/RT/Action/SendEmail.pm:205)
[Fri May 16 21:50:45 2003] [info]:
rt-3.0.0-14-47.13.2152931448317@garnetws.com #14/47 - Scrip 5
(/usr/local/RT/lib/RT/Action/SendEmail.pm:91)
[Fri May 16 21:50:45 2003] [info]:
rt-3.0.0-14-47.13.2152931448317@garnetws.com sent To: Cc:
exothermic@softhome.net,miles.scruggs@garnetws.com Bcc:
(/usr/local/RT/lib/RT/Action/SendEmail.pm:205)
[Fri May 16 21:50:45 2003] [info]:
rt-3.0.0-14-47.9.67163978618608@garnetws.com #14/47 - Scrip 6
(/usr/local/RT/lib/RT/Action/SendEmail.pm:91)
[Fri May 16 21:50:46 2003] [info]:
rt-3.0.0-14-47.9.67163978618608@garnetws.com No recipients found. Not
sending.
(/usr/local/RT/lib/RT/Action/SendEmail.pm:170)

My smtp logs do not show any activity at all.

Here are what I see as the pertinate lines from the config

Set($MailCommand , ‘sendmailpipe’);
Set($SendmailArguments , “-oi -t”);
Set($SendmailPath , “/var/qmail/bin/sendmail”);

Someone sudjested that I replace the sendmail wrapper that is called in
the config with something that logs and calls a new sendmail wrapper, so
that I can see what is happening. While I understand this in theory, I
don’t know how to do it, would you be willing to elaborate.

I’m really stumped, and I’m sure I’m just missing one little thing.

Miles

Hi.

I have written a small Perl script for using qmail with RT with qmail’s
virtual domains:

http://konfido.de/misc/software

It’s written for RT2, but I’ve used it for RT3, to. You just have to modify
the mailgate call.

Regards,
Matthias

ext Miles Scruggs (midgard@garnetws.com) wrote:

Looks all good, but I still can’t get it going. What it looks like in
your Howto is that you cover how to process mail once it is received, or
does this have anything to do with outgoing mail as well?

Yep. That’s why it wasn’t called the “Qmail HOWTO”. There are already
good ones available. This was meant to cover the extra work between an
already working Qmail installation and a new RT installation.

Check out www.lifewithqmail.org for help setting up Qmail.

mike

ext Miles Scruggs (midgard@garnetws.com) wrote:

Looks all good, but I still can’t get it going. What it
looks like in
your Howto is that you cover how to process mail once it is
received,
or does this have anything to do with outgoing mail as well?

Yep. That’s why it wasn’t called the “Qmail HOWTO”. There are
already good ones available. This was meant to cover the
extra work between an already working Qmail installation and
a new RT installation.

Sorry I guess I wasn’t too clear. I do have a currently working qmail
system, both incoming and outgoing, using vpopmail for virtual domains.
Other programs are currently using qmail for outgoing mail, so I think
the MTA is working fine.

What I’m saying is that I’m having trouble getting RT to use qmail for
outgoing corespondence, incoming processing would be nice, but not
something that I really care about.

In the previous mails, I gave my logs etc, but I’m still stumped

Thanks

Miles

ext Miles Scruggs (midgard@garnetws.com) wrote:

What I’m saying is that I’m having trouble getting RT to use qmail for
outgoing corespondence, incoming processing would be nice, but not
something that I really care about.

Your outgoing mail configuration in etc/config.pm isn’t any different
than mine, except that I have a link from /var/qmail/bin/sendmail to
/usr/sbin/sendmail so I call that instead.

To debug qmail, just tail it’s logfile while trying to send a message.
The logfile location depends on your site-specific configuration. If you
aren’t the one who set the Qmail up, then ask the person who did.

mike

than mine, except that I have a link from /var/qmail/bin/sendmail to
/usr/sbin/sendmail so I call that instead.

That reminds me… There are sometimes (LINUX?) two places
where that link has to be done to:
/usr/lib/sendmail
/usr/sbin/sendmail
So may be one is missing or pointing to the original
sendmail and the mail stranded in sendmails queue.

Stucki

Christoph von Stuckrad * * |nickname |stucki@math.fu-berlin.de
Freie Universitaet Berlin |/_*|‘stucki’ |Tel(days):+49 30 838-75 459|
Fachbereich Mathematik, EDV|\ |if online|Tel(else):+49 30 77 39 6600|
Arnimallee 2-6/14195 Berlin
* |on IRCnet|Fax(alle):+49 30 838-75454/

ext Chr. von Stuckrad (stucki-rt-users@math.fu-berlin.de) wrote:> On Sat, May 17, 2003 at 11:57:59PM +0300, ‘Mike Jackson’ wrote:

than mine, except that I have a link from /var/qmail/bin/sendmail to
/usr/sbin/sendmail so I call that instead.

That reminds me… There are sometimes (LINUX?) two places
where that link has to be done to:
/usr/lib/sendmail
/usr/sbin/sendmail
So may be one is missing or pointing to the original
sendmail and the mail stranded in sendmails queue.

In which case Qmail is not properly configured. That’s why I referred to
him to the lifewithqmail howto :slight_smile:

mike

To debug qmail, just tail it’s logfile while trying to send a
message. The logfile location depends on your site-specific
configuration. If you aren’t the one who set the Qmail up,
then ask the person who did.

When I tail the log file of /var/log/qmail/qmail-smtpd/current or
/var/log/qmail/qmail-send/current

I don’t get anything in there, for all RT actions.

Now when I use another program that uses the sendmail wrappers, php for
instance. I get mail being sent and all the good stuff that goes on in
log files when it does. Unfortunally I don’t know enough myself to test
the sendmail wrapper dirrectly, but php should suffice.

Also RT logs show nothing really wrong either as far as I can tell.

[Sat May 17 21:41:18 2003] [info]: RT::Scrip=HASH(0x9443f08): Couldn’t
prepare Open Tickets (/usr/local/RT/lib/RT/Scrip_Overlay.pm:338)
[Sat May 17 21:41:19 2003] [info]:
rt-3.0.0-13-49.2.55614601056507@garnetws.com #13/49 - Scrip 4
(/usr/local/RT/lib/RT/Action/SendEmail.pm:91)
[Sat May 17 21:41:19 2003] [info]:
rt-3.0.0-13-49.2.55614601056507@garnetws.com No recipients found. Not
sending.
(/usr/local/RT/lib/RT/Action/SendEmail.pm:170)
[Sat May 17 21:41:20 2003] [info]:
rt-3.0.0-13-49.3.53437294790005@garnetws.com #13/49 - Scrip 5
(/usr/local/RT/lib/RT/Action/SendEmail.pm:91)
[Sat May 17 21:41:20 2003] [info]:
rt-3.0.0-13-49.3.53437294790005@garnetws.com sent To: Cc:
exothermic@softhome.net,miles.scruggs@garnetws.com Bcc:
(/usr/local/RT/lib/RT/Action/SendEmail.pm:205)
[Sat May 17 21:41:20 2003] [info]:
rt-3.0.0-13-49.18.9311155379727@garnetws.com #13/49 - Scrip 6
(/usr/local/RT/lib/RT/Action/SendEmail.pm:91)
[Sat May 17 21:41:21 2003] [info]:
rt-3.0.0-13-49.18.9311155379727@garnetws.com No recipients found. Not
sending.
(/usr/local/RT/lib/RT/Action/SendEmail.pm:170)

Let me know if I’m missing something

Miles

Well I can get rid of the

No recipients found. Not sending.
(/usr/local/rt/lib/RT/Action/SendEmail.pm:171)

By just filling in the right email boxes, but that doesn’t mean any of
my mail is going out. So as of yet, no I can not get any mail sent to,
any of the ticket watchers on creating or updates.

I’m not familier with Exim as the MTA, but if you can check the MTA logs
and see if it reports any mail being sent out? I’m running qmail and it
doesn’t report any mail, being sent at all.

Miles