the documentation of $received_protocol isn't totally clear to me, but it seems clear that if your local sender connects using smtp, then $received_protocol will be some variant of "smtp". I would guess that your condition matches for use of the LMTP protocol.
I believe you need something more like
hosts = 127.0.0.1 : 10.20.30.40