REBOL [
    Title: "Email client"
    Date: 14-Jul-2001
    Version: 1.0.0
    File: %emailclient.r
    Author: "Tommy Giessing Pedersen"
    Purpose: {A fullblooded email-client that checks, orginizes and sends emails! autoupgradable!}
    Email: nite_dk@bigfoot.com
    Web: http://www.bigfoot.com/~nite_dk
    library: [
        level: none 
        platform: none 
        type: none 
        domain: [email GUI] 
        tested-under: none 
        support: none 
        license: none 
        see-also: none
    ]
]

write %readme.txt trim {
REBOL Email Client by Tommy Giessing Pedersen
=============================================

This archive contains the following files:

read.r
Use this script to read, reply or forward email in your in- and
outboxes. The script saves the text you last view in
readmail.txt.

check.r
This script checks your pop-server for incomming email
periodicaly. When an email arrives the rebol editor appears with
the email that just came in. To archive it just close the editor
and select a destination.
The script creates a file called check.tmp to indicate that the
check.r script is running. To stop the script you must delete
this file manually or just by running check.r again. The script
will then terminate within a minute. It's a good idea to add a
line in your computers startup-script to delete this file every
time you boot your computer.

send.r
To send an email just run this script and edit the head and
message of your email. You may use your own editor if you like
by editing oumail.txt while the rebol editor is present. To send
your email simply close the rebol editor and select where you
want to archive it.

mboxconv.r
this script should only be used by experienced users. It may be
modified to serve you needs.

The scripts automatically creates the following files:

inbox/ and outbox/ folders
Theese folders contains your incomming and outgoing emails.

head.txt
You can use this file to add extra emailhead data for your
outgoing emails. For example you can add "reply-to:" if you
want your recipients to reply to another email-address.

signature.txt
In this file you can add a little "Yours cincerly" or
however you would like to end your emails.

    Good luck! :-)
        Tommy Giessing Pedersen, nite_dk@bigfoot.com
}

write %read.r decompress #{
789CED584B6FDB46103E4BBF624CC0408382961D3417A2ADFA88D34B8116A981
1E043958914B722D72975E2E6DB9BFBEB32F527C1991EB1E0244806569DE3B33
FB71461FAF7FF9E377D82C6E982A68B408AE4BC20A9094245406CBC57BA2907A
F55D78D714E1DBCBCBABE5E2E746E542A2E88D28CB27F88DD1BA663C833F29AA
D494A39631122D3853F453B2FF69C7B2540875118B12B6CB654D555345900828
0449E0DC7CBF904B9602170AE881D5AA5EC339E33B715801C0620325D9D33061
B2A56E47E2A25153F29E3C56C8F19017EAA050FC5162A81D05826042BE661927
AA91B4AFD4235BCDA5A4F70DAD55484D22206D780C1B486107AB42C4A4000E98
0AD82C315A7493B282AE91B9815D6493B2432BC82BD075640E033B54DC9FA188
61948ECAB8A219956770A9A9A9C0C2C53918B7DA9E263A69F816AEDC57C3D667
8D809595902E4E4B7732A4AA284F4C00D80D778271748D872B21804FF8D7DA58
25D822E60DA9618F934A518E8875B3BBA3B1B2C7306F8C63DC2514E4096BD5C6
FC90BFB547AC95C4F63A83D431143DA8D0C4F5EEF2F2803D09E89C4064481BE0
C3CCA44C22A322D89BF0408A86625539859C2534AC44D554360A7CED1AA50487
E057C2635A04686C2864DEF8122B8CFF75830C9A554952E7F608257E77C53C66
6AD6638EF546EB19564B51B98682F24CE56BA303E63A58E19AFD43759B60054A
F180316302AD9009A42648EB79D6BCE5B61798EBFF99C88EB9AF1F5ACFB78B6D
E95D28D9507F0766FBDC77B4BE21BD64A2C0718B9A06F52C233CA7EEF1604ADF
F33A0335DE0E23E113A75911F8FB6D74839A16BAA3353B6885750DEE1B52AC5B
35DB77BEBF916FD3491A259A2A9388B81814A2E2B9B92C71C1285717B2EDCEFB
86A9B6078D086FF0629B4B7D5C3AC4ACD079F652D6F3B6C383AE037C70C7D060
ECF620AC3B83A9627B82595FDE938ECBC2A47EA468118392158BF7B65BBC5A27
3F874EDA40DFCC914EC2949073DC6980E960C61790C48A091E053D010F0A9256
C55330D0C6570711438E3B38FA6CCF6DCFE01F33930A2BD796033D8FC01F1053
23B84524B6DDC34989C07B1BC0F79E62B315FC78BB0ADADEE912C5544E251CD7
CCA0B2395DA8C4A87A27057723A28907C06420DB5773D2863EE3682605294317
E3C752F0F13A9AA8F267C6F697B5124D3EF15E3B11AD330CF914872F693B3307
A2132542669EF55C3CCED89F37A7E55FE2FC07F7022159C6388E4F25CE9C24A3
E0268CD1C8E1354E0CB0B3130B1C1FF88B6E681BAD9611E9FF1EB4C594DE14DA
53DE4EC21922E22391C9170F689F8B18CFA1E11C147CF8FBFD1787053AE6AF60
F0150C4E02033DC19F8404094E867612D6F3C2283C3789BA29C30B0FA7D0E397
5D00CC446AF7B5BA2A980A2BA2F26EF6EC0DE3B3114DCEE69A8D79B7F3DD9C8D
6E64EF87BC99B0AEB7D095D23F9A40D0373EAAD63319D1BF16FC57F32382DBC8
EA3DABEC8CFD4D379C8770056F860A66599B9AF027B26B7634FDF1CCEE4CF3D5
F23A53B62677BD6129DC06DB266BE3544D97B4D491AABB165AE0D99DE1E8ECAD
31FDE199FB52901D2D266F102E4239E3D9D46F06234383EDBCBDBB76F9AB31F8
A3ADCFFDEC807BF3BF0CC1C5C7AA130000}

