Current time: 11-23-2024, 09:10 AM Hello There, Guest! (LoginRegister)


Post Reply 
disable mail handling for one or more domains
Author Message
motin Offline
Newbie
*

Posts: 8
Joined: Sep 2007
Reputation: 0
Post: #1
RE: disable mail handling for one or more domains
joximu Wrote:manually: edit /etc/postfix/ispcp/domains - make a copy to /etc/ispcp/postfix/working and run "postmap domains"

Having the same problem, and tried to follow these instructions but what do they really mean?

Edit /etc/postfix/ispcp/domains - is that removing the lines for the domains that has mailservers elsewhere - or changing "vdmn_entry" to something else?

Also, postmap domains won't work unless you have such a file in the current directory, so I guess you mean postmap /etc/ispcp/postfix/working/domains ?

I put a bracket in front of the line where my mailoutsourced domain was, then copied the file over and ran postmap /etc/ispcp/postfix/working/domains but it still won't work.

I get these messages in syslog (replaced my domain with mydomain.net...):
Sep 4 23:47:20 ubuntu103 postfix/virtual[700]: 14959BD08A6: to=<test@mydomain.net>, relay=virtual, delay=0, status=bounced (unknown user: "test@mydomain.net")

Anybody can shine a light on this matter?
09-05-2007 07:55 AM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #2
RE: disable mail handling for one or more domains
motin Wrote:
joximu Wrote:manually: edit /etc/postfix/ispcp/domains - make a copy to /etc/ispcp/postfix/working and run "postmap domains"

Having the same problem, and tried to follow these instructions but what do they really mean?

Edit /etc/postfix/ispcp/domains - is that removing the lines for the domains that has mailservers elsewhere - or changing "vdmn_entry" to something else?

deactivate the whole line. (see documentation of postfix - it's free...)

motin Wrote:Also, postmap domains won't work unless you have such a file in the current directory, so I guess you mean postmap /etc/ispcp/postfix/working/domains ?

nope, I mean the same file you just edited one stpe before:
/etc/postfix/ispcp/domains

motin Wrote:I put a bracket in front of the line where my mailoutsourced domain was, then copied the file over and ran postmap /etc/ispcp/postfix/working/domains but it still won't work.

in /etc/ispcp/.../working there are copies of the current configuration.
It's often needed that you copy the self modified files also to this place. Otherwise ispCP might overwrite your changes.

motin Wrote:I get these messages in syslog (replaced my domain with mydomain.net...):
Sep 4 23:47:20 ubuntu103 postfix/virtual[700]: 14959BD08A6: to=<test@mydomain.net>, relay=virtual, delay=0, status=bounced (unknown user: "test@mydomain.net")

Anybody can shine a light on this matter?

"relay=virtual" means: postfix found the domain to be a local virtual domain and want's to handle the mail in this way...

Hope you got a glimpse of light :-)

Cheers
Joximu
09-05-2007 09:20 AM
Visit this user's website Find all posts by this user Quote this message in a reply
motin Offline
Newbie
*

Posts: 8
Joined: Sep 2007
Reputation: 0
Post: #3
RE: disable mail handling for one or more domains
Hey thanks for replying so quickly!

I had time to do some research before you replied, and with your answers everything is coming together.

joximu Wrote:deactivate the whole line. (see documentation of postfix - it's free...)

I searched for "domains" in man postfix and instead wanted to try my luck on the forums before reading postfix's fm. Was especially non-motivated to read it since the whole issue here is how to avoid using postfix on the server...

Btw that was what I did. When I wrote "bracket" - I meant one of them squares / woodpile / whateverthenameisinenglish characters: #

joximu Wrote:nope, I mean the same file you just edited one stpe before:
/etc/postfix/ispcp/domains

in /etc/ispcp/.../working there are copies of the current configuration.
It's often needed that you copy the self modified files also to this place. Otherwise ispCP might overwrite your changes.

Yeah, I now understand that this update the database file, and running in the other directory will not update the database file that is in current use. "Auto-reply: Exactly"

joximu Wrote:"relay=virtual" means: postfix found the domain to be a local virtual domain and want's to handle the mail in this way...

Hope you got a glimpse of light :-)

