Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

when an email is sent through network or email authentication using some mail client, it will surely pass through postfix smtpd and we will be able to track/put policy/ and add restrictions to it, but how the emails from the scripts can be tracked? as they do not pass through spmpd..

Is there any way to catch those emails and put restrictions on them? as many scripts on my server try to send lot of spam, with hundreds of domains.

share|improve this question
add comment

2 Answers 2

You can put an identifier on the headers, you can add an authentication to send the mail, you can use a special FROM sender for each script or each site... There is a lot of possibilities. It depends of the numbers of scripts and who launch them, if you can modify the scripts or the website.

share|improve this answer
    
i dont have any control over the script, i just want all the emails from ANY script to go through postfix –  Farhan Nov 13 '13 at 13:20
add comment

You need to use the PREPEND value; see the postfix docs. A few examples are here.

share|improve this answer
    
i dont have any control over the script, i just want all the emails from ANY script to go through postfix –  Farhan Nov 13 '13 at 12:56
    
Which scripts (PHP?); and which sendmail binary do you have configured? You need to make sure you're using postfix sendmail binary. –  josten Nov 13 '13 at 13:08
    
php, perl, python, any script. –  Farhan Nov 13 '13 at 13:20
    
This greatly depends on the script; for example PHP 5.3+ adds X-PHP-Origin-Script header. The only solution that you have for each of those different scripting languages is to write a custom header (with PREPEND) that catches the content. –  josten Nov 13 '13 at 13:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.