?
Solved

how to block port 25 by domain name

Posted on 2003-12-07
5
Medium Priority
?
408 Views
Last Modified: 2011-09-20
I have several domain name and sub domain name that is tie to 1 public address. As such anyone can just telnet to one of these domain name or sub domain name by port 25. I would like to restrict telnet to some of these sub domain name by port 25 and block the rest of the domain name. Any idea how to go about setting it up?
0
Comment
Question by:ghgan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 9891749
Port 25 is the SMTP port, so you want to protect your mail server.

Let me see if I understand your question correctly: You have one machine that is accessible under different domain names, and you want to make sure that only some of these domain names can be used to access port 25 on your server.

Unfortunately when your server accepts a connection to port 25, it does not know which domain name was used to get the address. So it's not possible to restrict access by the domain name that was used. Anybody could just circumvent any solution by connecting directly to the IP address, without using the name at all (e.g. by doing a "telnet xx.xx.xx.xx 25").

What you should do is configure your mail server so that it only allows connections from certain source machines. How this is done however depends on the mail server you are using. For postfix you would do this using the $mynetworks and $relay_domains settings.

If you need to connect to this port from all of the Internet, you need to implement an authentication mechanism that allows only users who do have the right credentials to connect. Check the documentation of your mail server program for details about how to do that.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 9904768
> Unfortunately when your server accepts a connection to port 25, it does not know which domain name was used to get the address.
(khkremer, no insult, I just used this reply 'cause it seems to explain the questioner's thoughts:)

Disagree to that 'cause the program (a MTY usually) exactly knows to which domain it belongs, even if it is listenging/accepting data (mail) for sevaral domains.
So it's the responibility of this program to check the domain (as khkremer described).
If there should be no connection allowed, simply kill the listening program.
0
 

Author Comment

by:ghgan
ID: 9908981
oic, anyway the reason for my question is because I am trying to separate my email user into 2 groups they are as follows:

Group 1: have access to pop3, smtp and webmail
Group 2: have access to webmail only

I have installed smtpauth, sendmail, ipop, imap and squirrelmail on redhat linux 9.
0
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 200 total points
ID: 9909053
THen your best bet is to use user authentication. If a certain user does not have access to pop3 and smtp, the only access possible is via web mail.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 9911017
if the webmail/po3/etc. users have to use another domain than the webmail-only users, then simply start the approriate processes on each domain.
webmail should already have some kind of authentification (as khkremer explained)
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month8 days, 19 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question