How to activate advanced scripts

Discussion forum for Enterprise Edition.
Post Reply
menteinfinita
Posts: 18
Joined: Fri Mar 01, 2019 4:03 pm

How to activate advanced scripts

Post by menteinfinita »

I would like to create a script to indicate that if the user is not authenticated he can not use the relay, I do not know how to activate the scripts, I have read in several forums and have different ways of using them and that confuses me, besides I do not know how to know if the scripts are running, could you help me with this ?, I would like to create at least a simple script and make sure it is working.

This is the original file

Dim ME_ResultData
Const ME_Success = 1
Const ME_Failure = 0

' ME_ResultData is the string that will be used as the response string
'
' Return ME_Success for the command to succeed
' Return ME_Failure for the command to fail
'
' See comments in each function for further details about returning success/failure
'
' Available substitutions. Wrap with %, eg. %SUBSTITUTION%
'
' IPADDRESS IP address of the connection
' POSTOFFICE Postoffice which
' SENDER Sender address in MailEnable format ([SMTP:address])
' RECIPIENTS Recipient list ([SMTP:address];[SMTP:address];etc)
' RECIPIENT Current recipient address
' RESPONSE The response that willl currently be sent
' HELO The string the remote server sent in the EHLO/HELO command
' SENDERAUTH 0 or 1 depending on whether the sender has authenticated

function ME_MAIL()

if %SENDERAUTH%=1 then
ME_ResultData = "250 %SENDER% connection from %IPADDRESS% authenticated." & Chr(13) & Chr(10)
else
ME_ResultData = "250 %SENDER% OK." & Chr(13) & Chr(10)
end if

ME_MAIL = ME_Success


end function


function ME_RCPT()

'Returning a failure will stop the recipient from being accepted by MailEnable
'If you return a success, MailEnable will still do all subsequent checks and
'can still reject the recipient. ME_ResultData is only used if this function
'returns ME_Failure

ME_ResultData = "250 OK" & Chr(13) & Chr(10)
ME_RCPT = ME_Success

end function


function ME_DATA()

'ME_ResultData is only used if this function returns ME_Failure

ME_ResultData = "354 OK" & Chr(13) & Chr(10)
ME_DATA = ME_Success

end function


function ME_GetResultData()
ME_GetResultData=ME_ResultData
end function



Where I could to see the message "ME_ResultData = "250 %SENDER% connection from %IPADDRESS% authenticated." & Chr(13) & Chr(10)" for example

Post Reply