• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

Redirect email alias to local script for handling.

J

JZMatrix

Guest
I'm trying to find a semi-easy way to create a mail alias via Plesk and then configure qmail to direct any mail destined for that alias/mailbox to a script (that I'm writing) on the local server to be processed accordingly.

On postfix/sendmail systems with /etc/aliases this is a trivial configuration item, but I'm not sure of how to accomplish this with qmail. I'm also worried that Plesk will decide to overwrite any manually edited config file on a whim and cripple my email processing system once it's gone production.

Any ideas?
 
I'm trying to do somethign similar I tried creating an alias in /var/qmail/alias

file called .qmail-somealias

with 1 line in the file like:

|/path/to/my/script.sh

but its not working. Running the script.sh with terminal works fine.

any thoughts?
 
as far as I understand qmail/alias/.qmail-somename will work only if message recipient is somename@hostname

if you need alias be used for some specific domain, you need to handle it through file qmail/mailnames/domain.com/.qmail-somename, i.e. the same way as plesk configures mailman mail lists addresses..
 
thanks for the reply.. I made a little progress with this last night before reading your post.

I was messing with
qmail/mailnames/mydomain.com/test/.qmail

It is closer to working but I think there is a permission issue (I guess with my script). Even set at 777 it still fails.

I get the following error returned via email:

preline: fatal: unable to run /var/www/vhosts/mydomain.com/httpdocs/test/test.php: access denied

test.php is set to:
777
myusr/psacln

my .qmail file looks like this:

| preline /var/www/vhosts/mydomain.com/httpdocs/test/test.php
| true
&[email protected]

Should the user/group be set to something else? Should I not be using preline? anyone know whats up?

Thanks
 
Back
Top