Fixes mime type detection (didn't work on my mac)

prints the url of the attachment (so it can be used in scripts)