[SATLUG] postfix question

masterr at gmail.com masterr at gmail.com
Wed May 8 16:43:29 CDT 2013


Bruce,

You can specify the from address in PHP itself by using the -f flag in
the additional parameters in mail(). It should be the 5th parameter.

From: http://php.net/manual/en/function.mail.php

bool mail ( string $to , string $subject , string $message [, string
$additional_headers [, string $additional_parameters ]] )

The example given:

<?php
mail('nobody at example.com', 'the subject', 'the message', null,
   '-fwebmaster at example.com');
?>

As long as Postfix allows sending from any address from localhost this
should work.

Hope that helps.

-Jon

On Mon, May 6, 2013 at 3:42 PM, Bruce Dubbs <bruce.dubbs at gmail.com> wrote:
> I'm running a server with three domains and three separate IP addresses.
> Most of the mail is sent/received from domain1.org, but I'd like to send
> occasional messages via php from domain2.org.
>
> Right now I have the master.cf configuration set up properly as
>
> myhostname = host1.domain1.org
>
> but I'd like to override that as host2.domain2.org on a selective
> basis.  I don't want to receive any mail at domain2.org and can add a
> reply-to header to my regular address.
>
> I'd also like to change the ip address used for the outgoing message to
> match domain2's ip address.
>
> Any ideas?
>
> Thanks.
>   -- Bruce
> --
> _______________________________________________
> SATLUG mailing list
> SATLUG at satlug.org
> http://alamo.satlug.org/mailman/listinfo/satlug to manage/unsubscribe
> Powered by Rackspace (www.rackspace.com)


More information about the SATLUG mailing list