LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-29-2003, 02:20 AM   #1
theparadigm
Member
 
Registered: Nov 2003
Location: Australia :)
Posts: 36

Rep: Reputation: 15
Arrow Courier MTA as OpenRelay. HELP!


I've been trying to setup Courier MTA (www.courier-mta.org) to handle mail for a few domains of mine, but have run into problems.

Courier acts as an open relay out-of-the-box.

This is what I did:
1. Downloaded the packages :-
courier-0.44.0.tar.bz2
courier-imap-2.2.0.tar.bz2
2. Built them as RPMs under a redhat 9 system:
rpmbuild -ta courier-0.44.0.tar.bz2
rpmbuild -ta courier-imap-2.2.0.tar.bz2
3. Removed the existing sendmail package from the mailserver that comes with redhat:
rpm -e sendmail
(note: i don't know if this makes a difference, but the sendmail package was setup, in the conf, with the accept_unresolvable_domains option on)
4. Installed selected courier RPM packages:
rpm -Uvh courier-0.44.0-1.i386.rpm courier-imapd-0.44.0-1.i386.rpm courier-maildrop-0.44.0-1.i386.rpm courier-maildrop-wrapper-0.44.0-1.i386.rpm courier-smtpauth-0.44.0-1.i386.rpm courier-webadmin-0.44.0-1.i386.rpm
5. I start courier with "service courier start"

Without doing anything else, courier comes up and starts listening on port 25.
Doing a check on this port from free mail relay test sites (such as http://www.abuse.net/relay.html), courier relays all traffic.

Couriers relay configuration (in /etc/courier/smtpaccess/default) shows:
127.0.0.1 allow,RELAYCLIENT
10 allow,RELAYCLIENT
192.168 allow,RELAYCLIENT

Even though couriers configuration only specifies relays for local addresses, it still accepts and relays everything. (unless it is using some other configuration not in the couriers conf directory - does anyone know about this?!!)

The only other thing I think I havn't mentioned is the mail server is internal on the network. A router masquerades all connections to port 25 internally to the mailserver and back.
I do wonder whether courier, from the masquerading router, sees the connection 'coming' from the router (but that doesn't make sense).

Can someone please help!!!!!!
David

Last edited by theparadigm; 11-29-2003 at 02:32 AM.
 
Old 11-29-2003, 12:08 PM   #2
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
Check your mail log to see what the IP address of the incoming connections is logged as. A NAT (ip masq) router should not be making the packets appear to be coming from an internal address, but it's possible that it is happening. In any case, checking your logs will report what the MTA thinks the IP is.
 
Old 11-30-2003, 10:05 AM   #3
theparadigm
Member
 
Registered: Nov 2003
Location: Australia :)
Posts: 36

Original Poster
Rep: Reputation: 15
that's the problem!!
the source address is coming up as the routers internal address (don't ask me how i didn't notice it before)..
though my question is now how do i fix it???!??

I've done a test with apache and it also reports the remote address incorrectly [as coming from the router].

Are there any kernel options I need to use to correct the NAT source address?
I'm using redhat fedora core on the router with iptables rules:
IPTABLES -t nat -A PREROUTING -d {externalip} -p tcp -m tcp --dport 25 -j DNAT --to-destination {internalip}
IPTABLES -t nat -A POSTROUTING -o {interface} -j MASQUERADE

I tried playing around with some of the kernel options and added/removed modules but got nowhere.:s
P.S: thanks chort on that last reply
 
Old 11-30-2003, 10:55 AM   #4
theparadigm
Member
 
Registered: Nov 2003
Location: Australia :)
Posts: 36

Original Poster
Rep: Reputation: 15
ok well figured out my problem

double checking through my rules, i found i also had the line:
IPTABLES -t nat -A POSTROUTING -o {internalinterface} -j MASQUERADE

explains why the source address was the router for all NAT traffic
(also explains some other things
 
  


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
posfix with courier maildrop and courier-imap Anuragn Linux - Enterprise 4 01-17-2007 04:33 AM
Good online Courier-MTA setup guide? neocookie Linux - General 0 08-18-2005 11:20 AM
Configuring courier-imap courier-pop redsky Linux - Software 0 06-01-2004 12:06 PM
courier-mta installation nightwalker1945 Linux - Enterprise 1 05-03-2004 12:09 PM
Using maildrop with Courier MTA LiquidKernel Linux - Software 3 08-05-2003 02:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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