LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 03-11-2008, 10:04 AM   #1
ajatiti
Member
 
Registered: Jun 2007
Posts: 45

Rep: Reputation: 15
Sending email without port 25


Hi,

I have a linux server (RHEL4). I have configured to mail the output of a script to my inbox (Outlook).
I configured sendmail that opens port 25 and it works fine.

Now, how can I make this possible without opening port 25?

The server is not in the domain it is in localhost.localdomain.

But the SMTP server that I am using is in another windows domain.

Could please someone help me in acheving this?
Appreciate all your help.

Thanks,
Aj
 
Old 03-13-2008, 04:48 PM   #2
ajatiti
Member
 
Registered: Jun 2007
Posts: 45

Original Poster
Rep: Reputation: 15
Is there any way to put the smtp server address in teh script itself so that I can send email without starting sendmail.

Else is this possible: Starting sendmail but not the port 25.
If I start sendmail "nmap -O locahost" command should not show port 25 listed.

Thanks!
 
Old 03-13-2008, 05:10 PM   #3
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I don't know sendmail, but certainly in postfix you can over-ride the smtp port. I woudl assume you can in sendmail.

Have you looked into the mail command? I don't know if you can specify a port for that, but it doesn't need sendmail as far as I know.
 
Old 03-14-2008, 02:08 PM   #4
ajatiti
Member
 
Registered: Jun 2007
Posts: 45

Original Poster
Rep: Reputation: 15
Since the machine is a localhost and teh smtp server is in another domain. To give the smtp server address, I need to use sendmail ..right?

I dont understand why does it open a listening port while I want it only to send the mails.

Yeah..I am using Mail command in my script.
Mail -s "Subject" aj@anotherdomain.com

Thx
Aj
 
Old 03-14-2008, 03:17 PM   #5
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Then I don't think you need sendmail running to use mail (try it)
 
Old 03-14-2008, 09:20 PM   #6
frndrfoe
Member
 
Registered: Jan 2008
Distribution: RHEL, CentOS, Ubuntu
Posts: 379

Rep: Reputation: 38
If you have a line like this in your /etc/mail/sendmail.mc file then sendmail will only accept mail from the localhost.
Code:
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
You can shut down the port using the firewall.
 
Old 03-16-2008, 04:20 PM   #7
ajatiti
Member
 
Registered: Jun 2007
Posts: 45

Original Poster
Rep: Reputation: 15
Thanks for your replies,

I stopped sendmail and then tried sending mail. It doesn't.

Also when I use iptables to reject the dport 25 it doesnt send mails.
I am using this iptables command:
iptables -A INPUT -p tcp -m tcp --dport 25 -j REJECT

Is this the correct command?

Also I have added nameserver in the /etc/resolv.conf, still don't work.

Thanks,
Aj
 
Old 03-17-2008, 06:30 AM   #8
livetoday
Member
 
Registered: Jun 2006
Location: India
Distribution: RHEL,Suse,Fedora
Posts: 106

Rep: Reputation: 15
I think, Iptables will only reject the connection attempt made on port 25, but it won't close the port and port should be open even if you want only to send email. However, you may open the port on another inteface if you don't want it on localhost.

Quote:
Originally Posted by ajatiti View Post
Thanks for your replies,

I stopped sendmail and then tried sending mail. It doesn't.

Also when I use iptables to reject the dport 25 it doesnt send mails.
I am using this iptables command:
iptables -A INPUT -p tcp -m tcp --dport 25 -j REJECT

Is this the correct command?

Also I have added nameserver in the /etc/resolv.conf, still don't work.

Thanks,
Aj
 
Old 03-19-2008, 05:25 PM   #9
ajatiti
Member
 
Registered: Jun 2007
Posts: 45

Original Poster
Rep: Reputation: 15
ok..Instead of using sendmail. If I update the DNS resolver will it work.
Will it be able to resolve my email id on another domain instead of specifying the SMTP address?
 
  


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
sending email cambie Linux - Software 1 11-20-2004 06:02 PM
sending email to an ip pyu7 Linux - Software 4 10-08-2004 02:46 PM
Sending email on port 25 and 26 xerophyte Linux - Software 1 01-13-2004 01:58 AM
sending email csDraco_ Slackware 5 08-22-2003 05:50 PM
sending an email to a email address after a perl operation meluser Programming 9 04-07-2003 01:26 PM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 06:03 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