Okay, I am creating a mail client because I just can't find one that does what I want it to do and with the efficiency I require (please don't make suggestions for your favourite client). Essentialy what I am looking for is suggestions on a plan of attack for this.

The protocols that I am going to introduce in the initial implementation will be SMTP (sending) and IMAP4rev1 (recieving) as this is what I use on my lan.

Are there any particular pitfalls that I should watch out for when coding the client? Any good sugestions regarding technique?

I will be using the C language and writing it for Linux based machines (CLI first, then eventually a GUI though this is kinda of topic).

As far as features that I am wanting to implement.

--> Speed and reliability
--> Security
--> Signing and Encryption / Decryption
--> SSL Connections

Stuff I won't be considering though may impact design.
--> HTML viewing

Stuff that may be implemented
--> Website launching via external prog, eg Mozilla
--> Spam Filtering (almost a must for commercial / successful aplications).

Any help would be greatly apreciated.