Re: smtpd recipient rule not matched

2017-04-07 Thread Frank Timmers
Hi Gilles, Edgar,

Thanks for the quick responses. I’ve changed the rule to:
accept from any to any recipient  relay

This seems to work as expected. Still to much in the PF mindset for the syntax 
:) Hadn’t seen that from/for defaults to local when omitted.

Greetings,
Frank.



> Op 6 apr. 2017, om 16:48 heeft Gilles Chehade  het volgende 
> geschreven:
> 
> On Thu, Apr 06, 2017 at 04:01:02PM +0200, Frank Timmers wrote:
>> Hi,
>> 
> 
> Hi,
> 
> 
>> I???ve got a  rule based on recipients, however for some reason it???s not 
>> matched and therefor the mail bounced. Can anyone tell me if I???m doing 
>> something wrong?
>> 
> 
> Yep,
> 
> 
>> smtpd.conf rule:
>> table recipient_whitelist file:/etc/opensmtpd/recipient_whitelist
>> accept recipient  relay via smtp://127.0.0.1:10027 
>> 
> 
> Your rule lacks 'from' and 'for' so this rule will be similar to:
> 
> accept from local for local recipient  [...]
> 
> which:
> 
> 
>> /etc/opensmtpd/recipient_whitelist:
>> # accept all mails to these recipients
>> mon...@example.com 
>> ban...@example.com 
> 
> will fail to match recipient since @example.com is not part of "for local",
> and ...
> 
> 
>> Output from ???smtpd -dv -T lookup -T rules???:
>> debug: smtp: new client on listener: 0xe253a0
>> 13e045ff1aa2603d smtp event=connected address=192.168.0.10 
>> host=client.example.com 
> 
> will fail to match sender since 192.168.0.10 is a network connection and is
> not part of "from local"
> 
> -- 
> Gilles Chehade
> 
> https://www.poolp.org  @poolpOrg
> 
> -- 
> You received this mail because you are subscribed to misc@opensmtpd.org
> To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org
> 


--
You received this mail because you are subscribed to misc@opensmtpd.org
To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org



Re: smtpd recipient rule not matched

2017-04-06 Thread Gilles Chehade
On Thu, Apr 06, 2017 at 04:01:02PM +0200, Frank Timmers wrote:
> Hi,
> 

Hi,


> I???ve got a  rule based on recipients, however for some reason it???s not 
> matched and therefor the mail bounced. Can anyone tell me if I???m doing 
> something wrong?
> 

Yep,


> smtpd.conf rule:
> table recipient_whitelist file:/etc/opensmtpd/recipient_whitelist
> accept recipient  relay via smtp://127.0.0.1:10027 
> 

Your rule lacks 'from' and 'for' so this rule will be similar to:

 accept from local for local recipient  [...]

which:


> /etc/opensmtpd/recipient_whitelist:
> # accept all mails to these recipients
> mon...@example.com 
> ban...@example.com 

will fail to match recipient since @example.com is not part of "for local",
and ...


> Output from ???smtpd -dv -T lookup -T rules???:
> debug: smtp: new client on listener: 0xe253a0
> 13e045ff1aa2603d smtp event=connected address=192.168.0.10 
> host=client.example.com 

will fail to match sender since 192.168.0.10 is a network connection and is
not part of "from local"

-- 
Gilles Chehade

https://www.poolp.org  @poolpOrg

-- 
You received this mail because you are subscribed to misc@opensmtpd.org
To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org



Re: smtpd recipient rule not matched

2017-04-06 Thread Edgar Pettijohn


On 04/06/17 09:01, Frank Timmers wrote:

Hi,

I’ve got a  rule based on recipients, however for some reason it’s not 
matched and therefor the mail bounced. Can anyone tell me if I’m doing 
something wrong?


Thanks and kind regards,
/Frank.

—
smtpd.conf rule:
table recipient_whitelist file:/etc/opensmtpd/recipient_whitelist
accept recipient  relay via smtp://127.0.0.1:10027


I think you have to do like this:

accept for domain example.com recipient  relay via 


—

—
/etc/opensmtpd/recipient_whitelist:
# accept all mails to these recipients
mon...@example.com 
ban...@example.com 
—

—
Output from “smtpd -dv -T lookup -T rules”:
debug: smtp: new client on listener: 0xe253a0
13e045ff1aa2603d smtp event=connected address=192.168.0.10 
host=client.example.com 

debug: smtp: SIZE in MAIL FROM command
lookup: check “192.168.0.10" as NETADDR in table static: -> 0
no rule matched
13e045ff1aa2603d smtp event=failed-command command="RCPT 
TO:mailto:mon...@example.com>> 
ORCPT=rfc822;mon...@example.com " 
result="550 Invalid recipient"

13e045ff1aa2603d smtp event=closed reason=quit
debug: smtp: 0xe1d3f0: deleting session: done
—