i think the email routine is not very efficient and not easy to interact with from a extension building script
i suggest to create a php page with a form , where it is possible to enter an email and upload 4 files of the extension and thats all.
then it will be possible to plan automation of extensions testing and publishing.