Current time: 11-15-2024, 05:36 PM Hello There, Guest! (LoginRegister)


Post Reply 
Relay single Domain to relayhost?
Author Message
polysign Offline
Junior Member
*

Posts: 13
Joined: Oct 2009
Reputation: 0
Post: #1
Relay single Domain to relayhost?
Hi there,

I have a simple. but yet frustrating question/problem to solve...

I have multiple domains setup on my ispcp server. One client however uses his own Exchange Server locally (his office). Now I want to relay all incoming mails for his domain to his own Exchange server.

So I setup a transport map:
hisdomain.tld smtp:IPofEXCHANGE

and put it into a transport_map in the main.cf.

That does work if I the mail address I am sending to is setup in the alias.db / in ispcp as alias or mailbox account.

How can I solve this without having to setup a mail account in my ispcp box for every account on the exchange server?

Please help Smile
01-01-2010 12:21 AM
Find all posts by this user Quote this message in a reply
motokochan Offline
Member
***

Posts: 274
Joined: Jul 2008
Reputation: 1
Post: #2
RE: Relay single Domain to relayhost?
Do a search on using external mail services. Once you set the correct MX in DNS, your server should send to the right place.
01-01-2010 03:22 PM
Visit this user's website Find all posts by this user Quote this message in a reply
polysign Offline
Junior Member
*

Posts: 13
Joined: Oct 2009
Reputation: 0
Post: #3
RE: Relay single Domain to relayhost?
Dear Motokochan,

you were right! Smile It was that simple...

So all I had to do is remove the domain from the /etc/postfix/ispcp/domains list and rebuild the domains.db using postmap. Then I manually changed the DNS Zone for that domain by changing the IP of the mail.domain.com entry.

It's no clean setup and I don't know how ispcp will handle the manual removal of the domain in the domain.db. But I hope as long as I don't edit the email-settings fro that domain, it will be allright Wink

Thanks again.
01-01-2010 10:03 PM
Find all posts by this user Quote this message in a reply
polysign Offline
Junior Member
*

Posts: 13
Joined: Oct 2009
Reputation: 0
Post: #4
RE: Relay single Domain to relayhost?
Not to forget:

In my main.cf (Postfix Conf) I had to add the following line:

relay_domains = $mydestination, domain2relay.com

Otherwise postfix will give an "relay access denied" for that domain.
01-02-2010 09:00 PM
Find all posts by this user Quote this message in a reply
motokochan Offline
Member
***

Posts: 274
Joined: Jul 2008
Reputation: 1
Post: #5
RE: Relay single Domain to relayhost?
You shouldn't need to do that if you are using an external mail service. The local server should have relay access, and external servers should be using the correct MX for that outside domain.
01-04-2010 01:49 PM
Visit this user's website Find all posts by this user Quote this message in a reply
polysign Offline
Junior Member
*

Posts: 13
Joined: Oct 2009
Reputation: 0
Post: #6
RE: Relay single Domain to relayhost?
I guess it just worked that way because the public MX record for that domain points to our servers, and not to the mail server for that client.

So all mails have to come to our server first, then get forwarded to the clients exchange server.

The moment the domain was listed in the local postfix domain.db, postfix tried to post the mail locally on the server. When I removed the domain from the list, postfix tried to send it to the MX record. As the MX record (by default, on the local server where ispcp runs) points to itself, it couldn't deliver! SO I had to change the MX record manually on my ispcp for that domain.
01-04-2010 08:04 PM
Find all posts by this user Quote this message in a reply
motokochan Offline
Member
***

Posts: 274
Joined: Jul 2008
Reputation: 1
Post: #7
RE: Relay single Domain to relayhost?
Unless you are doing something special with that domain, the MX should point to the most direct server to deliver to. By allowing relay to any address on that domain, you enable spam to any possible address, try to deliver to the actual mail server, then have to handle bounces - causing backscatter.

If you still want to act as MX, you should maintain a list of all valid addresses, and make sure they are in the mail map so you reject invalid addresses at the submission stage.
01-05-2010 05:34 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)