Postfix + RT3 Guide

Is there a good guide to getting RT3 and postfix working together.

Also, anyone getting an exchange server to pass messages for RT onto an RT
installation successfully? I don’t know enough about Exchange or Email in
general to really now how to make this happen. Suggestions or links to documents
are appreciated.

Thanks,
JSR/

System Administrator
Washington Bible College/Capital Bible Seminary

At 02:38 PM 2/9/04, Josiah Ritchie wrote:

Is there a good guide to getting RT3 and postfix working together.

I’m running RT 3.06 with Postfix 2.0.18 on RedHat8. I was able to get the
mailgateway running with the standard aliases (as shown in the
documentation).
rt: "|/etc/smtsh/rt-mailgate --queue queue-name --action corrsepond (or
comment) --url http://rt.mydomain.com

If you want to give specific problems, I’ll be glad to do what I can to help.

I’ve gotten varying amounts of help here.
Sometimes reasonably good…sometimes silence.
(but then maybe I’m just spoiled with the Postfix users group)

Most anything is easy after you’ve done it successfully a few times

Leon Sonntag
Innovative Web Applications
leon at iwa-solutions dot com

Leon Sonntag scripted ::

I’m running RT 3.06 with Postfix 2.0.18 on RedHat8. I was able to get
the mailgateway running with the standard aliases (as shown in the
documentation).
rt: "|/etc/smtsh/rt-mailgate --queue queue-name --action corrsepond (or
comment) --url http://rt.mydomain.com/ http://rt.mydomain.com

Thank you for confirming that this part of it should still work.

If you want to give specific problems, I’ll be glad to do what I can to
help.

When I try to send messages to user@server.domain.com I get a bounce message
(mail.domain.com is running Exchange 5.5). I also seem to be unable to send
messages off the server. Internally rt and users are able to toss messages
around and fetchmail can go out and bring them in, but that seems like a kludgy
way to go about it. Shouldn’t I be able to send the messages directly to the
box? I’m probably missing something basic so appreciate your patience.

I’ve gotten varying amounts of help here.
Sometimes reasonably good…sometimes silence.
(but then maybe I’m just spoiled with the Postfix users group)

:slight_smile: And I a spoiled Gentoo user. At least no one cusses you out. I usually take
silence to mean I need to go back and try harder to find my problem and make a
more thorough report of my issues.

Most anything is easy after you’ve done it successfully a few times

I agree. :slight_smile: And then you can help others.

JSR/

I have more or less the same setup, postfix running on the same box as rt, with exchange 2k as our internal mail server. I really didn’t have any problems setting it up, but it may be that I randomly picked the right options.

on the rt/postfix box (webring.decarie.com) Below is for one queue.

/etc/aliases
rt: |“/usr/local/www/data/rt3/bin/rt-mailgate --queue Computer --action correspond --url http://Rtmail:xxxxxx@rt.decarie.com/” (using ldap authentication to our AD)

there is an entry in the transport map to send all decarie.com mail from the rt/postfix box over to the exchange server. Mail is addressed as user@decarie.com … not user@server.decarie.com

/usr/local/etc/postfix/maps/transport
decarie.com relay:[10.1.1.30]

over in happy exchange/AD land i’ve got some distribution groups to map rt@decarie.com to rt@webring.decarie.com. This allows us to send mail to rt@decarie.com instead of rt@webring.decarie.com. (This whole setup seems a bit iffy to me, but it worked immediately and I don’t really have time to change it). I seem to remember having an easier time of it before we upgraded (questionable term) to Exchange 2000 from Exchange 5.5

Not sure if any of this makes sense, but it works here.

When I try to send messages to user@server.domain.com I get a bounce message
from my main mail server mail.domain.com reporting “Unknown Recipient”
(mail.domain.com is running Exchange 5.5).

As your main mail server (mail.domain.com) handles mail for the whole
domain domain.com, it may strip any subdomain parts, i.e.
user@server.domain.com becomes user@domain.com. So you have to
explicitely enable mail forwarding to rt-server. You may have to create
the following aliases on your main mail exchanger :

rt-address : rt-address@rt-server.domain.com
(reads “rt-user@*.domain.com redirects to rt-user@rt-server.domain.com,
without recursion”)
rt-address-comment : rt-address-comment@rt-server.domain.com

