• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

Generic Mail Handler

R

Raphael@

Guest
Hi guys,

I'm kind of stuck trying to create a mail handler. I created a php executable script in my root directory, I set the uid bit as requested in the plesk-8.2-unix-mod-api.pdf
but for the rest I don't know if I should set certain user/group or place the file in a certain location or where to find feedback (logs?) if things go wrong. I tried to output some stuff to a file through the script but no do.

So to recap:

1. What would be the right user/permissions for the handler
2. Does the location matter
3. How would I debug the script.

Wow 35 views and no comments yet. Ok letst start with what I got:

PHP:
<?php

  $contents="";
  while (!feof(STDIN)) {
    $contents .= fread(STDIN, 8192);
  }

  $myfile=fopen("/tmp/aaa",'a');
  fwrite($myfile,$contents);
  fclose($myfile);

  $error_out="STOP\n";
  fwrite(STDERR, $error_out);
  exit(0);
?>

I register this with:

PHP:
/usr/local/psa/admin/sbin/mailmng --add-handler --handler-name=1my_handler-ld [email protected] --executable=/roo
t/bin/handler.php --context=context --hook=before-local

which seems to work fine.
 
Back
Top