Disabling Mail

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

  1. alexillsley

    alexillsley New Member

    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 Howtoforge Staff

    Not that I know...
     
  3. alexillsley

    alexillsley New Member

    Ok thanks, Just wondering, is there anyway to stop mail being sent through my server for an email that doesnt exist on it.

    e.g say i have account [email protected] on my server, can i make it so that only emails with a "from address" from [email protected] can be sent
     
  4. falko

    falko Super Moderator Howtoforge Staff

  5. alexillsley

    alexillsley New Member

  6. falko

    falko Super Moderator Howtoforge Staff

    It must be
    Code:
    smtpd_reject_unlisted_sender = yes
     
  7. alexillsley

    alexillsley New Member

    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 Howtoforge Staff

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

    alexillsley New Member

    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 Howtoforge Staff

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

    alexillsley New Member

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

    falko Super Moderator Howtoforge Staff

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

    alexillsley New Member

    Ok thanks, ill have a look
     

Share This Page