Solved

how to block port 25 by domain name

Posted on 2003-12-07
5
404 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
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 how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

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