Re: [exim] Remove Tags from Subject

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Christian Schmidt
Date:  
À: exim-users
Sujet: Re: [exim] Remove Tags from Subject
Hello JAS,

JAS, 29.11.2004 (d.m.y):

> I would like to be able to remove tags from a subject line.
> "[SPAM]this is spam". I would like to remove the [SPAM] so the line
> reads "this is spam" Can exim do this?


I'm not that sure, but IMHO you should get it running by using exim's
filter capabilities.
For example: 
On my home server, exim scans mails for spam using exiscan-acl and
SpamAssassin, and whenever SpamAssassins detects a spam mail, the
subject line is tagged by {SPAM?}.
I did that by creating a system filter file containing the following:
 # Exim System Filter File
 #
 ### Tag Subject line of recognized Spam Mails:
 #
 if "${if def:header_X-New-Subject: {there}}" is there
   then
    headers remove subject
    headers add "Subject: $h_X-New-Subject:"
    headers remove X-New-Subject
 endif


in my exim.conf, I referenced this file by:
system_filter = /etc/exim4/system-filter

This system filter /adds/ something to the subject line, but IMO it
should also be possible to "shorten" it, to replace special phrases
by others and so on...

The "X-New-Subject" line is added by the smtp_data ACL I called
check_content:

acl_check_content:
deny  message = This message contains an unwanted file extension ($found_extension)
       demime = scr:vbs:bat:lnk:pif
deny  message = Sorry, but your message contains malware ($malware_name)
      malware = *
warn  message = X-Spam-Score: $spam_score ($spam_bar)
    condition = ${ifi <{$message_size}{80k}{1}{0}}
     spam =    spamassi:true
warn  message = X-New-Subject: {SPAM?} $h_subject:
     spam = spamassi
warn  message = X-Spam-Flag: YES
         spam = spamassi
accept


But maybe using an MDA like maildrop with a system-wide mailfilter
file would be a solution, too?
                                            
hth,
Christian
--
Wie man sein Kind nicht nennen sollte:
Rolf Eld