Hi
I'm testing a new postfix install but from the logs it looks like spamassassin is being called before clamsmtp. This strikes me as a huge drain on resources as a virus scan with clamav/clamsmtp is much less expensive than spamassassin. My master.conf and main.com are below as well as the maillog output from a typical mail.

I've highlighted the code that connects postfix to the clamsmtp and spamassassin services.

Any help would be appreciated.

Code:
Jun 25 18:49:01 mail postfix/smtpd[22498]: connect from unknown[209.85.215.170]
Jun 25 18:49:01 mail postfix/smtpd[22498]: Anonymous TLS connection established from unknown[209.85.215.170]: TLSv1 with cipher RC4-SHA (128/128 bits)
Jun 25 18:49:01 mail postfix/smtpd[22498]: 546E2460057: client=unknown[209.85.215.170]
Jun 25 18:49:01 mail postfix/cleanup[22505]: 546E2460057: message-id=<51C9D7FD.50709_at_gmail . TLD>
Jun 25 18:49:01 mail postfix/qmgr[22481]: 546E2460057: from=<EMAIL_ADDRESS_at_gmail . TLD>, size=3139, nrcpt=1 (queue active)
Jun 25 18:49:01 mail postfix/smtpd[22498]: disconnect from unknown[209.85.215.170]
Tue Jun 25 18:49:01 2013 [19838] info: spamd: connection from localhost [127.0.0.1] at port 59996
Tue Jun 25 18:49:01 2013 [19838] info: spamd: handle_user unable to find user: 'info_at_DOMAIN_NAME.TLD'
Tue Jun 25 18:49:01 2013 [19838] info: spamd: processing message <51C9D7FD.50709_at_gmail . TLD> for info_at_DOMAIN_NAME.TLD:501
Tue Jun 25 18:49:08 2013 [19838] info: spamd: clean message (0.5/5.0) for info_at_DOMAIN_NAME.TLD:501 in 7.5 seconds, 3108 bytes.
Tue Jun 25 18:49:08 2013 [19838] info: spamd: result: . 0 - DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RDNS_NONE,URIBL_BLOCKED scantime=7.5,size=3108,user=info_at_DOMAIN_NAME.TLD,uid=501,required_score=5.0,rhost=localhost,raddr=127.0.0.1,rport=59996,mid=<51C9D7FD.50709_at_gmail . TLD>,autolearn=no
Tue Jun 25 18:49:09 2013 [19829] info: prefork: child states: II
Jun 25 18:49:09 mail postfix/pickup[22480]: 15E5946005D: uid=501 from=<EMAIL_ADDRESS_at_gmail . TLD>
Jun 25 18:49:09 mail postfix/cleanup[22505]: 15E5946005D: message-id=<51C9D7FD.50709_at_gmail . TLD>
Jun 25 18:49:09 mail postfix/pipe[22506]: 546E2460057: to=<info_at_DOMAIN_NAME.TLD>, relay=spamassassin, delay=7.8, delays=0.19/0.03/0/7.6, dsn=2.0.0, status=sent (delivered via spa
massassin service)
Jun 25 18:49:09 mail postfix/qmgr[22481]: 546E2460057: removed
Jun 25 18:49:09 mail postfix/qmgr[22481]: 15E5946005D: from=<EMAIL_ADDRESS_at_gmail . TLD>, size=3548, nrcpt=1 (queue active)
Jun 25 18:49:09 mail clamsmtpd: 100007: accepted connection from: 127.0.0.1
Jun 25 18:49:09 mail postfix/smtpd[22522]: connect from localhost[127.0.0.1]
Jun 25 18:49:09 mail postfix/smtpd[22522]: 36FAF460057: client=localhost[127.0.0.1]
Jun 25 18:49:09 mail postfix/cleanup[22505]: 36FAF460057: message-id=<51C9D7FD.50709_at_gmail . TLD>
Jun 25 18:49:09 mail postfix/qmgr[22481]: 36FAF460057: from=<EMAIL_ADDRESS_at_gmail . TLD>, size=3785, nrcpt=1 (queue active)
Jun 25 18:49:09 mail clamsmtpd: 100007: from=EMAIL_ADDRESS_at_gmail . TLD, to=info_at_DOMAIN_NAME.TLD, status=CLEAN
Jun 25 18:49:09 mail postfix/smtp[22520]: 15E5946005D: to=<info_at_DOMAIN_NAME.TLD>, relay=127.0.0.1[127.0.0.1]:10025, delay=0.35, delays=0.11/0.03/0.06/0.15, dsn=2.0.0, status=sent
 (250 2.0.0 Ok: queued as 36FAF460057)
Jun 25 18:49:09 mail postfix/smtpd[22522]: disconnect from localhost[127.0.0.1]
Jun 25 18:49:09 mail postfix/qmgr[22481]: 15E5946005D: removed
Jun 25 18:49:09 auth-worker: Info: mysql(localhost): Connected to database postfix
Jun 25 18:49:09 dict: Info: mysql(localhost): Connected to database postfix
Jun 25 18:49:09 lda(info_at_DOMAIN_NAME.TLD): Info: sieve: msgid=<51C9D7FD.50709_at_gmail . TLD>: stored mail into mailbox 'INBOX'
Jun 25 18:49:10 mail postfix/pipe[22524]: 36FAF460057: to=<info_at_DOMAIN_NAME.TLD>, relay=dovecot, delay=0.81, delays=0.15/0.01/0/0.65, dsn=2.0.0, status=sent (delivered via doveco
t service)
Jun 25 18:49:10 mail postfix/qmgr[22481]: 36FAF460057: removed

