AKG Sentvid, linux mail kodiranje


Linux - uencode, udecode, base64,

Se dopolnjuje!!!!!!!



1) base64 uudecode zna dekodirati base64, zacetek je (begin-base64 644 sova), konec pa (====). primer: za fajl abc z vsebini "BCdef h" posta]$ uuencode --base64 abc xime begin-base64 644 xime QkNkZWYgaAo= ==== Bolje posta]$ uuencode --base64 abc cde > xime ]$ vi xime begin-base64 644 cde QkNkZWYgaAo= ==== ODKODIRAM ]$ uudecode xime in dobim cde z vsebino "BCdef h"
2) uuencode-irana @server posta]$ uuencode fajl.gif fajl2.gif > fgu -zacetek je (begin 644 fajl2.gif), konec pa (` end) Glej spodaj, recimo @server posta]$ vi fgu begin 644 fajl2.gif ClNPVkE6CiAgICAgICAgLS4tLi0uLS4tLi0uLS4tICA8LSBSCiAgICAgICAg ICAgICB8CiAgICAgICAgIG8gbyAqIG8gbyBvIG8KICAgICAgICAgICAgIHwK ICBMIC0+ICAtLi0uLS4tLi0uLS4tLi0KCgRDM+0H` ` end dekodiranje je @server posta]$ uudecode fgu dobiš r@server posta]$ ll fajl2.gif -rw-r--r-- 1 xuser users 59729 Feb 6 14:37 fajl2.gif
3) pretvorba poste iz maila v datoteke z ripmime @server ripmime-1.3.dev]$ wget http://pldaniels.com/ripmime/ripmime-1.3.dev.tar.gz @server ripmime-1.3.dev]$ gunzip ripmime-1.3.dev.tar.gz @server ripmime-1.3.dev]$ tar xvf ripmime-1.3.dev.tar @server ripmime-1.3.dev]$ cd ripmime-1.3.dev @server ripmime-1.3.dev]$ make @server ripmime-1.3.dev]$ ./ripmime -i /var/spool/mail/zvicar -d /home/zvicar/posta @server ripmime-1.3.dev]$ ll -rw-r--r-- 1 zvicar users 37 Jan 30 16:15 textfile0 -rw-r--r-- 1 zvicar users 290 Jan 30 16:15 textfile1 -rw-r--r-- 1 zvicar users 253 Jan 30 16:15 textfile2 -rw-r--r-- 1 zvicar users 22506 Jan 30 16:15 textfile3 -rw-r--r-- 1 zvicar users 196673 Jan 30 16:15 textfile4
4) uudeview zna decodirati base64 in uuencode-irana - kako do pomoci [ddddd@vir posta_bilten]$ info uudeview - spodnji da novo verzijo avtomatsko pri ponovitvi fajla [ddddd@vir posta_bilten]$ uudeview -i +o +a textfile4 - spodaj prepise stare fajle [dddd@vir posta_bilten]$ uudeview -i -o textfile4 @server posta]$ uudeview textfile4 Loaded from textfile4: 'Fw: test 1 attach' (Fw): grafmrk06_2.gif part 1 Base64 Loaded from textfile4: 'Fw: test 2 attach' (Fw): grafmrk06_2.gif part 1 Base64 Found 'grafmrk06_2.gif' State 16 Base64 Parts 1 OK Found 'grafmrk06_2.gif' State 16 Base64 Parts 1 OK -rw-r--r-- grafmrk06_2.gif is OK [d] (?=help) *** Target File /home/zvicar/posta/grafmrk06_2.gif exists! Options: *** (O)verwrite, Overwrite (A)ll, Overwrite Non(e), *** (R)ename, Au(t)o-Rename, (N)ext, (P)ath [o] R Enter new filename: grafidv.gif File successfully written to /home/zvicar/posta/grafidv.gif -rw-r--r-- grafmrk06_2.gif is OK [d] (?=help) *** Target File /home/zvicar/posta/grafmrk06_2.gif exists! Options: *** (O)verwrite, Overwrite (A)ll, Overwrite Non(e), *** (R)ename, Au(t)o-Rename, (N)ext, (P)ath [o] N 1 file decoded from 1 input file, 0 failed ----------------------------------!!!!!!!!!!!!!!! Instalacija uudeview je na: http://fpx.de/fp/Software/UUDeview/Install-Unix.html#install @server posta]$ uudeview --help UUDEVIEW 0.5pl20 - the nice and friendly decoder - (w) 1994 Frank Pilhofer usage: uudeview [options] [file ...] Options: -i Disable interactivity (do not ask, decode everything) -a Autorename (rename file if it exists on disk) -m Ignore the file mode of uuencoded files +e/-e Include or exclude extensions exclusively -d Sets 'desperate' mode (process incomplete files) -f Fast mode. Only if each file holds no more than one part -o/+o -o OK to overwrite files, +o never overwrite files -b1 Select alternate bracket policy -p path Sets path where to save decoded binaries to -c Autoclear files that were successfully decoded. -s Be more strict on MIME adherance. -q Quiet. Do not emit progress messages. See uudeview(1) for more details. Example: uudeview +e .jpg.gif -i newsfile This decodes all .jpg or .gif files encountered in without asking.
5) rocno prebiranje poste @server programi]$ mail Mail version 8.1 6/6/93. Type ? for help. "/var/spool/mail/zvicar": 7 messages 6 unread >U 1 MAILER-DAEMON@server. Tue Aug 19 11:44 57/1726 "Returned mail: see tr" U 2 MAILER-DAEMON@server. Tue Aug 19 11:48 73/24207 "Returned mail: see tr" U 3 MAILER-DAEMON@server. Tue Aug 19 11:56 73/24231 "Returned mail: see tr" U 4 MAILER-DAEMON@server. Tue Aug 19 11:56 74/24234 "Returned mail: see tr" U 5 MAILER-DAEMON@server. Tue Aug 19 11:56 73/24231 "Returned mail: see tr" U 6 MAILER-DAEMON@server. Tue Aug 19 11:57 73/24231 "Returned mail: see tr" 7 hipe@rzs-hm.si Thu Jan 25 08:08 71/2331 "Re: Preusmeritev prip" & w1 p.pos "p.pos" [New file] & x @server programi]$ ll p.pos -rw-r--r-- 1 xuser users 59729 Jan 25 17:01 p.pos ----------------------------------------------- ----------------------------------------------- ----------------------------------------------- ----------------------------------------------- ----------------------------------------------- ----------------------------------------------- ----------------------------------------------- ----------------------------------------------- ----------------------------------------------- ----------------------------------------------- Primer konkretne enostavne uporabe, za crontab Kako extrahiramo (priponke) posto v linuxu in kopiramo v (na) intranet (posta_kors_cp.sh) Posto dobivamo od korsa iz naslova kors@mors.ka na z.hribovsek@rzk-m.ka - kjer na pcju avtomaticno iz Outlook Express 6 (Tools -> Message Rules -> Mails ... Apply this rule after the message arrives Where the From line contains 'kors@mors.ka' Forward it to zhribovsek@griva-rzk-m.ka ) prejeto posto forwardiramo na zhribovsek@griva-rzk-m.ka -posto bo treba obcasno rocno ocistiti /var/spool/mail/zhribovsek Kako rocno brisemo posto iz /var/spool/mail/zhribovsek Uporabimo ukaz mail ... pridemo v seznam poste, z ukazoma spodaj & d2-7 & q izbrisemo posto iz nabiralnika od zap. st. 2 do 7 ------------------- [zhribovsek@griva programi]$ chmod +x posta_kors_cp.sh -- sledi vsebina [zhribovsek@griva programi]$ vi posta_kors_cp.sh cd /home/zhribovsek/posta_bilten rm textfile* rm text_posta rm b*.pdf /home/zhribovsek/posta/ripmime-1.3.dev/ripmime -i /var/spool/mail/zhribovsek -d /home/zhribovsek/posta_bilten cat textfile* > text_posta uudeview -i -o text_posta for i in *; do mv $i `echo $i | tr [:upper:] [:lower:]`; done cp /home/zhribovsek/posta_bilten/b*.pdf /home/zhribovsek/public_html/www/kors_bilteni rm textfile* rm b*.pdf rm text_posta ------- v [zhribovsek@griva programi]$ vi cron_table 15 8 * * * /home/zhribovsek/programi/posta_kors_cp.sh >/home/zhribovsek/sql_vhodne/posta_kors_cp.sh >2>/home/zhribovsek/sql_vhodne/posta_kors_cp.log 40 10 * * * /home/zhribovsek/programi/posta_kors_cp.sh >/home/zhribovsek/sql_vhodne/posta_kors_cp.sh >2>/home/zhribovsek/sql_vhodne/posta_kors_cp.log ----- na http://griva.rzk-m.ka/~zhribovsek/www/kors_bilteni/kors_bilteni.html pa so pdf bilteni, ki se berejo kot pdf - podstarni kors_200*.html so do 2025

Za astronomski krožek: ZORKO Vičar


RFC-822: Zorko.Vicar@guest.arnes.si


Nazaj na domačo stran.