Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13870 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40908 invoked by uid 1010); 15 Nov 2004 18:54:08 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 39357 invoked by uid 1007); 15 Nov 2004 18:53:45 -0000 Message-ID: <20041115185345.39354.qmail@pb1.pair.com> To: internals@lists.php.net References: <20041101170256.87854.qmail@pb1.pair.com> <20041101185355.68675.qmail@pb1.pair.com> <20041113225139.18876.qmail@pb1.pair.com> Date: Mon, 15 Nov 2004 10:53:44 -0800 Lines: 42 X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Posted-By: 169.229.135.175 Subject: Re: vhost in mail From: pollita@php.net ("Sara Golemon") > I tried to patch php like: > > cat patch | patch -p1 > then I filed in the patch manually, but it will not work. > > Error: > *shrug*... didn't give me issues, but why not just edit the files directly, the patch is tiny enough.... 1) Open up ext/standard/mail.c in your favorite editor 2) Look for lines similar to the following somewhere around line 180: int ret; char *sendmail_path = INI_STR("sendmail_path"); char *sendmail_cmd = NULL; if (!sendmail_path) { #if (defined PHP_WIN32 || defined NETWARE) 3) Add in this line at the end of the variable declaration block: server_rec *serv = ((php_struct *) SG(server_context))->r->server; 4) Go down a few lines (somewhere around line 229) and look for: #endif fprintf(sendmail, "To: %s\n", to); fprintf(sendmail, "Subject: %s\n", subject); if (headers != NULL) { fprintf(sendmail, "%s\n", headers); 5) Then add in this just after the Subject: line: fprintf(sendmail, "X-Server-Hostname: %s\n", serv->server_hostname); fprintf(sendmail, "X-Server-Port: %d\n", serv->port); Congrats, you just learned how to read a patch file! -Sara