Hello. I am running version 5.6 and am looking for a way to process an email that gets sent to an account. This is what i would like to do:
- In server manager add a new account. For Example newmember@mydomain.com
- In this account change it to Forward to another address.
Rather than forward to an email address i would like to enter a script name eg. addnew. Which would send th email off to the script (pref. perl) which would be nice to have in an ftpable directory (eg. /home/e-smith/files/primary/files??) and process it an exit. If a reply was needed this could simply be done within the perl script.
I was fiddling around and thought that in the templates-user-custom/.qmail/e-smithForward20 I might be able to change it to something like this if the $EmailForward was set to 'forward':
elsif ($EmailForward eq 'forward')
{
##### CHANGES START HERE
if($ForwardAddress !~ /\@/) ##CHECK FOR @
{
my $prog = "/home/e-smith/files/primary/files/$ForwardAddress.pl";
my $ok = open(MF,$prog);
open(MF,"$md/error.pl") if(!$ok);
my $prog1 = join('',<MF>);
close(MF);
eval($prog1);
exit;
}
#####ELSE CONTINUE AS USUAL
else
{
$OUT = "&" . $ForwardAddress . "\n";
}
}
As i do not know what programming language these templates are in and how they are used i do not know what to do from this point?
Any help would be greatly appreciated I also think it would be a useful little tool for proccessing email.
It would be used for example. If a user fills out a new membership form and it sends an email off to me. I look over the email and simply bounce it to the newmember@mydomain.com address and it processes the email, adds to the database and sends a reply to the new user confirming their addition.
Any ideas/help/direction would be excellent.
Best Regards,
mcd_sign