     else
       When(@_fileSource()).then (filename) =>
         (@_write filename, outname).promise
-      .ensure =>
-        @_cleanup '_tmpFilename'
+      .ensure => @_cleanup()
     bindCallback promise, next
 
   toBuffer: (next) ->

    if @_stdin
      @_stream @source, res
    else
      res.once 'end', =>
        @_cleanup '_tmpFilename'
      res.once 'error', =>
        @_cleanup '_tmpFilename'
      When(@_fileSource()).then (filename) =>
        @_stream filename, res
      .otherwise (err) ->

      When.reject new Error 'Mailformed source'
    @_tmpFilename = done.then -> filename

  _cleanup: ->
    return unless promise = @_tmpFilename
    delete @_tmpFilename
    When(promise).then (filename) ->
      nodefn.call fs.unlink, filename if filename
    .otherwise ->
