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

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

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

    else
      When(@_fileSource()).then (filename) =>
        (@_write filename, outname).promise
      .ensure => @_cleanup()
    bindCallback promise, next

  toBuffer: (next) ->
