Click to See Complete Forum and Search --> : PHP to utilize libmilter library


Ipsens
August 24th, 2009, 07:43 AM
I've created a php cli run, php milter server, that communicates through socket file, with postfix, as postfix's filter.

Now I have a problem with communication with postfix.
I simply have no idea what kind of string commands I need to pass to postfix.

Aim is to get string(mail) from postfix, evaluate it and send it back to postfix.
So I started to read as a first action.

Errors I did received were:
"can't read SMFIC_OPTNEG reply packet header: Operation timed out"

At that point I've figured out that PHP milter has to say something to postfix
So I've sent string "Hello! Killer here, send me a victim!"


"unreasonable packet length: 1265200236 > 1073741823"
At that point I've figured out that PHP milter is sending to long
"welcome" message.

Then I've sent just a dot "."


EOF while reading command code: Operation timed out
A-ha!
So here is a catch! COMMAND!

postfix and each milter, have some string commands, they use to comunicate.


Then I've found this:
https://www.milter.org/developers

How do I make a wrapper around the postfix sendmail libmilter API?

And can I just send string commands?
Can someone give me an example of which string commands to use and send to postfix in order to achieve:
to get string(mail) from postfix, evaluate it and send it back to postfix.