> Christopher Walker:
> > Hi all,
> >
> > I'm trying to use milter_header_checks to file messages into users
> > Junk folder but I'm having issues formatting the FILTER response in my
> > header check file.
> >
> > I've added the following to my main.cf:
> >   10025     inet  n       -       n       -       -       smtpd
> >     -o smtpd_tls_security_level=may
> >     -o smtpd_relay_restrictions=permit_mynetworks,reject
> >     -o inet_interfaces=loopback-only
> >     -o receive_override_options=no_header_body_checks
> >     -o 
> > local_recipient_maps=hash:/etc/postfix/virtual,ldap:/etc/postfix/virtual_junk.cf
> >     -o 
> > virtual_alias_maps=hash:/etc/postfix/virtual,ldap:/etc/postfix/virtual_junk.cf
> >     -o inet_interfaces=loopback-only
> >
> > My /etc/postfix/milter_header_checks file:
> >   /^X-Spam-Status:\s+Yes$/                FILTER  localhost:10025
>
> You mean: smtp:localhost:10025. You have to specify a delivery
> service (name in master.cf) before the destination (localhost:10025).
>
> > I'm using EFA project as an external mail filter.  Whenever spam is
> > encountered EFA adds 'X-Spam-Status: Yes' to the message header before
>
> Your configuration suggests something different:
>
> - The Milter adds 'X-Spam-Status: Yes'
>
> - The milter_header_checks sends mail with such a header over SMTP
> to localhost:10025.
>
>         Wietse

Thank you very much, your suggestion worked and cleared my transport issue.

We use EFA project (https://efa-project.org/) as an external mail
gateway for our site. As mail passes through the gateway EFA will add
the X-Spam-Status flag to every message. On the mail server, I'm
trying to run two instances of Postfix with different settings for
local_recipient_maps and virtual_alias_maps so I can (hopefully)
manipulate where the messages are placed in IMAP.

My /etc/postfix/virtual_junk.cf:
  server_host = ldap://10.3.24.162
  server_port = 389
  search_base = cn=Users,dc=ad,dc=domain,dc=com
  query_filter = (&(mail=%s)(objectClass=person))
  result_attribute = msSFU30Name
  bind = yes
  bind_dn = cn=ldap,cn=Users,dc=ad,dc=domain,dc=com
  bind_pw = strong_password
  version = 3
  start_tls = yes
  result_format = %s+j...@mail.domain.com

Unfortunately, I'm now having a problem where external addresses are
being mapped to IMAP accounts without the +Junk suffix. This results
in spam messages winding up in the user's inbox (basically how it was
working before). When does address mapping occur? I've changed the
milter_header_checks to header_checks hoping to reroute the message
before any address mapping occurs. I'm really hoping to get messages
into a user's Junk folder without using IMAP sieve.

Thanks,
Chris

-- 
PGP Fingerprint: 0x1A97C6259125882867EC8410FA1E7CD382BFC760

Reply via email to