Alexei Troussov wrote:
... Snip ...

OK, now I did:

...snip...

smtpd_recipient_restrictions = permit_sasl_authenticated,
 permit_mynetworks,
 reject_unauth_pipelining,
 reject_non_fqdn_recipient,
 reject_unknown_recipient_domain,
 permit_sasl_authenticated,
 reject_unauth_destination,
 permit_auth_destination,
 reject_non_fqdn_hostname,
 reject_non_fqdn_sender,
 reject_invalid_hostname,
 hash:/usr/local/etc/postfix/access,
 check_client_access pcre:/usr/local/etc/postfix/filter_access
...snip...

...snip...
Now I sent an email to some account '[EMAIL PROTECTED]' and got this in logs:
#tail -f /var/log/maillog
Apr 1 15:39:20 erley postfix/smtpd[190]: connect from fg-out-1718.google.com[72.14.220.156] Apr 1 15:39:20 erley postfix/smtpd[190]: 7C29950C1: client=fg-out-1718.google.com[72.14.220.156] Apr 1 15:39:20 erley postfix/cleanup[193]: 7C29950C1: message-id=<[EMAIL PROTECTED]> Apr 1 15:39:20 erley postfix/qmgr[99814]: 7C29950C1: from=<[EMAIL PROTECTED]>, size=1923, nrcpt=1 (queue active) Apr 1 15:39:20 erley postfix/pipe[195]: 7C29950C1: to=<[EMAIL PROTECTED]>, relay=cyrus, delay=0.35, delays=0.21/0.03/0/0.12, dsn=2.0.0, status=sent (delivered via cyrus service)
Apr  1 15:39:20 erley postfix/qmgr[99814]: 7C29950C1: removed
Apr 1 15:39:50 erley postfix/smtpd[190]: disconnect from fg-out-1718.google.com[72.14.220.156]

Nothing was logged in /var/log/dspam
This is very much postfix-related, not specific to DSpam. As far as I can tell, if you sent your test-email from a client listed in $mynetworks, the filter tag will not be added to your test message because anything after "permit_mynetworks" will not be checked, and hence the mail will go directly to local delivery without being filtered. For testing purposes, you could move your filtering command higher up, but note that this would mean all mail for all recipients wil be filtered, also mail destined for other domains, i.e. outgoing mail. Your filter file will still allow the rest of the checks to be done, it only tags the emails to remind postfix that they need to be filtered before being sent on.

* If you only want to filter mail for local users, it is better to set up dspam in the local delivery stage (mailbox_command or somesuch).

* If you only have a forwarding mail-server, filtering (possibly with only one instance of smtpd) like you are doing is easy.

* If you have both, then you need to consult with postfix gurus to get the rules for which email is handled by which instance of smtpd right (filtering for local recipients implies smtpd listening on AT LEAST two ports). Remember you have a lot of stages an email can go through, varying a bit depending on where it comes from and where it is going, filters and UCE-rules etc.

Reply via email to