LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 09-09-2004, 08:37 AM   #1
flp
LQ Newbie
 
Registered: Sep 2004
Posts: 3

Rep: Reputation: 0
Unhappy Sendmail + restrictive iptables = headache


Hi Folks,

After reading lots of forum posts, and lots of (confusing) articles, I am still having problems, any help would be greatly appreciated

I am running a web server, and am keeping it all locked down as much as possible with iptables. Default action for incoming packets is drop, and I've set up rules to allow SSH/Web/DNS requests etc etc. The server works fine in every respect except for trying to send email.

The trouble is, in this locked down state, sendmail won't send emails sent to it via my PHP scripts! If I change the default action for incoming packets on iptables to 'Accept' then sendmail happily sends out the emails. If iptables incoming default is set back to 'drop', then the emails just sit in the queue with this error:

'Deferred: Connection timed out with <nameofmailserver>'

Now I understand WHY this is happening I think because I had a similar problem with DNS requests. DNS lookups wouldn't work until I allowed port 53, TCP and UDP.

So I guess the real question is... what ports do I need to allow to get this box sending mails? I may want to use it as a relay in future, but for now I just want sendmail to... umm.... send!

Any help would be great, many thanks! Sorry for the long story
 
Old 09-09-2004, 09:02 AM   #2
dominant
Member
 
Registered: Jan 2004
Posts: 409

Rep: Reputation: 30
You have to allow incoming TCP packets on 25 (SMTP) port
 
Old 09-09-2004, 09:09 AM   #3
flp
LQ Newbie
 
Registered: Sep 2004
Posts: 3

Original Poster
Rep: Reputation: 0
Doh! Thankyouthankyouthankyou!

I *THOUGHT* I tried this before, but I must have have set the rule for source, not destination!

One more thing though, I haven't done anything to the sendmail configuration, I'm not open for spammers to abuse me am I? What can I do to check?

Apologies for my lack of knowledge - I just program usually.
 
Old 09-09-2004, 09:36 AM   #4
dominant
Member
 
Registered: Jan 2004
Posts: 409

Rep: Reputation: 30
I haven't configure my sendmail either.
It's quite complicate because you have to use the m4 processor, etc.

I use the default configuration and it works
For spam use SpamAssassin
 
Old 09-09-2004, 04:33 PM   #5
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Here's some helpful info on making sure that Sendmail is not configured as an open relay. You should also checkout www.sendmail.org as it has a lot more documentation.
 
Old 09-09-2004, 06:35 PM   #6
flp
LQ Newbie
 
Registered: Sep 2004
Posts: 3

Original Poster
Rep: Reputation: 0
That's great, thanks for all the help. Think I'll stick around and see if I can be of use
 
  


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
iptables made me headache .... HELP! mas_giong Linux - Networking 1 12-17-2004 11:05 PM
LimeWire P2P and ipTables (Restrictive Firewall) win32sux Linux - Networking 1 10-09-2004 03:31 PM
my sendmail/mailman headache htm Linux - Networking 4 05-13-2004 07:23 AM
headache with iptables ! Baran Linux - Newbie 1 10-02-2003 08:22 AM
Sendmail /etc/mail/virtusertable headache! katana Solaris / OpenSolaris 4 12-29-2002 12:21 AM

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

All times are GMT -5. The time now is 05:03 PM.

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