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 currently 0.35 for -stable and -current.
This is in the package collection. This is currently 0.35
This is currently 0.33.