Cheers
Joximu

Yeah I sure did! Thanks.

Now I get some errors that are more understandable to a non-postfix-user:

Sep 5 01:23:57 ubuntu103 postfix/smtp[1458]: C981CBD08A7: to=<test@mydomain.net>, relay=none, delay=0, status=deferred (Host or domain name not found. Name service error for name=mydomain.net type=MX: Host not found, try again)

Got some forum threads to support me on this one:
http://www.isp-control.net/forum/custom-...ml#pid2532
http://www.isp-control.net/forum/how-to-...ml#pid4845
http://www.isp-control.net/forum/remove-...ml#pid4872

So I'll be allright.

In case you have any more light to shed on the DNS matter that would prevent me from doing something I'd regret, you are very welcome to shed it too of course.

Cheers!
09-05-2007 09:42 AM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #4
RE: disable mail handling for one or more domains
motin Wrote:Hey thanks for replying so quickly!

I had time to do some research before you replied, and with your answers everything is coming together.

joximu Wrote:deactivate the whole line. (see documentation of postfix - it's free...)

I searched for "domains" in man postfix

Well, the filename is not fixed - here's the reference... (main.cf)
virtual_mailbox_domains = hash:/etc/postfix/ispcp/domains

motin Wrote:and instead wanted to try my luck on the forums before reading postfix's fm. Was especially non-motivated to read it since the whole issue here is how to avoid using postfix on the server...

Btw that was what I did. When I wrote "bracket" - I meant one of them squares / woodpile / whateverthenameisinenglish characters: #

Gartenhag, Rautenzeichen, Number Sign (http://en.wikipedia.org/wiki/Number_sign) :-)

motin Wrote:
joximu Wrote:nope, I mean the same file you just edited one stpe before:
/etc/postfix/ispcp/domains

in /etc/ispcp/.../working there are copies of the current configuration.
It's often needed that you copy the self modified files also to this place. Otherwise ispCP might overwrite your changes.

Yeah, I now understand that this update the database file, and running in the other directory will not update the database file that is in current use. "Auto-reply: Exactly"

joximu Wrote:"relay=virtual" means: postfix found the domain to be a local virtual domain and want's to handle the mail in this way...

Hope you got a glimpse of light :-)

Cheers
Joximu

Yeah I sure did! Thanks.

Now I get some errors that are more understandable to a non-postfix-user:

Sep 5 01:23:57 ubuntu103 postfix/smtp[1458]: C981CBD08A7: to=<test@mydomain.net>, relay=none, delay=0, status=deferred (Host or domain name not found. Name service error for name=mydomain.net type=MX: Host not found, try again)

Got some forum threads to support me on this one:
http://www.isp-control.net/forum/custom-...ml#pid2532
http://www.isp-control.net/forum/how-to-...ml#pid4845
http://www.isp-control.net/forum/remove-...ml#pid4872

So I'll be allright.

In case you have any more light to shed on the DNS matter that would prevent me from doing something I'd regret, you are very welcome to shed it too of course.

Cheers!

Ah - now it's important, that the DNS knows where the mails (to mydomain.net) have to be send to...

So, you'll need to set this in the zone files.
Normally in debian etch they are in /var/cache/bind/(*.db) - with a copy in /etc/ispcp/bind/working - you already learned about that :-)

the MX line in the zone files should be changed:
either you set the new hostname (with a point at the end) or the right ip number there - or you leave mail.domain.. and give the new ip address in the line where mail is defined...

orig, some lines:
IN MX 10 mail.domain.net.
mail IN A 123.45.67.89
www IN A 123.45.67.89

variant 1:
IN MX 10 mail.newserver.net.
mail IN A 123.45.67.89
www IN A 123.45.67.89

variant 2:
IN MX 10 mail.domain.net.
mail IN A new.ip.of.mx
www IN A 123.45.67.89

