Disabling Mail

Discussion in 'General' started by alexillsley, Mar 22, 2007.

  1. alexillsley

    alexillsley ISPConfig Developer ISPConfig Developer

    Hi,
    I wanted to disable sending email for some users in php, I tried what you suggested adding:
    Code:
    php_admin_value disable_functions = 'mail()'
    However this appears not to work, i had a look on php.net and found out that

    Code:
    disable_functions string 
    This directive allows you to disable certain functions for security reasons. It takes on a comma-delimited list of function names. disable_functions is not affected by Safe Mode. 
    
    [B]This directive must be set in php.ini For example, you cannot set this in httpd.conf.[/B] 
    Is there way to set this in php.ini that all sites cant use this function accept about 5?

    Thanks,
    Alex
     
  2. falko

    falko Super Moderator ISPConfig Developer

    Not that I know...
     
  3. alexillsley

    alexillsley ISPConfig Developer ISPConfig Developer

  4. falko

    falko Super Moderator ISPConfig Developer

  5. alexillsley

    alexillsley ISPConfig Developer ISPConfig Developer

  6. falko

    falko Super Moderator ISPConfig Developer

    It must be
    Code:
    smtpd_reject_unlisted_sender = yes
     
  7. alexillsley

    alexillsley ISPConfig Developer ISPConfig Developer

    and all i would do is add this to main.cf and it would make would make senders required to have a email account on my server?
     
  8. falko

    falko Super Moderator ISPConfig Developer

    Should work, although I haven't tried it in an ISPConfig setup.
     
  9. alexillsley

    alexillsley ISPConfig Developer ISPConfig Developer

    Hi,
    I added the line to main.cf and restarted postfix, however it doesnt seem to work, i made a script to send an email in php where the from mail was from an account that did not exists on my server however the mail was still deleiverd:confused: Any ideas whats wrong:confused:
     
  10. falko

    falko Super Moderator ISPConfig Developer

    Have you tried to use a fake sender address in your email client rather than using a local script?
     
  11. alexillsley

    alexillsley ISPConfig Developer ISPConfig Developer

    Just tryed that too, still allows it to send:confused:
     
  12. falko

    falko Super Moderator ISPConfig Developer

    I'd play around with the smtpd_sender_restrictions parameter then.
     
  13. alexillsley

    alexillsley ISPConfig Developer ISPConfig Developer

    Ok thanks, ill have a look
     

Share This Page