write %check.r decompress #{
789CAD555BAF9B46107E36BF628C14F5C970725155F1724EAB467DA9D4AACD4B
65391507C6B0F1B2437687E0F3D2DFDED9051B88398A12C5920D9EFB7CF3EDEC
5F6F7FF9E377D86FDE29D6986DE2B74DAE3414351627B471B4F9356711BF7CB3
FBD0E9DDABBBBB97D1E6E78E6BB262FB8E9AE6097E53E89C3215FC89255A8746
BC42946C6314E3BFE5E9E1515547224E0A6AE010450EB96B33280934E525BC08
FF131BA9231862C0B372ECEEE185328F744E379B3D34F90977A5B2179944F9DC
983ABEB51E852BE635E665C26716F3DE4A999304E278C5DEA9CAE4DC595C3A2D
C48367D4E6CEF56516CA00C756B0D942E8316DA9F5DA0815D768A7E801EF849B
16F61100287324DBA4AC1A940E40E74FFEB107B2AA52067E3ABF814FF52B88FF
AE3B660F7D49BD019C8F2E491229065E43AD4ADC49DEAEF5914BD4E8EBBE26F4
C28F9DE2E8F075A9173C912E73CB58AEA61424F16397EBFB250602AF41097C41
CB8A113ADEF9FF2919FD2450FA8233E873C5F0E35D1486B206596840CCC7994C
9A787895FA0AAB5A06E5A0E8AC45C312DE76C60876EFD31113AE457D545ADE48
1AA21614BF4FE328EA6B2FDCAFA51E417B8ED05FEE7E21CC463086CE3DC042DE
91479DD55BC1E803C910F6108B4796A6F1E4DF3919439CC59FA5891F669221EE
0CC49AD987E9FB3EE95F2764ABA11DF9042EB56439036AD15C8A19B5869A0C34
9A8AEBFBC974544AFCCAA2AC0D7BEF0DE1EE1AF42BE8F50F753F7C42A8E40836
0F4A6FD788259FC3F8D424DDF964B354231B94F1F585E37954D6F14DBDBEDB52
31D9B9EDA42B85949E155918D92CFC8515C3742F66C3600FF3427C7D82773692
63DC604E2A08F285E194ED721EBC09C44E385A70502B59388A8C8CFAC67B22DB
B29CFD4A5CC633CB1C64EB43BC0C7B58C47CAE4FBFEBBE3DF0610DE04074FFBA
85C0F378802ABE9A2C9D4687474DC5692BA5CC62CE387E2D783F3A85295CA533
A7BC15A60F2A696618D52D1F5C2EBCBCBAFB974967B121D1FA9BE48666974485
26876B876638A679C7D4B595CD4B5C9C9B9B435B5383494F5697B22C95C1A43C
A5FFB1BF91AB36F5B5B9D4D191FBDC626AF191741A72165AC9FA9395B824E878
5896260184EF93EE76F2E1197EFC371CE00181B05DADEC0F99D8730B7FBA1584
8407B919A26FBBB76449359E9F58DE6E98FF01EAE0E90E1A090000}

