# insert here your address MOBIL = "+420605XXXXXXXX@sms.paegas.cz" :0fhw * ^From:.*<\/.*[^>] | formail -f -t -I"From: $MATCH" -X"From:" # to be sure that quoted-printable in headers got converted to 8 bit # De-mangle RFC 2047 header mangling :0Hhfw * =\?[^?]+\?[qb]\?[^?]+\?= | $HOME/bin/dmmh # remove all fields except From: and To: and insert X-Loop: shortened as X-L: :0fhw | formail -f -t -k -XFrom: -XSubject: -XReceived: -XDate: # decode quoted-printable inside body :0Bbfw * =E1 | mimencode -q -u # get rid of Czech characters INCLUDERC=cestina.rc # last trial to remove all czech characters # use perl script cstocs (http://packages.debian.org/stable/text/cstocs.html) to convert ISO-LATIN2 to ISO-LATIN1 :0 fhbw | cstocs il2 il1 | tr 'í' 'i' # kill HTML attachments and some signatures INCLUDERC=att.rc # delete signature from the --[space] till the next empty line :0bfw | sed -e '/^--\ $/,/^$/d' # remove all quoted lines :0bfw | grep -v "^>" # remove notes about antivirus checks # v [no space below after 3 minus signs]! # --- # Příchozí zpráva neobsahuje viry. # Zkontrolováno antivirovým systémem AVG (http://www.grisoft.cz). # Verze: 6.0.151 / Virová báze: 72 - datum vydání: 19.5.2000 :0bfw | sed -e '/^---$/,/^$/d' # now we want to remove these strings remaining in Reply messages: # On Wed, 21 Mar 2001 10:43:34 +0100, David Komanek says :0bfw | sed -e '/^On\ \(Mon\|Tue\|Wed\|Thu\|Fri\|Sat\|Sun\).*\ says/,/^$/d' # Dne 12.| březen| 2001, Martin MOKREJŠ, napsal: :0bfw | sed -e '/^Dne\ .*napsal:/,/^$/d' :0bfw | sed -e '/^-----\ Původní\ zpráva\ -----/,/^$/d' # ---------- Forwarded message ---------- # Date: Mon, 14 May 2001 12:59:01 +0100 # From: Miroslav.Divko@slovnaft.sk # Reply-To: montana@natur.cuni.cz # To: montana@natur.cuni.cz # Subject: RE: [montana] mate na 100 km ? # # > Kto sa boji , nesmie do lesa # > # > 2.6.2001 - 3.6.2001 TRNAVSKA STOVKA - 28 rocnik # > :0bfw | sed -e '/^----------\ Forwarded\ message\ ----------/,/^$/d' :0bfw | sed -e '/^\ \ This\ message\ is\ in\ MIME\ format\.(\ |)\ The\ first\ part\ should\ be\ readable\ text/,/^$/d' :0bfw | sed -e '/-----\ Original\ Message\ -----/,/^$/d' :0bfw | sed -e '/-----Original\ Message-----/,/^$/d' # Toto je zpráva ve formátu MIME obsahující více částí. # This message is in MIME format. Since your mail reader does not understand # this format, some or all of this message may not be legible. # This is a multi-part message in MIME format. # ----- Původní zpráva ----- # Od: "Martin Mokrejs" # Komu: "Lexon" # Odesláno: 25. dubna 2001 17:30 # Předmět: Prispivas do konference ze spatne adresy # # > Ahoj, # > # > asi pred dvema mesicema jsem si koupila boty # > za podobnym ucelem: # > # > # Note on Czech Paegas network # the e-mail to SMS gateway converts ~ into ? and \ into / # Rewrite the body; "flatten" whitespace, then throw away # anything after the 160th character # # Note this structure of SMS messages: # F: email@address S:up to 15 chars of subject-body of message separated by a single dash form the subject, the total length is 160 chars # :0bfw | tr '\011' ' ' | tr '\n' ' ' | tr -cd '[]a-zA-Z0-9~!@#$%^&*()_+-= .,:/\\"?{}\|<>' | tr -s ' ' # split the mails :0fwib { INCLUDERC=$HOME/etc/procmail/split-to-pager.rc } # log everything sent to you mobile phone :0c: $HOME/tmp/mobil.log # make sure there's only 160 chars left :0fhbw | cut -c 1-160 # log everything sent to you mobile phone :0c: $HOME/tmp/mobil.log # Send of the reformatted copy to a real pager :0 ! $MOBIL