LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-13-2006, 03:05 AM   #1
cbekannan06
LQ Newbie
 
Registered: Mar 2006
Posts: 7

Rep: Reputation: 0
Post Postfix intranet mail server


Hi All..

I have redhat 9 with postfix server installed in it, it is used for intranet mailing purpose, when I send mail to outside world i.e internet mail adress, it is going out from postfix server, I would like restict this option and mail shoul not go out of my lan, the server is not connected to the internet, I have removed default gateway and DNS information from the network configuration, I'm totally confused how these mails are going out without connecting to the internet.

Could anyone please let me know why this problem arise or give me a solution to restrict it.

Regards

Kannan B
 
Old 03-13-2006, 08:10 AM   #2
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
What is the network configuration of your machine? 1 NICs or 2?
What does ifconfig report back?
Can you give more details on your network setup? ie other servers, firewalls or routers, ...

Removing the default gateway may have an impact.
Changing or removing your own personal DNS server however probably has little effect, as this will only make the machine contact the root DNS nameservers instead of yours. How else can people at home surf, knowing they don't have their own DNS machine around?

The cleanest solution is to configure postfix to never relay any messages to outside world, rather than changing your network config.
 
Old 03-14-2006, 10:28 PM   #3
cbekannan06
LQ Newbie
 
Registered: Mar 2006
Posts: 7

Original Poster
Rep: Reputation: 0
many thanks for you reply, I've been using only one NIC configured for private ip without gateway and DNS entries, if you could explain me for restricting mails to the outside world in the postfix itself it would be great help.

Regards

Kannan B
 
Old 03-15-2006, 02:14 AM   #4
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Why would you want to restrict that? Don't you want to allow people to send out mails to whomever they like?

You could say something like "I want all mails to be sent out from 1 central mail server, instead of from all separate machines" (ie using a relay), but that's something different than what you're asking right now.

Code:
man 5 transport
or
editing /etc/postfix/transport
will show you what you can do to make special transport arrangements like the ones you're requesting.

The first example in the man page shows how you can configure something similar:
my.domain :
.my.domain :
* smtp:my-relay.my.domain
Putting this information in /etc/postfix/transport (the transport rules for postfix), will make it
send any mails from my.domain (first line) or any subdomain of my.domain (second line) without making any
alterations to the transport method or to the "next hop" (ie the next computer that will receive the mail and may deliver it or send it over to yet another computer/hop).

The 3rd line in the example will make any mails that aren't originating from "my.domain" (or any subdomain), as matched by the first 2 lines, be sent via SMTP to the machine called "my-relay.my.domain", which is supposed to relay the mail to the outside world.

If instead, you don't want to send out any mails to the outside world, you need to make the following changes to the example:
-in the first 2 lines, change "my.domain" to your domain;
-in the third line, choose a different transport service. Transport services are defined in /etc/postfix/master.cf. To bounce the external mails (ie send error messages like "mail delivery failed" back to whomever created the mail and/or to the postmaster), use "bounce:" (ie transport service = bounce,
nexthop = null/unaltered - when bouncing mails, the nexthop is probably disregarded anyway).
Other transport services, like "defer" (keep mail in queue and try again later - will keep the external mails in the queue until they expire), "flush", "relay", ... may work for you as well.
It depends really on what you want to do for the external mails that are created by your users.

Last edited by timmeke; 03-15-2006 at 02:16 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux as Intranet and Mail Server: How? glentium Linux - Networking 2 10-11-2005 06:02 AM
Intranet mail delivery with linux server? PAB Linux - Software 5 04-27-2005 04:38 PM
The best Intranet Mail Server !! hitesh_linux Linux - Networking 8 01-02-2005 09:30 AM
Postfix mail server not accepting incoming mail from the external interface rexmundi Linux - Networking 7 12-22-2003 03:41 PM
RedHat 7.1 linux intranet mail server keshava Linux - Networking 1 01-21-2002 04:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration