LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-20-2012, 01:00 PM   #1
rothgar
LQ Newbie
 
Registered: Sep 2012
Posts: 2

Rep: Reputation: Disabled
Postfix restrict senders based on what VLAN they are on


My postfix server is up and running great but I want to be able to restrict what senders can send to external recipients based on what VLAN the user is connecting from.
I already found the documentation to restrict users based on the senders address http://www.postfix.org/RESTRICTION_C....html#external and I tried putting in a network rather than a sender in the restricted senders file (eg 192.168.0.0/24) but it appears to restrict internal and external email with that. Here is my main.cf file, local_domains, and restricted_senders.
Can someone tell me if this is even possible to restrict based on VLAN instead of based on senders address.
Code:
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
myhostname = postfix-test.example.com
myorigin = example.com
inet_interfaces = all
mydestination =
local_transport = error:Local delivery is unavailable
unknown_local_recipient_reject_code = 550
mynetworks = $config_directory/mynetworks
relay_domains = example.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
 
  
debug_peer_level = 2
debugger_command =
	 PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
	 xxgdb $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.3.3/samples
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
smtpd_recipient_restrictions = 
	check_sender_access hash:/etc/postfix/restricted_senders
	permit_mynetworks
	reject
smtpd_restriction_classes = local_only
	
local_only = 
	check_recipient_access hash:/etc/postfix/local_domains
	reject
smtpd_peername_lookup = no
message_size_limit = 26214400
smtpd_delay_reject = yes
restricted_senders file
Code:
10.200.0.0/18 local_only
local_domains
Code:
example.com OK
I also have a mynetworks file (you can see it referenced in the main.cf) which contains all the VLANS that are allowed to send through the postfix server including the one restricted network (10.200.0.0/18). I then compiled the db files with postmap restricted_senders and postmap local_domains.

Does postfix have the ability to restrict based on network rather than sender email?

Last edited by rothgar; 09-21-2012 at 09:46 AM.
 
Old 09-21-2012, 07:28 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
As I see this, can't you just treat this untrusted subnet as a generic remote client? remove that range from mynetworks and then they'll have as much permission to send to postfix as a remote relay, i.e. to the domains that you host.
 
Old 09-21-2012, 12:53 PM   #3
rothgar
LQ Newbie
 
Registered: Sep 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by acid_kewpie View Post
As I see this, can't you just treat this untrusted subnet as a generic remote client? remove that range from mynetworks and then they'll have as much permission to send to postfix as a remote relay, i.e. to the domains that you host.
I tried taking out the network range from mynetworks but it denies sending emails even to internal addresses. Is there a setting to allow forwarding from all hosts to only internal addresses and then trusted networks can send to external addresses?
 
  


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
[SOLVED] how to restrict Linux dhcp server to give response to specific systems / vlan mail4vijay Linux - General 3 08-13-2012 10:09 AM
Postfix Appends FQDN to Senders Address carlosinfl Linux - Server 1 05-17-2009 08:57 PM
Postfix configuration: fake senders clinkco Linux - Server 2 05-07-2008 12:27 PM
Can Postfix Restrict Senders For Mailing Lists? tbeehler Linux - Software 2 04-07-2008 06:41 PM
sendmail outbound relaying based on senders address dbnor Linux - Networking 2 01-27-2007 09:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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