Hi,
in my acl_smtp_data ACL I have this rule:
warn message = X-Spam-Flag: YES
condition = ${if <{$message_size}{80k}{1}{0}}
spam = nobody
condition = ${if >{$spam_score_int}{${lookup pgsql { SELECT * FROM flagSpam('${quote_pgsql:$local_part}@${quote_pgsql:$original_domain}')}}}{1}{0}}
When I send a mail it's called, but '${quote_pgsql:$local_part}@${quote_pgsql:$original_domain}'
is expanded to '@'.
The debug output says:
=====
12860 processing "warn"
12860 expanding: $message_size
12860 result: 360
12860 expanding: 80k
12860 result: 80k
12860 condition: <{$message_size}{80k}
12860 result: true
12860 expanding: 1
12860 result: 1
12860 expanding: 0
12860 result: 0
12860 skipping: result is not used
12860 expanding: ${if <{$message_size}{80k}{1}{0}}
12860 result: 1
12860 check condition = ${if <{$message_size}{80k}{1}{0}}
12860 = 1
12860 check spam = nobody
12860 expanding: $spam_score_int
12860 result: 194
12860 expanding: $local_part
12860 result:
12860 expanding: $original_domain
12860 result:
12860 expanding: SELECT * FROM flagSpam('${quote_pgsql:$local_part}@${quote_pgsql:$original_domain}')
12860 result: SELECT * FROM flagSpam('@')
12860 search_open: pgsql "NULL"
12860 search_find: file="NULL"
12860 key="SELECT * FROM flagSpam('@')" partial=-1 affix=NULL starflags=0
12860 LRU list:
12860 internal_search_find: file="NULL"
12860 type=pgsql key="SELECT * FROM flagSpam('@')"
12860 database lookup required for SELECT * FROM flagSpam('@')
12860 PGSQL query: SELECT * FROM flagSpam('@')
12860 PGSQL new connection: host=localhost port= database=email user=email
12860 lookup yielded: 50
12860 expanding: ${lookup pgsql { SELECT * FROM flagSpam('${quote_pgsql:$local_part}@${quote_pgsql:$original_domain}')}}
12860 result: 50
12860 condition: >{$spam_score_int}{${lookup pgsql { SELECT * FROM flagSpam('${quote_pgsql:$local_part}@${quote_pgsql:$original_domain}')}}}
12860 result: true
12860 expanding: 1
12860 result: 1
12860 expanding: 0
12860 result: 0
12860 skipping: result is not used
12860 expanding: ${if >{$spam_score_int}{${lookup pgsql { SELECT * FROM flagSpam('${quote_pgsql:$local_part}@${quote_pgsql:$original_domain}')}}}{1}{0}}
12860 result: 1
12860 check condition = ${if >{$spam_score_int}{${lookup pgsql { SELECT * FROM flagSpam('${quote_pgsql:$local_part}@${quote_pgsql:$original_domain}')}}}{1}{0}}
12860 = 1
12860 warn: condition test succeeded
=====
I've sent the message by connecting directly with netcat:
=====
MAIL FROM: 43242@???
RCPT TO: adrian@???
DATA
Subject: FxEE Pxxx ENxxxxEMENT INCxxxSE BY 100 PERCENT SIZE!!!!!!!!!!!
From: r3z42@???
To: 421414
<some blah blah which looks really like spam>
.
=====
--
Adrian