2

Is there any postfix guru here who knows that after a mail gets into postfix what's the order it gets forwarded between the internal filters and components?

As I figured:

1, Postscreen

2, Recipient checks

 smtpd_recipient_restrictions =
        reject_non_fqdn_recipient
        reject_unknown_recipient_domain
        permit_mynetworks
        check_client_access hash:/etc/postfix/rbl_override
        reject_non_fqdn_sender
        reject_unknown_sender_domain
        check_policy_service inet:1.2.3.4:4000
        reject_unauth_destination
        reject_invalid_helo_hostname
        reject_non_fqdn_helo_hostname
        reject_rbl_client zen.spamhaus.org

3, Message passed on to dspam

virtual_transport = dspam:unix:/var/run/dspam/dspam.sock 

4, Dspam does additional checks then forwards the mail to the next component.

Is this about right?

poettring
  • 21
  • 1

1 Answers1

1

This is how I see it moving through the server, hopefully I haven't omitted anything too egregious.

Postscreen would normally be the first point of contact, but usually only for external servers submitting on port 25.

When postscreen validates the connection it then passes it on to smtpd which will perform checks which are designed to complete before the connection is closed with the remote server. Assuming those checks went fine, smtpd will pass the connection on to the cleanup daemon/server, and into the incoming queue.

Then, if the active queue is not full, the mail will be passed from the incoming queue to the active queue, and then to the qmgr who will then send it to the DSPAM sock, and since postfix uses the virtual_transport route, it considers it delivered if the DSPAM socket accepts it.

DSPAM will then check the mail, and if it passes, forward it to dovecot or another LDA.

NickW
  • 10,183
  • 1
  • 18
  • 26
  • And just one more question, where does ClamAV fit in? I didn't notice I have this in my setup too: smtpd_milters = unix:/clamav/clamav-milter.ctl – poettring Jan 06 '15 at 09:45
  • That would actually be in the first section, along with the other checks that are performed before the remote connection with the server is closed.. smtpd_milters are also called before queue milters. – NickW Jan 06 '15 at 09:53