or similar...

there is an excellent book from oreilly about bind and dns :-)))

Cheers, J.
(This post was last modified: 09-05-2007 10:05 AM by joximu.)
09-05-2007 10:05 AM
Visit this user's website Find all posts by this user Quote this message in a reply
motin Offline
Newbie
*

Posts: 8
Joined: Sep 2007
Reputation: 0
Post: #5
RE: disable mail handling for one or more domains
joximu Wrote:Well, the filename is not fixed - here's the reference... (main.cf)
virtual_mailbox_domains = hash:/etc/postfix/ispcp/domains

Aha. Shine a little light on me. Forever and ever, i tell you my... Cool

joximu Wrote:Ah - now it's important, that the DNS knows where the mails (to mydomain.net) have to be send to...

So, you'll need to set this in the zone files.
Normally in debian etch they are in /var/cache/bind/(*.db) - with a copy in /etc/ispcp/bind/working - you already learned about that :-)

the MX line in the zone files should be changed:
either you set the new hostname (with a point at the end) or the right ip number there - or you leave mail.domain.. and give the new ip address in the line where mail is defined...

orig, some lines:
IN MX 10 mail.domain.net.
mail IN A 123.45.67.89
www IN A 123.45.67.89

variant 1:
IN MX 10 mail.newserver.net.
mail IN A 123.45.67.89
www IN A 123.45.67.89

variant 2:
IN MX 10 mail.domain.net.
mail IN A new.ip.of.mx
www IN A 123.45.67.89

or similar...

there is an excellent book from oreilly about bind and dns :-)))

Cheers, J.

Actually, I tried these and a third and a fourth variant to no avail even before I read your reply. Problem is, that however I do this (and regardless of how many times I am restarting/reloading bind9), I get no updated replies from dig... (I got no ANSWER section). There is no DNS cache to flush like on windows and I can only suspect TTL settings interfering here but is that normal? I'll wait 86400 seconds and check dig again... Then I can start to think about paperbacks.

Btw the 3rd variant I tried (and which is still active) was:

Code:
IN      MX      10 mail.mydomain.net.
mail            CNAME   mail.mailserver.com.
www             CNAME   mydomain.net.

...as this is how my external "real" dns is setup - querying mail.mydomain.net gives me a CNAME to mail.mailserver.com.

And btw my mail.mailserver.com resolves to my external mail server IP fine.

Thanks again for watching! Smile
09-05-2007 11:07 AM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #6
RE: disable mail handling for one or more domains
motin Wrote:
joximu Wrote:Ah - now it's important, that the DNS knows where the mails (to mydomain.net) have to be send to...

So, you'll need to set this in the zone files.
Normally in debian etch they are in /var/cache/bind/(*.db) - with a copy in /etc/ispcp/bind/working - you already learned about that :-)

the MX line in the zone files should be changed:
either you set the new hostname (with a point at the end) or the right ip number there - or you leave mail.domain.. and give the new ip address in the line where mail is defined...

orig, some lines:
IN MX 10 mail.domain.net.
mail IN A 123.45.67.89
www IN A 123.45.67.89

variant 1:
IN MX 10 mail.newserver.net.
mail IN A 123.45.67.89
www IN A 123.45.67.89

variant 2:
IN MX 10 mail.domain.net.
mail IN A new.ip.of.mx
www IN A 123.45.67.89

or similar...

there is an excellent book from oreilly about bind and dns :-)))

Cheers, J.

Actually, I tried these and a third and a fourth variant to no avail even before I read your reply. Problem is, that however I do this (and regardless of how many times I am restarting/reloading bind9), I get no updated replies from dig... (I got no ANSWER section). There is no DNS cache to flush like on windows and I can only suspect TTL settings interfering here but is that normal? I'll wait 86400 seconds and check dig again... Then I can start to think about paperbacks.

Btw the 3rd variant I tried (and which is still active) was:

Code:
IN      MX      10 mail.mydomain.net.
mail            CNAME   mail.mailserver.com.
www             CNAME   mydomain.net.

