12/**3* Client is a minimal SMTP client for nuclei scripts.4* @example5* ```javascript6* const smtp = require('nuclei/smtp');7* const client = new smtp.Client('acme.com', 25);8* ```9*/10export class Client {111213// Constructor of Client14constructor(public host: string, public port: string ) {}151617/**18* IsSMTP checks if a host is running a SMTP server.19* @example20* ```javascript21* const smtp = require('nuclei/smtp');22* const client = new smtp.Client('acme.com', 25);23* const isSMTP = client.IsSMTP();24* log(isSMTP)25* ```26*/27public IsSMTP(): SMTPResponse | null {28return null;29}303132/**33* IsOpenRelay checks if a host is an open relay.34* @example35* ```javascript36* const smtp = require('nuclei/smtp');37* const message = new smtp.SMTPMessage();38* message.From('[email protected]');39* message.To('[email protected]');40* message.Subject('hello');41* message.Body('hello');42* const client = new smtp.Client('acme.com', 25);43* const isRelay = client.IsOpenRelay(message);44* ```45*/46public IsOpenRelay(msg: SMTPMessage): boolean | null {47return null;48}495051/**52* SendMail sends an email using the SMTP protocol.53* @example54* ```javascript55* const smtp = require('nuclei/smtp');56* const message = new smtp.SMTPMessage();57* message.From('[email protected]');58* message.To('[email protected]');59* message.Subject('hello');60* message.Body('hello');61* const client = new smtp.Client('acme.com', 25);62* const isSent = client.SendMail(message);63* log(isSent)64* ```65*/66public SendMail(msg: SMTPMessage): boolean | null {67return null;68}697071}72737475/**76* SMTPMessage is a message to be sent over SMTP77* @example78* ```javascript79* const smtp = require('nuclei/smtp');80* const message = new smtp.SMTPMessage();81* message.From('[email protected]');82* ```83*/84export class SMTPMessage {858687// Constructor of SMTPMessage88constructor() {}89/**90* From adds the from field to the message91* @example92* ```javascript93* const smtp = require('nuclei/smtp');94* const message = new smtp.SMTPMessage();95* message.From('[email protected]');96* ```97*/98public From(email: string): SMTPMessage {99return this;100}101102103/**104* To adds the to field to the message105* @example106* ```javascript107* const smtp = require('nuclei/smtp');108* const message = new smtp.SMTPMessage();109* message.To('[email protected]');110* ```111*/112public To(email: string): SMTPMessage {113return this;114}115116117/**118* Subject adds the subject field to the message119* @example120* ```javascript121* const smtp = require('nuclei/smtp');122* const message = new smtp.SMTPMessage();123* message.Subject('hello');124* ```125*/126public Subject(sub: string): SMTPMessage {127return this;128}129130131/**132* Body adds the message body to the message133* @example134* ```javascript135* const smtp = require('nuclei/smtp');136* const message = new smtp.SMTPMessage();137* message.Body('hello');138* ```139*/140public Body(msg: Uint8Array): SMTPMessage {141return this;142}143144145/**146* Auth when called authenticates using username and password before sending the message147* @example148* ```javascript149* const smtp = require('nuclei/smtp');150* const message = new smtp.SMTPMessage();151* message.Auth('username', 'password');152* ```153*/154public Auth(username: string): SMTPMessage {155return this;156}157158159/**160* String returns the string representation of the message161* @example162* ```javascript163* const smtp = require('nuclei/smtp');164* const message = new smtp.SMTPMessage();165* message.From('[email protected]');166* message.To('[email protected]');167* message.Subject('hello');168* message.Body('hello');169* log(message.String());170* ```171*/172public String(): string {173return "";174}175176177}178179180181/**182* SMTPResponse is the response from the IsSMTP function.183* @example184* ```javascript185* const smtp = require('nuclei/smtp');186* const client = new smtp.Client('acme.com', 25);187* const isSMTP = client.IsSMTP();188* log(isSMTP)189* ```190*/191export interface SMTPResponse {192193IsSMTP?: boolean,194195Banner?: string,196}197198199200