Procmail filter for automatic windows-1251->koi8-r processing

Procmail is the ultimate incoming mail processor. Get and compile latest procmail version first, read the manuals, especially procmailrc(5) and add following lines to your ~/.procmailrc. Please notice that ^I sequence represent real TAB character, so don't cut&paste this example literally, download the variant where TABs preserved instead. The string "fromwin -b" below is not part of procmail system and means any filter which decode stdin to stdout using windows-1251->koi8-r decode table, I recommend d1489 converter, just follow the link.

:0
* ^Content-Type:[ ^I]*text/plain[ ^I]*;[ ^I]*charset="?windows-1251"?
* ^Content-Transfer-Encoding:[ ^I]*[78]bit
{
  :0 fw
  | fromwin -b

     :0 Afhw
     | formail -I "Content-Type: text/plain; charset=koi8-r"

}

:0
* ^Content-Type:[ ^I]*text/html[ ^I]*;[ ^I]*charset="?windows-1251"?
* ^Content-Transfer-Encoding:[ ^I]*[78]bit
{
  :0 fw
  | fromwin -b

     :0 Afhw
     | formail -I "Content-Type: text/html; charset=koi8-r"

}


продвижение сайтов недорого
Table of Contents: