Greetings, Ladies and Gentlemen!
I'll try to make myself as clear as I can so that the task would be
completely clear.
1 there is webhosting services with a free month trial
2 it provides ftp, ssh, mail, etc...
3 mail is qmail
4 qmail has a Message-ID field looking like this:
"Message-ID: <20040318190045.30301.gw-mta0 RemoveThis @mx.mail.server.dom>"
5 many persistent spammers take a delight with our services and use the
month trial to SPAM (bastards)
6 It's very hard to control 1500 user sending spam from a php web aplication
or command line scripts...
7 so, I've managed to add some code into qmail to put ehm... say, "a marker"
so that the above field looks like:
"Message-ID: <20040318190045.30301.gw-mta0 RemoveThis @mx.mail.server.dom(user)>" where
user runs a script from the command line (user is USER env var value, it's
clear, isn't it?), and
"Message-ID:
<20040318190045.30301.gw-mta0 RemoveThis @mx.mail.server.dom(www.user.virt.dom)>" Now it
is SERVER_NAME var for the "marker"
Everything works fine. I localy depricated some options in qmail-inject so
that "advanced" spammers could not influence on the Message-ID field.
The aim of all this job: as soon as the robot suspects spam flood it stops
qmail, I look into the header and see in the "marker" who was spamming
(USER, LOGNAME or SERVER_NAME or SCRIPT_FILENAME var value, getenv()'d by
qmail-inject, during the envelope process).
The trouble: when the php mail() function is called the apache vars
SERVER_NAME, SCRIPT_FILENAME, etc... are lost. Any other way of spaming
(well, running this same php script from the command line) does what is
intended - the USER or LOGNAME var value is just inserted into the string as
the "marker".
.... but. where apache variable are lost, and how to get them out?..
Did you get the idea, dear All?
If this is success, I'm going to go further and to code some three more
control files for qmail where I could explicitedly allow/disallow(by
default) to send mail via web aplications and command line scripts (forum
registration, etc, etc...) for hosters who are not spamers.
Hope I've made myself clear now, and hope for real help, too (not verbal
exercising)
Thanks,
Life
P.S. I asked the same question in comp.lang.php, too