write %send.r decompress #{
789C95544D4FDC30103DC7BF62D612C710A01CAA0895B62AEDA552AB96DB6AA9
BCC9ECAE21B1537B02CBBFEFD8F9D85D485B38C5797EF3663C5F3FAE3E7EFB0A
F3E45A53857922AF6AA52BF0684A7452249F14317A7A9EDEB6557A7672722A92
0F2D6DAC63EAB5ADEB47F8A2D17B6DD6F01DD9840DD92A8AE489D184BFCABBF7
4BBD5E594BC785AD612184476A9B1C4A0B9555251CC5FF6327F40A8C25C0ADF6
E42FE1489BA5DD664932875ADD615A6A3760ACF2946C5B7ACEEEC109FA065579
4C5B62FA83E33077084839C1F77A6D14B50E0F8D0EE0CE722AB2908EC8980B80
C1761F7718123184309232D5345C89A7DC5BAB0DCC417E76B6CEE186DDC61466
46D508F246C2C58060ACA67C779385D05E287B6D736081474F5867BE70BAA14C
B9B567E9D7C8FC6C97B75850CED930F82ACBD8741C02D954977C66858717390F
9CFF39891DB75F36C135C3529375075406C331D424075D37D651DAA5B3D3D8A7
D63C026ACD318F2659610DA121F10CC9637F8227C74333E39E193A26C5DFADAA
2EF734C8C6DC714AC23C6601437778DF7BDE8163EF3E972B8A7FCBF1FDA49C59
595767A46BE43743A51EC3670ED6E935D7EBEDF61CEE3767B0DB1C34E342C11B
D8E812D3C6366D2344899E569A374C0C413C6CF8CC1A7D8CC36D17DFA21B938A
E727EF57C430C89EAB102F0261A7E958877FD27003D263C57D17AF3597595B93
CBD1889333E9743E2147B8257E372F4690876A5D1FFEE511610DBC5A6FB197A2
D820E138833812B27FBE1C3523B9272E2B5BDCCDD861ACFCB076C668BA40FA44
8EE842F4D31190898EF6EA1E77EC7010625FFE70AB31A1C2A73B8DC7EA0FD39E
27775D060000}

if not exists? %mboxconv.r [
write %mboxconv.r decompress #{
789C85524D538330103D935FB1E58E6DF5C6A5EA58BDE8E838BD751827850552
428249DAEABF77892DC516358790D9F7B16F495EE7B7CF8FB00C16C2498C83F0
890BB9D21F906AB545E3D0842CB8E38EA0E955B4DEC8E8723299B2E066E34A6D
88BFD075FD090F02AD15AA8017CCD05854A49AD76415074A387CCBAAEB952872
ADDD45AA6B4818CB8544C56BB431187CDFA075515B1A57880D63BB92CEB004A5
5D44289733E804545408092C1900E4DA204FCB0EEDD13C4E4BE4D05918EBA81D
CFC65228A274AAF0DE50AC28EC44AD3581F110FB48F113D25E21586768FE1184
610FA61FB9875752A7D588264A7A0DF6D95B776FDEEF4E0B852BD11CC27BD650
CE6ECA82ECE8C2888AAA70E5CCC783C93997166F1A54994FE869A794E4B4F0CF
A8ADE4BCD1A14B9B63AD85FA1E42E1AEFDFE14B3A1E3EF292DDF1EEFDA13584F
ED37FF3CFE7A6509FB02A1B7D59EFD020000}
]

if not exists? %setup.r [
   setup: make object! [
      name: "The man with no name"
      email: someone@somewhere.com
      smtp: "smtp.goingout.net"
      pop: "pop3.goingin.org"
      popuser: "someone"
      poppass: ""
      checkrate: 10
      trashsize: 10
      autoupgrade: true
   ]
   print "Setup:"
   setup/name:    make string! ask "Your name:   "
   setup/email:   make email!  ask "email:       "
   setup/smtp:    make string! ask "smtp-server: "
   setup/pop:     make string! ask "pop-server:  "
   setup/popuser: make string! ask "username:    "
   setup/poppass: make string! ask "password:    "
   save %setup.r setup
]