imapd: write out a first working draft

Since we can't seem to be able to modify GMail mailboxes, the best we
can do is to see if the given filename already exists.