Code:
######################################
####                         MAIN.CONF
######################################
mail_owner = postfix
setgid_group = postdrop
delay_warning_time = 4

html_directory = no
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
queue_directory = /var/spool/postfix
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man

inet_interfaces = all`
mydomain = DOMAINNAME.TLD
myhostname = mail.DOMAINNAME.TLD
mynetworks = $config_directory/mynetworks
mydestination = $myhostname, localhost.$mydomain, localhost 
relay_domains = proxy:mysql:/etc/postfix/mysql-relay_domains_maps.cf

recipient_delimiter = + 

alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
transport_maps = hash:/etc/postfix/transport

virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_alias_maps.cf,
                     regexp:/etc/postfix/virtual_regexp
virtual_mailbox_base = /home/vmail/
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains_maps.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_maps.cf
virtual_minimum_uid = 101
virtual_uid_maps = static:101
virtual_gid_maps = static:12
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1

debug_peer_level = 2
debug_peer_list = DOMAINNAME.TLD
debugger_command =
         PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
         xxgdb $daemon_directory/$process_name $process_id & sleep 5

smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
broken_sasl_auth_clients = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth

smtp_use_tls = yes
smtpd_use_tls = yes 
smtpd_tls_security_level = may
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
smtp_tls_session_cache_database = btree:$data_directory/smtp_tls_session_cache
smtpd_tls_key_file = /etc/pki/tls/private/mail.DOMAINNAME.TLD.key
smtpd_tls_cert_file = /etc/pki/tls/certs/mail.DOMAINNAME.TLD.crt

smtpd_client_restrictions = 
smtpd_helo_restrictions = 
smtpd_sender_restrictions = 
smtpd_recipient_restrictions = permit_dnswl_client list.dnswl.org, 
	permit_sasl_authenticated, 
        permit_mynetworks,
        reject_unauth_destination,
	reject_non_fqdn_sender,
        reject_non_fqdn_recipient, 
        reject_unknown_recipient_domain,
	check_policy_service inet:127.0.0.1:2525
        #connect with gld greylisting server

smtpd_helo_required = yes
unknown_local_recipient_reject_code = 550
disable_vrfy_command = yes
smtpd_data_restrictions = reject_unauth_pipelining

message_size_limit = 204800000
mailbox_size_limit = 204800000

content_filter = scan:127.0.0.1:10025
        #connect with clamsmtp server
readme_directory = /usr/share/doc/postfix-2.10.0/README_FILES
sample_directory = /usr/share/doc/postfix-2.10.0/samples
data_directory = /var/lib/postfix
inet_protocols = ipv4
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated 	    defer_unauth_destination


Code:
######################################
####                       MASTER.CONF
######################################
smtp      inet  n       -       n       -       -       smtpd -o content_filter=spamassassin
pickup    fifo  n       -       n       60      1       pickup
cleanup   unix  n       -       n       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
tlsmgr    unix  -       -       n       1000?   1       tlsmgr
rewrite   unix  -       -       n       -       -       trivial-rewrite
bounce    unix  -       -       n       -       0       bounce
defer     unix  -       -       n       -       0       bounce
trace     unix  -       -       n       -       0       bounce
verify    unix  -       -       n       -       1       verify
flush     unix  n       -       n       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       n       -       -       smtp
relay     unix  -       -       n       -       -       smtp
	-o smtp_fallback_relay=
showq     unix  n       -       n       -       -       showq
error     unix  -       -       n       -       -       error
retry     unix  -       -       n       -       -       error
discard   unix  -       -       n       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       n       -       -       lmtp
anvil     unix  -       -       n       -       1       anvil
scache    unix  -       -       n       -       1       scache

scan unix -       -       n      -     16 smtp
      -o smtp_data_done_timeout=1200
      -o smtp_send_xforward_command=yes
      -o disable_dns_lookups=yes
127.0.0.1:10026 inet n     -     n     -     16 smtpd
      -o content_filter=
      -o local_recipient_maps=
      -o relay_recipient_maps=
      -o smtpd_restriction_classes=
      -o smtpd_client_restrictions=
      -o smtpd_helo_restrictions=
      -o smtpd_sender_restrictions=
      -o smtpd_recipient_restrictions=permit_mynetworks,reject
      -o mynetworks_style=host
      -o smtpd_authorized_xforward_hosts=127.0.0.0/8

dovecot   unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail:mail argv=/usr/libexec/dovecot/deliver -d ${recipient}
vacation    unix  -       n       n       -       -       pipe
  flags=Rq user=vacation argv=/var/spool/vacation/vacation.pl -f ${sender} -- ${recipient}

spamassassin
     unix  -       n       n       -       -       pipe
     flags=R
     user=spamd
     argv=/usr/bin/spamc -u ${recipient}
     -e /usr/sbin/sendmail 
     -oi -f ${sender} ${recipient}