LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Postfix Help - Allow only one domain (https://www.linuxquestions.org/questions/linux-server-73/postfix-help-allow-only-one-domain-559218/)

waddy 06-04-2007 11:46 PM

Postfix Help - Allow only one domain
 
Hi,

We do not need to recieve mail from anyone else, only our own domain..

I have spent sometime trying to only "allow" emails from only our domain , and block every other domain out. no luck...


Can i edit :/etc/postfix/access

# reject mail from bad_domain.com
bad_isp.com REJECT

and use a wildcard like

*.net
*.com
*.org

etc?

Please help, what is the easiest way to achieve this

acid_kewpie 06-05-2007 02:09 AM

you'd list list your domain under the mydomains variable and have nothign listed under relay_domains. you've no reason to go anywhere outside of the main.cf config file.

waddy 06-05-2007 02:20 AM

Thanks.. for the help ... is it possible for me to allow only one other domain also?

So we can Send and Recieve from:

abc.com = Me - My postfix server
lmn.com = My Brother

Basically we dont want mail from anyone else..... except each other

acid_kewpie 06-05-2007 03:03 AM

can you clarify your situation a bit more... might have got wires crossed. are you saying that you only want "from" addresses in a single domain to be accepted into a mail server of that domain? not just that you only want to receive mail TO that domain? are you not hosting this domain yourself? if so why would mail FROM that box enter it?

waddy 06-05-2007 04:01 AM

Sorry, I actually confused myself...

I only want to recieve external email from only "one" outside domain, e.g myfriendserver.com, and bounce/block all other external emails sent to me from all other domain(s).

Basically I only want to recieve external email from "myfriendserver.com", and also internal mail, and block/bounce everything else.

Thanks for the help, been on this all day and cant achieve the result.

waddy 06-05-2007 07:32 AM

Ok... I think i have worked it out, if someone can confirm..

Current
#relay_domains = $mydestination

Change to

relay_domains = myfriendserver.com

Current:
#mydomain = domain.tld

change to

mydomain = myserver.com

How to block all the other domains ??

acid_kewpie 06-05-2007 09:13 AM

ok, now i get the question (i think) and i backtrack a little, it looks like this to me...

check_sender_access type:table
Search the specified access(5) database for the MAIL FROM address, domain, parent domains, or localpart@, and execute the corresponding action.

waddy 06-05-2007 05:05 PM

Thanks again... I could not find check_sender_access in the .cf anywhere... Been googling and have found a tiny bit of info on how to use check sender but it was not very helpful..

I am guessing:

check_sender_access hash:/usr/local/etc/postfix/check_sender, permit

then in my check_sender txt file

myfriendsdomain.com OK
*.com REJECT

Is this the correct way?


All times are GMT -5. The time now is 07:47 PM.