1234567891011121314151617181920212223openCoreopenAsyncopenAsync_smtpletmain()=letstdin=Lazy.forceReader.stdininletstdout=Lazy.forceWriter.stdoutinletpipe=Smtp_server.read_bsmtpstdin|>Pipe.map~f:Or_error.ok_exninlet%bind()=Pipe.iter_without_pushbackpipe~f:(funm->letemail=Smtp_envelope.emailminWriter.writestdout(Sexp.to_string_hum(Email.sexp_of_temail)))inWriter.flushedstdout;;letparse=Command.async~summary:"Parse BSMTP from stdin and output as sexp"(Command.Param.returnmain);;letcommand:Command.t=Command.group~summary:"BSMTP tools"["parse",parse]