That's simply not true. Macros only need to be before the first "begin" line
in the configuration and appear before they are referenced. They do not need
to be before anything else.
This configuration seems to meet both of those requirements perfectly well.
> > GREYLIST_TEST = SELECT CASE \
> > WHEN now() - block_expires > 0 THEN 2 \
> > ELSE 1 \ ... > > acl_smtp_mime = acl_check_mime
> > acl_smtp_data = acl_check_content
>
> Where is your spamd_address line???
That's not relevant either. It is not necessary to have spamd_address if
spamd is listening on 127.0.0.1:783, it's the default. The mere presence of
a spamd_address setting would not tell you if it is correct, the default is
more than likely right for most setups anyway.
> > av_scanner = clamd
> > never_users = root
> > host_lookup = *
> > rfc1413_hosts = *
> > rfc1413_query_timeout = 30s
> > ignore_bounce_errors_after = 2d
> > timeout_frozen_after = 7d
> > begin acl
>
> Lets fix those two things first, then see what happens.
I completely expect the same thing will happen since those two things have
nothing to do with whatever the problem might be.
I agree that the original poster could have posed better questions and
provided better and more data, but throwing incorrect advice back isn't
going to help anything, either. It only distracts from what the real problem
may be.