User Tools

Site Tools


doc:appunti:linux:sa:sieve_filtering_tnef

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doc:appunti:linux:sa:sieve_filtering_tnef [2021/05/24 12:45] – [The Sieve filter] niccolodoc:appunti:linux:sa:sieve_filtering_tnef [2021/05/24 13:03] (current) – [The Sieve filter] niccolo
Line 6: Line 6:
  
 The original TNEF attachment is retained, so **the size of the email is roughly doubled**. The original TNEF attachment is retained, so **the size of the email is roughly doubled**.
 +
 +===== Reference installation =====
 +
 +I'm running a mail server based on **Debian 10 Buster**, the IMAP, POP3 and LDA services are provided by **Dovecot**. The Local Delivery Agent have the **Sieve** filtering enabled. You can read the configuration details in this article: **[[postfix_spamassassin_clamav_dovecot#sieve_filtering|Sieve filtering with Dovecot]]**.
  
 ===== Installing the tnef-filter script ===== ===== Installing the tnef-filter script =====
  
-You can download **tnef-filter** script provided by **Graham Edgecombe**, from his **[[https://github.com/grahamedgecombe/tnef-filter|GitHub repository]]**. On my Debian 10 Buster installationthat requied the following libraries:+First of all we need a mail filter program which does all the magic. It will receive the mail message as standard input and it will produce the //converted// message to the standard output. 
 + 
 +You can download the **tnef-filter** script written by **Graham Edgecombe**, from his **[[https://github.com/grahamedgecombe/tnef-filter|GitHub repository]]**. I copied the binary script into **/usr/local/bin/tnef-filter**. 
 + 
 +Running the script on my Debian 10 Buster server, requied the following libraries:
  
 <code> <code>
-apt-gest install libconvert-tnef-perl libfile-mmagic-perl libmime-tools-perl+apt-get install libconvert-tnef-perl libfile-mmagic-perl libmime-tools-perl
 </code> </code>
- 
-I copied the binary script into **/usr/local/bin/tnef-filter**. 
  
 ===== The Sieve filter ===== ===== The Sieve filter =====
 +
 +In my installation, each user have a file called **$HOME/sieve_before.d/personal.sieve**, this is a file where I put antispam and antivirus filters, that the user is not allowed to customize. Feel free to add the Sieve filter rule in whichever file suits your needs.
  
 <code> <code>
Line 33: Line 41:
 </code> </code>
  
-You need to include the **mime** and **foreverypart** plugins.+Notice that you need to include the **mime** and **foreverypart** plugins.
  
-I created the shell script **tnef-filter.sh** into the **/usr/local/lib/dovecot/sieve-filter/** directry, because that directory is the one declared to contains Sieve filters. You can set that location into **/etc/dovecot/conf.d/90-sieve-extprograms.conf**:+I created the shell script **tnef-filter.sh** into the **/usr/local/lib/dovecot/sieve-filter/** directory; it is a simple one-line command: 
 + 
 +<code bash> 
 +#!/bin/sh 
 +/usr/local/bin/tnef-filter 
 +</code> 
 + 
 +The directory is the one declared to contains Sieve filters. You can set that location into **/etc/dovecot/conf.d/90-sieve-extprograms.conf**:
  
 <file> <file>
Line 42: Line 57:
 } }
 </file> </file>
 +
  
doc/appunti/linux/sa/sieve_filtering_tnef.1621853109.txt.gz · Last modified: 2021/05/24 12:45 by niccolo