Then set up the mailgate aliases normally on rt-server.domain.com, as
indicated in RT documentation.

I also seem to be unable to send
messages off the server.

Try to set up the following parameters in postfix main.cf file :

Only relay mails originating from $mydestination ($myhostname +

localhost by default) :
mynetworks_style = host

Relay all outgoing mails to $mydomain mail exchangers as indicated by

DNS MX records,
relayhost = $mydomain

You can also checks your /var/log/maillog file on the unix box to trace
mail routing.

Guillaume Perréal.

Responsable informatique,
Cemagref, groupement de Lyon,
France.

Tél: (+33) 4.72.20.87.87.
Fax: (+33) 4.78.47.78.75.
Site: http://www.lyon.cemagref.fr/

Bruce Segal scripted ::

I have more or less the same setup, postfix running on the same box as rt, with
exchange 2k as our internal mail server. I really didn’t have any problems
setting it up, but it may be that I randomly picked the right options.

on the rt/postfix box (webring.decarie.com) Below is for one queue.

/etc/aliases
rt: |“/usr/local/www/data/rt3/bin/rt-mailgate --queue Computer --action
correspond --url http://Rtmail:xxxxxx@rt.decarie.com/” (using ldap
authentication to our AD)

I’ll be doing AD auth once I can get RT to work as a whole packaged. One step at
a time, anyway am glad to hear another report that it works.

there is an entry in the transport map to send all decarie.com mail from the
rt/postfix box over to the exchange server. Mail is addressed as
user@decarie.com … not user@server.decarie.com

/usr/local/etc/postfix/maps/transport
decarie.com relay:[10.1.1.30]

Hm, that might help some. I’ll check into that a bit further. I don’t have that
file in that location.

over in happy exchange/AD land i’ve got some distribution groups to map
rt@decarie.com to rt@webring.decarie.com. This allows us to send mail to
rt@decarie.com instead of rt@webring.decarie.com. (This whole setup seems a
bit iffy to me, but it worked immediately and I don’t really have time to
change it). I seem to remember having an easier time of it before we upgraded
(questionable term) to Exchange 2000 from Exchange 5.5

Not sure if any of this makes sense, but it works here.

That’s a good idea. I’ll do that. I hadn’t gotten far enough to think about that
yet. You’ve helped me confirm some of my settings and given me a few directions
to look. While playing the the main.cf I’m also noticing some stuff about
relaying that might help also.

Thanks,
JSR/

I’ve played around a lot and think I’ve managed to apply everything you
mentioned here. It looks like I’m getting further. I’m not getting the message
bounced with the message: “550 Relay denied” from the exchange server. I’m not
sure if it is getting this from postfix or if It’s simply saying Exchange won’t
do it. I’m assuming Exchange is the problem. I think I told it to relay for my
hosts, but not sure. Anyway, I’m still looking into that possibility and
wanted to just mention that I’m getting closer.

Any tips on things to check in the postfix main.cf that might cause this?

Guillaume Perréal scripted ::

As your main mail server (mail.domain.com) handles mail for the whole
domain domain.com, it may strip any subdomain parts, i.e.
user@server.domain.com becomes user@domain.com. So you have to
explicitely enable mail forwarding to rt-server. You may have to create
the following aliases on your main mail exchanger :

rt-address : rt-address@rt-server.domain.com
(reads “rt-user@*.domain.com redirects to rt-user@rt-server.domain.com,
without recursion”)
rt-address-comment : rt-address-comment@rt-server.domain.com

Then set up the mailgate aliases normally on rt-server.domain.com, as
indicated in RT documentation.

I also seem to be unable to send
messages off the server.

Try to set up the following parameters in postfix main.cf file :

Only relay mails originating from $mydestination ($myhostname +

localhost by default) :
mynetworks_style = host

Relay all outgoing mails to $mydomain mail exchangers as indicated by

DNS MX records,
relayhost = $mydomain

Maybe I need to setup an MX record on my AD server…

JSR/

Check the ‘my_destinations’ parameter for $mydomain. Make sure this is
NOT in the list (it is by default). Reading the tread I suspect you
have created a mail loop where postfix gets mail and resends to itself.
This doesn’t work obviously so it bounces the message.

