Username Post: Mail Interception        (Topic#5655)
Jonathan_McHarg 
stranger

Posts: 21
03/08/04 12:19 PM - Post#5655    



Hi everyone,

here is a little script I have been testing. It will enable you to create a text file of e-mail address's which you would like to intercept and modify the to address.

function Start()
print("Lua SMTPSVR.LUA starting v2")
end

function ProcessMessage(MailFrom,Subject,RecipientList,Actions,Mime,MessageSize,Attachments)
local InterceptList
local FindPos
print "\nProcess Message"
print ("Subject = ", Subject)
print ("Mail From = ", MailFrom)
io.input("InterceptList.txt")
InterceptList = io.read("*all")
InterceptList = string.lower(InterceptList)
MailFrom = string.lower(MailFrom)
print ("Intercept List",InterceptList)
FindPos = string.find(InterceptList,MailFrom)
print ("FindPos = ",FindPos)
if FindPos == nil then
print "no match"
else
print "match"
Actions.SendToOriginalRecipients = false;
Actions.Recipients[1] = "sales"
return Actions, "250 Probs"
end
end

create a text file called "InterceptList.txt" and put it in the VPOP3 directory. If an e-mail arrives from an address in the list, it will be directed to another address, in this code its sales@...

Hope this is useful!

Jon
 
Icon Legend Permissions & Sharing Options Topic Options
Print Topic


3096 Views
FusionBB™ Version 3.1 Final | ©2003-2020 InteractivePHP, Inc.
Execution time: 0.21 seconds.   Total Queries: 35   Zlib Compression is on.
All times are (GMT+1). Current time is 11:01 AM
Top