Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Oct 29, 2010 10:19 am 
Offline
Senior Newbie

Joined: Wed Jun 09, 2010 12:28 pm
Posts: 12
I have a postfix smtp server with sasl authentication on Ubuntu server..
I don't want anybody to send mail without being authenticated especially from php forms. Php mail function sends mail as user www-data..
But also logwatch sends mail as root which I really need.. There are also users authenticated by sasl.. They shouldn't be blocked, too..

So, are there any way to block all linux users to send mail except root?

Thanks in advance..


Top
   
 Post subject:
PostPosted: Fri Oct 29, 2010 1:15 pm 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
Consider this: any user can open a port 25 or 587 to any mail server and deliver mail there directly. IPTABLES can't really stop that while still allowing the mail server to work, although I believe selinux network ACLs do.


Top
   
 Post subject:
PostPosted: Fri Oct 29, 2010 1:39 pm 
Offline
Senior Newbie

Joined: Wed Jun 09, 2010 12:28 pm
Posts: 12
Guspaz wrote:
Consider this: any user can open a port 25 or 587 to any mail server and deliver mail there directly. IPTABLES can't really stop that while still allowing the mail server to work, although I believe selinux network ACLs do.


Thanks for your reply.. But, I don't think to change my linux distribution.. There should be a way through postfix's configurations..


Top
   
 Post subject:
PostPosted: Mon Nov 01, 2010 10:32 am 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
Oh, there may well be, but my point is that you don't need to use postfix to send mail. I think I'm misunderstanding what you want to do, though. You're saying that you only want to let people send mail through your SMTP server if they're authenticated, and I think I was seeing "users" and thinking "linux users", which made me think "Linux users can send mail through other means".


Top
   
 Post subject:
PostPosted: Wed Nov 03, 2010 3:09 pm 
Offline
Senior Member

Joined: Fri Dec 07, 2007 1:37 am
Posts: 385
Location: NC, USA
I've never tried it, but maybe you are looking for this:

http://www.postfix.org/postconf.5.html# ... bmit_users

You might also need to adjust your handling of mynetworks to prevent local connections to smtp being treated as special.


Top
   
 Post subject:
PostPosted: Sun Nov 14, 2010 9:04 am 
Offline
Senior Newbie

Joined: Wed Apr 28, 2010 6:23 am
Posts: 10
Make /usr/sbin/sendmail to be only executable by root. Block outgoing connections to port 25 using iptables OUTPUT table and owner match module (--uid-owner). You are probably going to regret it.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group