I suggest you draw a mail flow-chart so you can visualize how the mail
should flow. Should your rt server take mails directly?
(rt@host.example.com) or shall all mail be relayed through an existing
host (rt@example.com via MX server). That’s up to you… But here’s
the magic Postfix formula for the later case. Make sure you enable smtp
in master.conf and also don’t have any firewalls running.

------------ -------------------

For a mail server that does NOT answer mail for other machines or

relay mail for

other machines $mydomain must NOT be listed. This will create a mail

loop!
mydestination = $myhostname, localhost.$mydomain

This is the default I beleave… But just in case:

relay_domains = $mydestination

If your site has a proper DNS setup you’ll have an MX entry for your

local domain.

In this case, setting this to $mydomain will cause postfix to find

your mail server(s)

automatically. This is ideal, but change this to the hostname of your

mail server if

it does not work.

relayhost = $mydomain

You need to tell postfix where the aliases are. This file should have

your aliases for

rt that pipe in to the mail program. Use “dbm:/etc/aliases” on Linux.

alias_maps = hash:/etc/aliases

Always fall back to localhost. If you set this to a domain name and

want to recieve

local mail things will get very nasty very fast.

mydomain_fallback = localhost

------------ -------------------

Another thing for you to check if this doesn’t clear up your problem…
You may get a bounce message if RT cannot create a new case due to
access rights. If this is true, you’ll see a message show up in your
Apache error_log.On Tue, 2004-02-10 at 13:15, Josiah Ritchie wrote:

I’ve played around a lot and think I’ve managed to apply everything you
mentioned here. It looks like I’m getting further. I’m not getting the message
bounced with the message: “550 Relay denied” from the exchange server. I’m not
sure if it is getting this from postfix or if It’s simply saying Exchange won’t
do it. I’m assuming Exchange is the problem. I think I told it to relay for my
hosts, but not sure. Anyway, I’m still looking into that possibility and
wanted to just mention that I’m getting closer.

Any tips on things to check in the postfix main.cf that might cause this?

Guillaume Perr�al scripted ::

As your main mail server (mail.domain.com) handles mail for the whole
domain domain.com, it may strip any subdomain parts, i.e.
user@server.domain.com becomes user@domain.com. So you have to
explicitely enable mail forwarding to rt-server. You may have to create
the following aliases on your main mail exchanger :

rt-address : rt-address@rt-server.domain.com
(reads “rt-user@*.domain.com redirects to rt-user@rt-server.domain.com,
without recursion”)
rt-address-comment : rt-address-comment@rt-server.domain.com

Then set up the mailgate aliases normally on rt-server.domain.com, as
indicated in RT documentation.

I also seem to be unable to send
messages off the server.

Try to set up the following parameters in postfix main.cf file :

Only relay mails originating from $mydestination ($myhostname +

localhost by default) :
mynetworks_style = host

Relay all outgoing mails to $mydomain mail exchangers as indicated by

DNS MX records,
relayhost = $mydomain

Maybe I need to setup an MX record on my AD server…

JSR/


rt-users mailing list
rt-users@lists.bestpractical.com
The rt-users Archives

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

Dean J. Brissinger
Senior Systems Administrator

303-583-0278 (direct)
303-583-0200 (main)
303-583-0246 (fax)
Dean.Brissinger@vexcel.com

1690 38th Street
Boulder, CO 80301 USA

To change the relaying restrictions on Exchange 55 take a look in the Internet Mail Service → Properties → Routing → Routing Restrictions. You’re probably not allowing any smtp connections to the exchange box. (guess)

Take a look here → Microsoft Support

My setup for Exchange 2K doesn’t really apply, but we only allow SMTP mail into our Exchange server from the postfix/rt box. All other smtp connections would get the 550: relaying denied message.

Dean Brissinger scripted ::

Check the ‘my_destinations’ parameter for $mydomain. Make sure this is
NOT in the list (it is by default). Reading the tread I suspect you
have created a mail loop where postfix gets mail and resends to itself.
This doesn’t work obviously so it bounces the message.

