Re: Filtr na PMMail

Autor: Adam Płaszczyca (_555_at_irc.pl)
Data: Tue 23 Sep 2003 - 15:36:53 MET DST


Ninik <ninik_at_dominik.kei.pl> wrote:

> Zapodaj ten drugi na grupie... CZasem brakuje linijki o mime, czasem o
> kodowaniu itd :( Przyda się więc..

A prosze bardzo:

/*hau!*/
PARSE arg fmsg
rc=STREAM(fmsg,'c','OPEN')
msg.0=0
x=0
/*read whole message*/
do while lines(fmsg)>0
   x=x+1
   msg.x=linein(fmsg)
end
msg.0=x
h1=0
h2=0
h3=0
/*look for header part end and if 'content' header present*/
x=1
he=0
do while msg.x<>''
   if left(msg.x,13)='Mime-Version:' THEN h1=1
   if left(msg.x,13)='Content-Type:' THEN h2=1
   if left(msg.x,26)='Content-Transfer-Encoding:' THEN h3=1
   x=x+1
end
he=x

if h1+h2+h3<3 then
do
   rc=stream(fmsg,'C', 'SEEK 1')
   do x=1 to msg.0
      if x=he & h1=0 then rc=lineout(fmsg,'Mime-Version: 1.0')
      if x=he & h2=0 then rc=lineout(fmsg,'Content-Type: text/plain; charset=ISO-8859-2')
      if x=he & h3=0 then rc=lineout(fmsg,'Content-Transfer-Encoding: 8bit')
      rc=lineout(fmsg,msg.x)
   end
end

rc=stream(fmsg,'c','close')
return 0

-- 
     ___________ (R)  
    /_  _______      Adam 'Trzypion' Płaszczyca (+48 502) 122 688
  ___/ /_  ___       ul. Ludwiki 1 m. 74, 01-226 Warszawa
 _______/ /_     IRC: _555, http://trzypion.oldfield.org.pl/wieliczka/
___________/     mail: _555_at_irc.pl UIN: 4098313 GG: 3524356


To archiwum zostało wygenerowane przez hypermail 2.1.7 : Tue 18 May 2004 - 15:43:35 MET DST