Werte an Maildrop zurückgeben

Postfix, QMail, Sendmail, Dovecot, Cyrus, Courier, Anti-Spam
skandalmail
Posts: 7
Joined: 2006-05-24 14:06
 

Werte an Maildrop zurückgeben

Post by skandalmail »

Hi Leute,

ich habe folgendes Problem:
Ich liefere meine mails von postfix über maildrop aus.
Nun habe ich ein PHP Script geschrieben, welches die Mail analysiert und Datenbankabfragen macht.
Es soll das Ergebnis, z.b. eine Weiterleitungsadresse an maildrop zurückgeben.
Mein Problem: Wie gebe ich den Wert zurück, damit maildrop ihn verabeiten kann?
Mit einem normalen Shellscript lasse ich das einfach via

AUFRUF=`php -q script.php`

zurückgeben und habe das Ergebnis dann in der Variable AUFRUF stehen,
wo ich es mit "cut" weiter auseinandernehmen kann.

Aber wie mache ich das mit Maildrop.
Ich nehme gerne auch andere Methoden.

Danke soweit.
squize
Userprojekt
Userprojekt
Posts: 729
Joined: 2003-05-19 16:46
Location: Karlsruhe
 

Re: Werte an Maildrop zurückgeben

Post by squize »

Hallo skandalmail,
ein Blick in die gute Doku:
Command substitution

Text enclosed in back-tick characters is interpreted as a shell command. The shell command is executed as a child process by maildrop. Its output is used in place of the command. For example:

DIR=`ls`

places the names of the files in the current directory into the DIR variable.

The output of the command will have all newline characters replaced by spaces, and leading and trailing spaces will be stripped (multiple spaces are not removed, though). Also, the contents of the message being delivered is made available to the command on standard input.

Sollte dir weiterhelfen

Gruss

Marc
skandalmail
Posts: 7
Joined: 2006-05-24 14:06
 

Re: Werte an Maildrop zurückgeben

Post by skandalmail »

Hi, ja danke.
Soweit hatte ich das ja oben auch angegeben, mein Problem war nur, daß keine Ausgabe von PHP erfolgte.
Habe die Lösung jetzt gefunden: Der PHP Interpreter muss auch dem Mailuser gehören!!!

Eine Frage habe ich allerdings noch zu
Also, the contents of the message being delivered is made available to the command on standard input.
Wie kann ich dies verhindern, wenn ich z.B. einfach die Ausgabe von Shellbefehlen brauche, und nicht möchte, daß die mail an deren Standardeingabe gesendet werden, da dadruch die Befehle eventuell mit falschen Parametern manipuliert werden?