Added MANY security fixes done by Mike Garrett and Gordon Dickens. Thank you!
This commit is a vanilla copy of the one at http://code.google.com/p/vexim/source/detail?r=9951e1422d5a83881297fdd99342937e99781675. It seems Avleen had forgot about that patch...
Merging 5c142345e2ad4c34c4b79db3f5cf479fd5e40522 and e29a58a67e027cc554fa605114c8cc06c7c3d1e0.