Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13831 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19016 invoked by uid 1010); 13 Nov 2004 22:51:41 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 18878 invoked by uid 1007); 13 Nov 2004 22:51:39 -0000 Message-ID: <20041113225139.18876.qmail@pb1.pair.com> To: internals@lists.php.net Reply-To: "Alexander Windbichler" References: <20041101170256.87854.qmail@pb1.pair.com> <20041101185355.68675.qmail@pb1.pair.com> Date: Sat, 13 Nov 2004 23:51:38 +0100 Lines: 95 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Posted-By: 193.170.143.93 Subject: Re: vhost in mail From: A.Windbichler@cybton.com ("Alexander Windbichler") Hello, sorry for the late reply. I tried to patch php like: cat patch | patch -p1 then I filed in the patch manually, but it will not work. Error: debian:/usr/src/php-5.0.2# cat b | patch -p1 can't find file to patch at input line 4 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff -u -r1.84 mail.c |--- ext/standard/mail.c 25 Sep 2004 14:48:44 -0000 1.84 |+++ ext/standard/mail.c 1 Nov 2004 18:50:16 -0000 -------------------------- File to patch: ext/standard/mail.c patching file ext/standard/mail.c Hunk #1 FAILED at 180. 1 out of 1 hunk FAILED -- saving rejects to file ext/standard/mail.c.rej missing header for unified diff at line 13 of patch can't find file to patch at input line 13 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- | -------------------------- File to patch: ext/standard/mail.c patching file ext/standard/mail.c Hunk #1 FAILED at 230. 1 out of 1 hunk FAILED -- saving rejects to file ext/standard/mail.c.rej You have new mail in /var/mail/root debian:/usr/src/php-5.0.2# I've never patched PHP, sorry for the question. alex "Sara Golemon" schrieb im Newsbeitrag news:20041101185355.68675.qmail@pb1.pair.com... > > in the phpinfo() I can find (apache2handler) the entry: "Hostname:Port", > > which displays the vhost you are running the script from. > > In [phpsources]/sapi/apache2handler/php_functions.c I found the source. > Now > > I want to display the vhost in every mail, which is sent by php. I know > that > > the source is in [phpsources]/ext/standard/mail.c and I know how to add a > > simple text, but I don't know how to insert the vhost. > > > > With two HUGE caveats: > > Index: ext/standard/mail.c > =================================================================== > RCS file: /repository/php-src/ext/standard/mail.c,v > retrieving revision 1.84 > diff -u -r1.84 mail.c > --- ext/standard/mail.c 25 Sep 2004 14:48:44 -0000 1.84 > +++ ext/standard/mail.c 1 Nov 2004 18:50:16 -0000 > @@ -180,6 +180,7 @@ > int ret; > char *sendmail_path = INI_STR("sendmail_path"); > char *sendmail_cmd = NULL; > + server_rec *serv = ((php_struct *) SG(server_context))->r->server; > > if (!sendmail_path) { > #if (defined PHP_WIN32 || defined NETWARE) > @@ -229,6 +230,8 @@ > #endif > fprintf(sendmail, "To: %s\n", to); > fprintf(sendmail, "Subject: %s\n", subject); > + fprintf(sendmail, "X-Server-Hostname: %s\n", > serv->server_hostname); > + fprintf(sendmail, "X-Server-Port: %d\n", serv->port); > if (headers != NULL) { > fprintf(sendmail, "%s\n", headers); > > > > #1) Assumes Apache2handler (probably fine since you'll be doing this on your > server only) > #2) Havn't tested it. Use at your own risk. No warranties either expressed > or implied. > > -Sara