Current time: 12-24-2024, 12:09 PM Hello There, Guest! (LoginRegister)


Post Reply 
Website local, mailserver external
Author Message
rbtux Offline
Moderator
*****
Moderators

Posts: 1,847
Joined: Feb 2007
Reputation: 33
Post: #11
RE: Website local, mailserver external
you can do that on you own.

you must do the following steps:

1. add the domain to relay_domains
2. add a transport in form of domain.tld relay:[ipoftheremoteserver]
3. add a list with valid recipients to the relay_recipient_maps.

thats how we do spam checking for exchange servers (without ispcp)
09-07-2007 09:51 PM
Visit this user's website Find all posts by this user Quote this message in a reply
hendry Offline
Junior Member
*

Posts: 77
Joined: Jul 2007
Reputation: 0
Post: #12
RE: Website local, mailserver external
rbtux Wrote:you can do that on you own.

you must do the following steps:

1. add the domain to relay_domains
2. add a transport in form of domain.tld relay:[ipoftheremoteserver]
3. add a list with valid recipients to the relay_recipient_maps.

thats how we do spam checking for exchange servers (without ispcp)
First step I already tried. There is no relay_domains in the Postfix config when freshly installed. When adding it manually the Postfixserver doesn't accept mail at all. I'm sure there must be a way to solve this, but I do not know how. Can it be because something is missing? Is there a way you past a example main.cf in here?
09-09-2007 05:34 PM
Visit this user's website Find all posts by this user Quote this message in a reply
rbtux Offline
Moderator
*****
Moderators

Posts: 1,847
Joined: Feb 2007
Reputation: 33
Post: #13
RE: Website local, mailserver external
main.cf
Quote:transport_maps = hash:/etc/postfix/transport_map.hash
relay_domains = hash:/etc/postfix/relay_domains.hash
relay_recipient_maps = hash:/etc/postfix/relay_recipient_maps.hash
/etc/postfix/transport_map.hash
Quote:domaintorelay.tld relay:[ipofservertorelayto]
/etc/postfix/relay_domains.hash
Quote:domaintorelay.tld OK
/etc/postfix/relay_recipient_maps.hash
Quote:user1@domaintorelay.tld OK
user2@domaintorelay.tld OK
user3@domaintorelay.tld OK

postmap /etc/postfix/transport_map.hash
postmap /etc/postfix/relay_domains.hash
postmap /etc/postfix/relay_recipient_maps.hash
postfix reload

you must ensure that for the other domains you want to receive mails appropriate entrys in the transportmap exists!
(This post was last modified: 09-09-2007 07:11 PM by rbtux.)
09-09-2007 07:09 PM
Visit this user's website Find all posts by this user Quote this message in a reply
hendry Offline
Junior Member
*

Posts: 77
Joined: Jul 2007
Reputation: 0
Post: #14
RE: Website local, mailserver external
I did what is standing above but receiving a message now within the webmail: Recipient address rejected: User unknown in virtual mailbox table

I entered the emailaddress in the files as stated above
09-18-2007 05:26 AM
Visit this user's website Find all posts by this user Quote this message in a reply
rbtux Offline
Moderator
*****
Moderators

Posts: 1,847
Joined: Feb 2007
Reputation: 33
Post: #15
RE: Website local, mailserver external
can you please post the output of postconf -n and transport_map
09-18-2007 05:43 AM
Visit this user's website Find all posts by this user Quote this message in a reply
rbtux Offline
Moderator
*****
Moderators

Posts: 1,847
Joined: Feb 2007
Reputation: 33
Post: #16
RE: Website local, mailserver external
the problem is the entry for the domain in virtual table...
this entrys always comes before relay...

A domain in postfix must not be in more than one of the following classes:
virtual
local
relay

I mentioned in the german corner that it would be great to have an option in ispcp to turn off the mailhandling for an entire domain...
09-25-2007 01:31 AM
Visit this user's website Find all posts by this user Quote this message in a reply
meph137 Offline
Junior Member
*

Posts: 16
Joined: Feb 2009
Reputation: 0
Post: #17
RE: Website local, mailserver external
I just wrote up my own small guide on how to od this, having come from a total postfix newbie hopefully this helps someone in my position who is faced with this rather long winded task.

Before I actually put the code in, is this sometrhing that is planned for IspCP? I've used cpanel and exim to do this before and it is SO much easier...you just remove a domain from local_domains and put it in remote_domains, this took me so long to do Sad

Also, every time I want an e-mail forwarded I'm going to have to add it to /etc/postfix/relay_recipient_maps.hash which is a huge pain!

Quote:Set the domain to have external mx by changing /var/cache/bind/domain.name.db and duplicating changes to /etc/ispcpbind/working/domain.name.db

reload bind (/etc/init.d/bind9 reload)

You need to remove the domain and any aliases first, I'd remove any mailboxes and aliases in ispcp itself, then remove the entries from the domains file manually, but you can do ti either way, here are the files to change:

/etc/postfix/ispcp/alaises (duplicate changes to /etc/ispcp/postfix/working/aliases)
/etc/postfix/ispcp/domains (duplicate changes to /etc/ispcp/postfix/working/domains)
/etc/postfix/ispcp/mailboxes (duplicate changes to /etc/ispcp/postfix/working/mailboxes)

Now to need to recreate the postfix db's we changed, using these commands:
postmap /etc/postfix/ispcp/alaises
postmap /etc/postfix/ispcp/domains
postmap /etc/postfix/ispcp/mailboxes

needed to add this to main.cf, only once:
relay_domains = hash:/etc/postfix/relay_domains.hash
relay_recipient_maps = hash:/etc/postfix/relay_recipient_maps.hash

I had to create /etc/postfix/transport_map.hash and add this content:
domain.tld relay:[othermailserver.com]

I had to create /etc/postfix/relay_domains.hash and add this content:
domain.tld OK

I had to create /etc/postfix/relay_recipient_maps.hash and add this content:
mailbox@domain.tld OK

Then run:
postmap /etc/postfix/transport_map.hash
postmap /etc/postfix/relay_domains.hash
postmap /etc/postfix/relay_recipient_maps.hash
postfix reload

check your email: mail -s "Test Email" source@domain.tld

Check your config now: less /var/log/mail.log

Well, damn! I didnt have to go thruogh all this after all, I saw http://www.isp-control.net/forum/thread-4961.html which seemed much shorter, and that is all thats needed.

I removed all my changes and put -1 on the domain to not handle email and removed the domain from /etc/postfix/domains and did postmap /etc/postfix/domains and postfix reload and all worked fine.

Still though, disabling mail should remove the line from domains Smile
(This post was last modified: 03-05-2009 12:26 AM by meph137.)
03-05-2009 12:02 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


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