LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 05-23-2006, 10:41 PM   #1
joseph
Member
 
Registered: Jun 2003
Location: Batam
Distribution: Ubuntu 10 And Linux Mint
Posts: 414

Rep: Reputation: 30
Telnet mymailserver.com 25


Dear All,

Anyone know how to block telneting to my mailserver over port 25??
telnet mymailserver.com 25

or

maybe they can telneting to my mail server but they won't be able to use the mail from, rcpt to, data, etc command.

i want to do this because i want to block those who tried to send email through our email server directly pretend to be our local user.

I just want my user send or receive an email through a proper way such as using mail client (thunderbird, outlook, etc) or through web using IE, firefox, etc. To me, those who tried to send email directly from server can be categorised into spammer.

Any advice??

Thanks
 
Old 05-24-2006, 02:01 AM   #2
abhi.b
LQ Newbie
 
Registered: Apr 2006
Posts: 12

Rep: Reputation: 0
Mail servers by their own provide various kind of securities.

1. You can define relay list such that only your internal network is allowed to relay mails through your mail server and any one except that even though spoofing himself as your local user wouldnot allowed to do if his IP doesnot match against the relay list.

2. Enable mechanisms like smtp auth on mail server. This is much enhanced level of security as in this case you dont even have to rely on the relay list. This can be useful in case that your mail server is been used by your genuine users from dynamic IP ( like dialup ).

You can never block connections on port 25 as this is the only way a sending server will make connection to your mail server and smtp protocol communication can be finished.

Hope that clears the query.
 
Old 05-24-2006, 02:44 AM   #3
joseph
Member
 
Registered: Jun 2003
Location: Batam
Distribution: Ubuntu 10 And Linux Mint
Posts: 414

Original Poster
Rep: Reputation: 30
Thanks abhi.b

BTW, i am using sendmail 8.13 with STARTTLS and SASLv2

But wont you think when they telneting to my mailserver through port 25 and send email to my user, the sendmail will deliver the mail coz sendmail will that the mail is originating from the server itself

Thanks
 
Old 05-24-2006, 08:18 AM   #4
abhi.b
LQ Newbie
 
Registered: Apr 2006
Posts: 12

Rep: Reputation: 0
Yes , Thats right.
If anybody telnets to your mail server on port 25 and then the recipient domain is the domain binded on your mail server then it would accept that mail.
SMTP Auth may be solution to even this problem. I suppose STARTTLS is a seperate thing and smtp auth is a seperate thing.
 
Old 05-30-2006, 05:05 AM   #5
joseph
Member
 
Registered: Jun 2003
Location: Batam
Distribution: Ubuntu 10 And Linux Mint
Posts: 414

Original Poster
Rep: Reputation: 30
sendmail + starttls + saslv2 is kind of smtp auth
 
Old 05-31-2006, 08:20 AM   #6
linuxmanju
Member
 
Registered: Sep 2003
Location: India
Distribution: Debian
Posts: 50

Rep: Reputation: 15
Telneting to port 25 doesnt mean that the users source address is changed to the local address.
for Eg:-
If your mail server's IP is AA.BB.CC.DD and a user telnets from DD.DD.DD.DD
The mail server sees the IPAddress of DD.DD.DD.DD and rejects the relay.
Make sure that the Mail server is configured to trust only localhost and authenticated users (i.e Mynetwork= 127.0.0.0/8 only) and its configured to relay only the authenticated users.

Regards
Manjunath
 
Old 05-31-2006, 09:28 AM   #7
sopiaz57
Member
 
Registered: Apr 2003
Distribution: RH 8
Posts: 246

Rep: Reputation: 30
you are confusing yourself by using the term telneting.

Telnet is a client server program which by default talks on port 23. When you invoke telnet with no port number (like 25) , it opens a raw tcp connection.

Goto wikipedia and look up telnet for better understanding.
 
Old 06-01-2006, 02:10 AM   #8
joseph
Member
 
Registered: Jun 2003
Location: Batam
Distribution: Ubuntu 10 And Linux Mint
Posts: 414

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by sopiaz57
you are confusing yourself by using the term telneting.

Telnet is a client server program which by default talks on port 23. When you invoke telnet with no port number (like 25) , it opens a raw tcp connection.

Goto wikipedia and look up telnet for better understanding.
I am not confusing myself by the term of telnet.
My problem is :

is someone wanna send email to my local user using
Code:
telnet mymailserver.com 25
then the server will accept the mail and sent it to my local user.
what i want to do is how to prevent that??

And all the responses was talking about relay.
And relay in a simple terms, is a mechanism by which mail is transferred from host to host until it reaches its ultimate destination.

but in my case, the MTA doesn't connect to other MTA.
 
Old 06-01-2006, 04:27 AM   #9
linuxmanju
Member
 
Registered: Sep 2003
Location: India
Distribution: Debian
Posts: 50

Rep: Reputation: 15
In simpler terms. You can not stop a mail server to accept telnet on port 25 for two reasons.
1) telnet to port 25 is only used to initiate the communication, Like an MUA does.
2) once after a successful telnet what you type is what the MUA speaks with the server to send mail ( like .. ehlo yourdomain.com, mail from:abc@yourdaomin.com, rcpt to:someaddress@abc.com.. etc)

In otherwords, You can not stop someone from doing so, Unless you stop your mail service. Either it will work for both telnet port 25 and MUA, Or it wont work atall for both.

Regards
Manjunath
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between Telnet and Raw Telnet?? bh5687 Linux - Newbie 1 03-30-2006 10:25 AM
Running Telnet in a script, want to save Telnet output, howtodothis??? anil3 Linux - Software 2 03-08-2006 04:01 PM
How do I setup telnet on Fedorac1 so I can telnet to it from winxp? mman49 Fedora 6 05-02-2004 12:40 PM
can not telnet localhost 25 but telnet dowell.exper.dynserv.com 25 exper Linux - Software 0 02-25-2004 05:13 AM
enable telnet but can't telnet from the computer guanyu Linux - Networking 8 08-26-2002 06:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 12:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration