Before you try to compile it, you have to know that packages exist for some systems.
you can find it in ports/mail/libetpan.
This is in the package collection.