...as this is how my external "real" dns is setup - querying mail.mydomain.net gives me a CNAME to mail.mailserver.com.

And btw my mail.mailserver.com resolves to my external mail server IP fine.

Thanks again for watching! Smile

Very important - forgot to tell you:
you have to increment the serial number in the zone file...
its called timestamp in the comment...
most of times it's the date and a 2 letter number:
2007090200
changes on thesame day:
2007090201
2007090202
on the next day
2007090300

I'm sure you got the trick...

Have a good day!
Joximu
09-05-2007 05:57 PM
Visit this user's website Find all posts by this user Quote this message in a reply
motin Offline
Newbie
*

Posts: 8
Joined: Sep 2007
Reputation: 0
Post: #7
RE: disable mail handling for one or more domains
Thanks, but I ran into several other problems when trying to configure bind. They are now solved.

I had chrooted bind into /var/lib/named/ but the configuration files were put in /var/cache/bind/ instead of the chrooted location.

To sum my trial and errors experience up, this is what was needed:
Code:
chown bind /var/cache/bind/*
cp /var/cache/bind /var/lib/named/var/cache/ -r
rm /var/cache/bind/ -r
ln -s /var/lib/named/var/cache/bind/ /var/cache/
chown bind /etc/ispcp/bind/working/* # I guess...

Some error messages from /var/log/syslog I encountered on the way (to help googlers):
Code:
# originally:
Sep  5 22:12:50 ubuntu103 named[32479]: zone mydomain.net/IN: loading master file /var/cache/bind/mydomain.net.db: file not found
# this was when I symlinked the wrong way (out from chroot jail which is forbidden):
Sep  5 22:38:45 ubuntu103 named[515]: zone mydomain.net/IN: loading master file /var/cache/bind/mydomain.net.db: invalid file
# ...it should look like:
Sep  5 22:48:09 ubuntu103 named[645]: zone mydomain.net/IN: loaded serial 2007090500

Now the mails are delivered through my external mail server.

Thanks for all the bright guidance, joximu!
09-06-2007 07:03 AM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #8
RE: disable mail handling for one or more domains
motin Wrote:Thanks, but I ran into several other problems when trying to configure bind. They are now solved.

I had chrooted bind into /var/lib/named/ but the configuration files were put in /var/cache/bind/ instead of the chrooted location.

/var/lib/named is like in openSuSE, but Debian has /var/cache/bind (I also had to learn this :-).
But you can configure ispcp to put the files elsewhere...
/etc/ispcp/ispcp.conf - I made an extra file for the ispcp-domains and then "included" in named.conf - a named reload copied the file into the chroot... (in openSuSE)

motin Wrote:To sum my trial and errors experience up, this is what was needed:
Code:
chown bind /var/cache/bind/*
cp /var/cache/bind /var/lib/named/var/cache/ -r
rm /var/cache/bind/ -r
ln -s /var/lib/named/var/cache/bind/ /var/cache/
chown bind /etc/ispcp/bind/working/* # I guess...

Last line, hm...
ispcp itself writes the "working" files... so there is no need for seetting to user "bind"...

motin Wrote:Some error messages from /var/log/syslog I encountered on the way (to help googlers):
Code:
# originally:
Sep  5 22:12:50 ubuntu103 named[32479]: zone mydomain.net/IN: loading master file /var/cache/bind/mydomain.net.db: file not found
# this was when I symlinked the wrong way (out from chroot jail which is forbidden):
Sep  5 22:38:45 ubuntu103 named[515]: zone mydomain.net/IN: loading master file /var/cache/bind/mydomain.net.db: invalid file
# ...it should look like:
Sep  5 22:48:09 ubuntu103 named[645]: zone mydomain.net/IN: loaded serial 2007090500

Now the mails are delivered through my external mail server.

Thanks for all the bright guidance, joximu!

Your welcome :-)
thanx for the reputation <g>
(This post was last modified: 09-06-2007 04:41 PM by joximu.)
09-06-2007 04:40 PM
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)