Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Qmail Forwarding Question

Status
Not open for further replies.

sfcg

IS-IT--Management
Apr 24, 2006
10
US
I'm sorry for posting such a basic question in the forums. I've read every resource I could find, and unfortunately have an impending deadline. I just started with a company that has a Qmail server with a public interface. Mail works just fine in and out of this server. I have just in the last two weeks been exposed to Qmail, and have successfully set up a testing server at my house. I already had an exchange server there.

I'd ultimately like to use Qmail as the mail gateway like in this thread:
We have built out an Exchange server at work, set up a CRM solution for it and are using it internally. We want to use the Qmail server as a bastion host, or bridgehead server, and individually forward mail on a user by user basis, as we want to test the setup with a few users first. I read the O'Reilly Qmail book most of the way thorugh, and haven't really been able to find the exact method to do this. I really just want Qmail to look at the incoming mail and read "This is for cgleason@example.com", and check, see if it should be forewarded to the Exchange Server on the same subnet, and if not deliver it locally, until we can get all the users off the Qmail box. I have tried the | forward "$LOCAL@example.com" command in the users .qmail file, but have not so far been succesful with using the syntax. Besides, from what I understand, the | forward command, modifies the email domain, and both servers are in the same domain. It's just one's public and one's private. I appreciate any input. Thanks.
 
You have a few options...

Let me build a framework for response.

Let's assume that your qmail bastion (and current qmail host) is public-facing and is DNS'd as "mail.example.com" and your Exchange server is on a private network subnet.

If that's the case, then potentially solve this through some manipulation of each user's .qmail file. Or perhaps more precisely, you'll create a .qmail file for a user as an alias as you migrate their email off of the qmail server and thus physically remove their qmail Maildir.

("What did he say???")...

If on mail.example.com you have 26 users, named a-z, then you should have a folder somewhere for their Maildirs. As you migrate their mail to Exchange (which is what I infer you're attempting) then you'd end up removing their Maildir physically from the qmail server.

As you do that, you would implement a .qmail file as their alias with instructions to forward. Of course, you've recognized that this becomes messy.

I believe you could/should create a 'hosts' file entry for your Exchange server on the qmail server such that it can find that machine by private name. With this in place you will begin forwarding in your .qmail files this way:

[on qmail server for recently removed former local account 'a@example.com']
file: .qmail-a
&a@exchange.example.com

With this you would receive mail at qmail bastion for 'a@example.com' which is delivered to Exchange (the service) as "a@exchange.example.com"

I presume you are able to get Exchange (the service) to accept mail in such a form and get it to the desired box.

The problem with using a bastion host under qmail is that it's really designed with an all-or-nothing mentality. In my (limited?) experience it is not very clean to deal with user-by-user issues at the bastion. That you're going to still use the bastion as a mail server for some accounts creates the wrinkle.

Hopefully you can educate Exchange on how to handle the incoming mail with the slight modification to the domain string.

OK








D.E.R. Management - IT Project Management Consulting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top