Re: [PHP-DEV] Re: Default Return-Path with mail() and qmail
On Sat, 7 Dec 2002, Daniel Lorch wrote: Hi Andi, Are you sure you should be using malloc()/free() and not emalloc()/efree()? Also please use strlcpy() instead of strncpy(). (Weird I mentioned it twice in one day :) http://www.courtesan.com/todd/papers/strlcpy.html Probably there are even more things broken in my patch :) I'm quite new to C and I'm happy it works without segfaulting. strlcpy looks interesting and I'll read through the link as soon as I find some free time. Oh, this patch is explicitly *NOT* meant to go into the main branch. It's just an additional patch for whoever needs it, sorry for not pointing this out more explicitly. If it would be going into CVS I think we need some way to not always have this on. Derick -- - Derick Rethans http://derickrethans.nl/ PHP Magazine - PHP Magazine for Professionals http://php-mag.net/ - -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: Default Return-Path with mail() and qmail
hi, Somehow this is starting to annoy me -- sorry for the unnecessary noise I am causing on this list. I just thought people who are having the same problem would be looking on marc.theaimsgroup.com or google and find a possible fix. I'm not forcing anyone to use it. Setting Return-Path is useless. It's stripped by sendmail, unless it's allowed in the cf file explicetely. Same for postfix version of sendmail. This also applies to qmail-smtpd, however, I'm talking about qmail-inject. You simply need to setup your mailserver correctly and php accordingly, ie: let the webserver user be allowed to use the '-f' sendmail flag and provide this in the arguments of mail() or via ini_set. I'm not using mod_php. And the -f switch is a nice quick-fix, but it would force me to hardcode a Return-Path and how can I be sure that [EMAIL PROTECTED] really exists? It is just more intuitive that if a user supplies a From header, not only human-generated responses will get back to him, but also machine-generated bounces. In no way, should mail() by default equal the RCPT TO user to the From: header - if I would host users, And I'm sure my users don't want me to read their mails. But I HAVE to read bounces. I never touch people's personal stuff otherwise. I would like to know, if they start spammin' or have buggy scripts. That's why logfiles exist. What ever the reason - the final control of this option should remain with the mailserver administrator, not the mail user. I'm not hardcoding Return-Path. -daniel -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: Default Return-Path with mail() and qmail
Hi Andi, Are you sure you should be using malloc()/free() and not emalloc()/efree()? Also please use strlcpy() instead of strncpy(). (Weird I mentioned it twice in one day :) http://www.courtesan.com/todd/papers/strlcpy.html Probably there are even more things broken in my patch :) I'm quite new to C and I'm happy it works without segfaulting. strlcpy looks interesting and I'll read through the link as soon as I find some free time. Oh, this patch is explicitly *NOT* meant to go into the main branch. It's just an additional patch for whoever needs it, sorry for not pointing this out more explicitly. -daniel -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: Default Return-Path with mail() and qmail
Are you sure you should be using malloc()/free() and not emalloc()/efree()? Also please use strlcpy() instead of strncpy(). (Weird I mentioned it twice in one day :) http://www.courtesan.com/todd/papers/strlcpy.html Probably there are even more things broken in my patch :) I'm quite new to C and I'm happy it works without segfaulting. strlcpy looks interesting and I'll read through the link as soon as I find some free time. Oh, this patch is explicitly *NOT* meant to go into the main branch. It's just an additional patch for whoever needs it, sorry for not pointing this out more explicitly. Good because I havn't seen any positive responses to this and I'm still negative on it. Apart from disagreement with the prinicipal here I'd also ask: Where is the portion of the patch to support Win32 SMTP via the MAPI interface? ((as opposed to sendmail_path interface which you've covered on all platforms)) A more generalized fix would be to append the Return-Path to the headers string at the top of the php_mail function so that it's caught by both the sendmail block and by the TSendMail call (MAPI). Any modification to behavior which effects one platform should affect all platforms equally. While Win32/sendmail is kept equal, Win32/MAPI (used by the majority of Win32 users) is not. -Pollita -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: Default Return-Path with mail() and qmail
hi, Good because I havn't seen any positive responses to this and I'm still negative on it. You don't have to use it. Apart from disagreement with the prinicipal here I'd also ask: Where is the portion of the patch to support Win32 SMTP via the MAPI interface? ((as opposed to sendmail_path interface which you've covered on all platforms)) This is not necessary, at least not with qmail. qmail-smtpd DOES already use the From-Header to write the Return-Path -- compared to qmail-inject, which DOESN'T, and instead uses a default address (such as Return-Path: [EMAIL PROTECTED]). A more generalized fix would be to append the Return-Path to the headers string at the top of the php_mail function so that it's caught by both the sendmail block and by the TSendMail call (MAPI). Any modification to behavior which effects one platform should affect all platforms equally. While Win32/sendmail is kept equal, Win32/MAPI (used by the majority of Win32 users) is not. I'm just providing a working solution to a more or less common problem. I know there are others who are having the same problem, so I am providing a solution to everyone interested. Feel free to post an improved version of my patch. Andi kindly did some code auditing, so there are many things that can be rewritten much nicer :) -daniel -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: Default Return-Path with mail() and qmail
At 21:06 7-12-2002, you wrote: A more generalized fix would be to append the Return-Path to the headers string at the top of the php_mail function so that it's caught by both the sendmail block and by the TSendMail call (MAPI). Setting Return-Path is useless. It's stripped by sendmail, unless it's allowed in the cf file explicetely. Same for postfix version of sendmail. You simply need to setup your mailserver correctly and php accordingly, ie: let the webserver user be allowed to use the '-f' sendmail flag and provide this in the arguments of mail() or via ini_set. In no way, should mail() by default equal the RCPT TO user to the From: header - if I would host users, I would like to know, if they start spammin' or have buggy scripts. What ever the reason - the final control of this option should remain with the mailserver administrator, not the mail user. With kind regards, Melvyn Sopacua ?php include(not_reflecting_employers_views.txt); ? -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php