I suggest you draw a mail flow-chart so you can visualize how the mail
should flow. Should your rt server take mails directly? (
rt@host.example.com mailto:rt@host.example.com ) or shall all mail be
relayed through an existing host ( rt@example.com
mailto:rt@example.com via MX server). That’s up to you… But
here’s the magic Postfix formula for the later case. Make sure you
enable smtp in master.conf and also don’t have any firewalls running.

I think the following link in master.conf enables smtp. Correct?
smtp inet n - n - - smtpd -v

I’m trying to get iptables to shutdown. Is iptables -F sufficient to remove any
block it might have?

------------ -------------------

For a mail server that does NOT answer mail for other machines or

relay mail for

other machines $mydomain must NOT be listed. This will create a mail

loop!

mydestination = $myhostname, localhost.$mydomain

This is set as follows:
mydestination = $myhostname, localhost.$mydomain rt.$mydomain it.$mydomain

This is the default I beleave… But just in case:

relay_domains = $mydestination

This was commented out.

If your site has a proper DNS setup you’ll have an MX entry for your

local domain.

In this case, setting this to $mydomain will cause postfix to find

your mail server(s)

automatically. This is ideal, but change this to the hostname of your

mail server if

it does not work.

relayhost = $mydomain

You need to tell postfix where the aliases are. This file should have

your aliases for

rt that pipe in to the mail program. Use “dbm:/etc/aliases” on Linux.

alias_maps = hash:/etc/aliases

Always fall back to localhost. If you set this to a domain name and

want to recieve

local mail things will get very nasty very fast.

mydomain_fallback = localhost

I don’t have this in my config at all. Adding it to the bottom

------------ -------------------

Another thing for you to check if this doesn’t clear up your problem…
You may get a bounce message if RT cannot create a new case due to
access rights. If this is true, you’ll see a message show up in your
Apache error_log.

I’m getting the following in my error_log, but I don’t think it’s related and so
I’m putting it off till I get this solved.

[Mon Feb 9 22:18:04 2004] [crit]: Trying to check RT::FM::Class rights for an
unspecified RT::FM::Class (/opt/rt3/lib/RT/Principal_Overlay.pm:355)

I don’t think it’s related because it’s happening at times that don’t appear
related to emails. It might just be something with custom fields that I set up.
I’m not sure and haven’t really checked.

JSR/

Bruce Segal scripted ::

To change the relaying restrictions on Exchange 55 take a look in the Internet
Mail Service → Properties → Routing → Routing Restrictions. You’re probably
not allowing any smtp connections to the exchange box. (guess)

Take a look here → Microsoft Support

My setup for Exchange 2K doesn’t really apply, but we only allow SMTP mail into
our Exchange server from the postfix/rt box. All other smtp connections would
get the 550: relaying denied message.

This looks like some good reading. That KB article moves into several others
that might also be helpful. Maybe I haven’t opened up smtp the way I’ve thought
I have.

JSR/

I’ve got mail going out! Not sure how, I just came in and it was working. Now I
just need to get the mail to go to the box correctly.

JSR/

Dean Brissinger scripted ::>On Wed, 2004-02-11 at 10:01, Josiah Ritchie wrote:

I think the following link in master.conf enables smtp. Correct?

smtp inet n - n - - smtpd -v

Yep. You can test this + the firewall by telnetting to port 25 from the
machine you’re trying to send mail from. You should get a SMTP server
talking to you.

I’m trying to get iptables to shutdown. Is iptables -F sufficient to
remove any

block it might have?

Not sure. (Check the man page) But if the above telnet test hangs
indefinitely, you have the port blocked. If you get a message that the
port doesn’t answer, you don’t have SMTP running.

This is set as follows:

mydestination = $myhostname, localhost.$mydomain rt.$mydomain
it.$mydomain

That should be fine.

I’m getting the following in my error_log, but I don’t think it’s
related and so

I’m putting it off till I get this solved.

[Mon Feb 9 22:18:04 2004] [crit]: Trying to check RT::FM::Class rights
for an

unspecified RT::FM::Class (/opt/rt3/lib/RT/Principal_Overlay.pm:355)

I don’t think that’s from the mail stuff unless it’s called by the mail
portion of RT (might be). If your newly acquired knowledge about
Exchange (thank ya Bruce) doesn’t help you you might try fixing this
first. Then tackling your mail problem.