Help - Search - Members - Calendar
Full Version: postfix and php
Linuxhelp > Support > Technical Support
mmoor
I just figured something out.

I host 4 site of myself on my server.

main.cf
append_at_myorigin = no

if I send mail through php (mail - command) i see in the maillog the following
mail drop <nobody>
then bounces from the target host, bitching about missing the domain part.
So all mail get send out as simple <nobody>

if I set this append_at_myorigin = yes

then it looks basicaly the same, except postfix mounts then <nobody@locahost.test.com) to the only <nobody>

Now this looks rather stupid if i send mail from my site 1 to someone, or if i send mail from my site 2 to some and all over is this silly <nobody> insite.

Is there a way to change this ?
DS2K3
CAn you post the PHP code? You can add addiotnal headers to mail pretty easily with PHP, which might get around the problem. Could you also post the actual logs?
mmoor
conf.inc
***
$frommail = "From:info@test.com\nReply-To:info@test.com\nReturn-Path:info@test.com\nX-Mailer:BBB Mailer (1.0)\nX-Priority:1\nMSMail-Priority: high";
$email = "joe@test.com";
****

File
----
$headers = $frommail;
$message = "Test 22.\n\n";
$tempmes = "BB-Test";
mail($email, $tempmes, $message, $headers);
---
DS2K3
PHP uses the systems sendmail command to send email (which differs from its behaviour on Windows). You might want to investigate using the Net::Mail Package from PEAR (pear.php.net) to implement a direct SMTP connection to the mailserver. This will allow you to set aLL the headers yourself, and postfix shouldn't mess with them.

D
mmoor
kinda found the error..
postfix -> main.cf

append_at_myorigin = no
append_dot_mydomain = no

then the from is <nobody> not the from whats in the header but the received from. So all mail servers bitch becouse there is no domain.

i change this to
append_at_myorigin = yes
append_dot_mydomain = yes

then it works.. but its a bit silly.. if i send php mail from joetest.com then its From: joe@joetest.com received from billy.com (waht is the mail host). would be cool if there would be received from joetest.com. But i guess since all this stuff is limited. there is no way around, except to let a postfix run on each domain.
hmmm..
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.