Solved

how to block port 25 by domain name

Posted on 2003-12-07
5
405 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
  • 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 50 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

840 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