Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

how to block port 25 by domain name

Posted on 2003-12-07
5
Medium Priority
?
409 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month10 days, 14 hours left to enroll

618 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