Adi

My feedback

  1. 16 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Feature Suggestions » Mail  ·  Flag idea as inappropriate…  ·  Admin →
    Adi supported this idea  · 
  2. 115 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    23 comments  ·  Feature Suggestions » Mail  ·  Flag idea as inappropriate…  ·  Admin →
    Adi commented  · 

    Assuming the plesk admin is running a modern MTA i.e. Postfix, not some antiquated and heavily patched qmail fork, you do not need to run the script as the virtual mail user (popuser in Plesk's case). All you have to do is to enable forwarding for an email account to some mycustomfilter@localhost.localdomain email address. Then, in Postfix you'll have to create a custom transport and a filter for that transport and that's it. Example:
    1. In /etc/postfix/mytransport enter:
    mycustomfilter@localhost.localdomain mycustomfilter:
    postmap /etc/postfix/mytransport
    2. In main.cf enable this new transport:
    transport_maps = hash:/var/spool/postfix/plesk/transport, hash:/etc/postfix/mytransport
    3. In master.cf configure the new transport:
    mycustomfilter unix - n n - - pipe flags=F user=somelocaluser argv=/var/www/vhosts/domain.com.au/bin/filter-script.php ${sender} ${size} ${recipient}
    Restart Postfix, then in Plesk pick an account, enable forwarding and enter mycustomfilter@localhost.localdomain as address in the textbox.
    Voila, it can be done, safe and secure!
    It can also be implemented in Plesk by Parallels, where the following variables will have to be entered by the user somewhere in the interface:
    ${filtername} (mycustomfilter)
    ${scriptpath} (/var/www/vhosts/domain.com.au/bin/filter-script.php)

Feedback and Knowledge Base