[pmwiki-users] notify problem

Patrick R. Michaud pmichaud at pobox.com
Fri Sep 22 17:04:59 CDT 2006


On Fri, Sep 22, 2006 at 11:37:54PM +0200, Tom Lederer wrote:
> Hi,
> 
> thanks for the tip, but the server says:
> System Linux 2.6.17.7
> 
> and sendmail is /usr/sbin/sendmail
> 
> I even tried it bluntly by adding the following to the config.php,  
> which should send me an email every time a page is viewed as far as i  
> understand that:
> 
> $empfaenger = 'celok at gmx.net';
> $betreff = 'Der Betreff';
> $nachricht = 'Hallo';
> mail($empfaenger, $betreff, $nachricht);
> 
> But i do not get any mails :(

Yes, something must be misconfigured or otherwise preventing
PHP from sending the mail.  Or, the celok at gmx.net address is
somehow filtering the messages so that you never see them.

In the mailposts.php script I had set up an option to use a
function other than PHP's built-in "mail" function, and provided
a custom function to call sendmail directly.  I did this because
there seemed to be some PHP environments where the mail() function
wouldn't work but directly calling sendmail would.  I can
see about adding this feature back in if it would help.

You can find out if this other approach can work by doing the 
following in a .php script somewhere on your server and then 
running the script:

    <?php
      $empfaenger = 'celok at gmx.net';
      $betreff = 'Der Betreff';
      $nachricht = 'Hallo';

      $mailfp = popen("/usr/lib/sendmail -t -i", "w");
      fwrite($mailfp, "To: $empfanger\nSubject: $betreff\n\n$nachricht\n");
      pclose($mailfp);

If this works for you, I'll update the notify.php recipe to have this
as an option instead of using PHP's built-in mail() function.

Pm




More information about the pmwiki-users mailing list