Solved

how to block port 25 by domain name

Posted on 2003-12-07
5
403 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
Comment Utility
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
Comment Utility
> 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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,…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.:

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now