LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 02-16-2010, 03:05 PM   #1
damone333
LQ Newbie
 
Registered: Feb 2010
Posts: 2

Rep: Reputation: 0
Postfix per user smtpd restrictions


I have searched other post on here and they appear to be relevant but when I enter in the exact same commands it denies relay access to everyone. I have also used the postmap command to refresh the database.


Feb 16 15:54:48 EMAIL2 postfix/smtpd[6512]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 554 5.7.1 <josh.dobs@gmail.com>: Recipient address rejected: Relay access denied; from=<msolis@EMAIL2.drewmedical.com> to=<josh.dobs@gmail.com> proto=ESMTP helo=<192.168.1.51>


I used this page as reference.
http://www.postfix.org/RESTRICTION_CLASS_README.html

Below is my main.cf
# See /usr/share/postfix/main.cf.dist for a commented, more complete version

# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = /usr/share/doc/postfix


# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = EMAIL2.EXAMPLE.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
# Identifies what mail the host will deliver locally.
mydestination = EXAMPLE.com, EMAIL2.EXAMPLE.com, localhost.EXAMPLE.com
#relayhost =
mynetworks = 192.168.1.0/24, 127.0.0.0/8,
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
html_directory = /usr/share/doc/postfix/html
mydomain = EXAMPLE.com
# Rewriting Addresses in Outgoing Mail
masquerade_domains = EXAMPLE.com
# MailScanner Header Cheecker
header_checks = regexp:/etc/postfix/header_checks
# Enables maildir style email retension
home_mailbox = Maildir/

### Reject bogus email
#smtpd_delay_reject = yes
#smtpd_helo_required = yes
#smtpd_helo_restrictions =
# permit_mynetworks,
## reject_invalid_hostname,
## reject_non_fqdn_hostname,
# permit
#smtpd_data_restrictions =
#reject_unauth_pipelining,
#permit
#smtpd_sender_restrictions =
# permit_mynetworks,
# reject_non_fqdn_sender,
# reject_unknown_sender_domain,
# permit
#smtpd_recipient_restrictions =
#permit_sasl_authenticated,
#permit_mynetworks,
#reject_unknown_recipient_domain,
#reject_unauth_destination,
# permit


### TLS - SASL ###
smtpd_sasl_local_domain = EXAMPLE.com
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_tls_auth_only = yes
smtpd_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
smtpd_tls_received_header = yes
smtpd_tls_key_file = /etc/ssl/private/smtpd.key
smtpd_tls_cert_file = /etc/ssl/certs/smtpd.crt
smtp_tls_note_starttls_offer = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
#smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject _unauth_destination

smtpd_recipient_restrictions = check_sender_access hash:/etc/postfix/restricted_senders, check_relay_domains

smtpd_restriction_classes = local_only
local_only = check_recipient_access hash:/etc/postfix/local_domains, reject





This is the local_domains file:
user@EMAIL2:/etc/postfix$ cat local_domains
# This table defines what destinations are local
# FORMAT = this.domain OK
EXAMPLE.com OK
EMAIL2.EXAMPLE.com OK




This is the restricted senders file
user@EMAIL2:/etc/postfix$ cat restricted_senders
# Users restricted to local only.
# FORMAT IS = foo@domain local_only
brose@EXAMPLE.com local_only
brose@EMAIL2.EXAMPLE.com local_only


Any help will be greatly appreciated.
 
Old 10-13-2010, 03:18 PM   #2
damone333
LQ Newbie
 
Registered: Feb 2010
Posts: 2

Original Poster
Rep: Reputation: 0
solution found

My problem was nothing more than spacing for me on my main.cf file. Below is what I used to correct it.

smtpd_recipient_restrictions =
check_sender_access hash:/etc/postfix/restricted_senders
reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination

smtpd_restriction_classes = local_only
local_only =
check_recipient_access hash:/etc/postfix/local_domains, reject
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
POSTFIX smtpd block by to: field officecase Linux - Server 9 04-13-2009 06:19 AM
Postfix error: /usr/lib/postfix/smtpd pid 7529 exit status 1 Chiragrs Linux - Networking 7 05-16-2008 12:42 AM
Postfix user restrictions Givi Linux - Server 1 11-20-2006 06:09 AM
Smtp vs. Smtpd on Postfix BeerBust Linux - Software 1 10-10-2003 11:07 AM

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

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