OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: Postfix to stop all email from internet/public IP's to user begining with bk how? (SOLVED)

From: Boyd Lynn Gerber (gerberbzenez.com)
Date: Sat Aug 25 2007 - 13:20:58 CDT


On Sat, 25 Aug 2007, mouss wrote:
> Boyd Lynn Gerber wrote:
> > I felt the subject really did not match and the issue that the subject
> > related was solved. That I should begin a new thread. thanks in advance.
> >
> >
>
> I missed the new thread and replied to the previous one.
>
>
> The previous reply assumes that the bk* users can send to all domains managed
> by your postfix (mydestination, virtual_alias_domains, virtual_mailbox_domains
> and relay_domains).
>
> If that is not what you want, you should use something like this:
>
>
> smtpd_restriction_classes = local_only
>
> smtpd_sender_restrictions =
> check_sender_access pcre:/etc/postfix/private_address.pcre
>
> smtpd_recipient_restrictions =
> reject_non_fqdn_sender
> reject_non_fqdn_recipient
> reject_unlisted_sender
> reject_unlisted_recipient
> permit_mynetworks
> reject_unauth_destination
> check_recipient_access pcre:/etc/postfix/rcpt_bl.pcre
> local_only =
> # jailed users can send to a few domains only
> check_recipient_access hash:/etc/postfix/allowed_domains
> reject

This is what I was missing. I had everything like the other thread but
emails were still getting in. Once I added the above and

check_recipient_access pcre:/etc/postfix/private_address_only.pcre

to "smtpd_recipient_restrictions =" everything is working! I do not
think I would have gotten this resolved without the assistance.

Thanks,

>
> == allowed_domains
> example.org OK
> example.org OK
> #you can add exceptional external addresses
> allowedout.example OK
>
>
> == private_address.pcre:
> /^bk.*example\.com$/ local_only
>
>
> == rcpt_bl.pcre
> # inbound mail
> /^bk.*example\.com$/ REJECT blah blah
>
>

--
Boyd Gerber <gerberbzenez.com>
ZENEZ 1042 East Fort Union #135, Midvale Utah 84047