[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re[2]: [cobalt-users] Re: Re: Changing "Return-Path" in PHPmailfunction - Final posting
- Subject: Re[2]: [cobalt-users] Re: Re: Changing "Return-Path" in PHPmailfunction - Final posting
- From: Fred Taurus <journal@xxxxxxx>
- Date: Fri Oct 19 02:25:01 2001
- List-id: Mailing list for users to share thoughts on Cobalt products. <cobalt-users.list.cobalt.com>
Bonjour Marco,
is it possible to have a returnpath which change with every sender ?
because my Raq send message for my users ...
@+
Fred mailto:journal@xxxxxxx
MB> le 19.10.2001 0:58, Adrian Boismoreau à aboismoreau@xxxxxxxxxxxxxxx a
MB> écrit :
>>
>> ----- Original Message -----
>> From: "Marco Baurdoux" <linux@xxxxxxxxxxxxx>
>> To: <cobalt-users@xxxxxxxxxxxxxxx>
>> Sent: Thursday, October 18, 2001 3:14 PM
>> Subject: Re: [cobalt-users] Re: Re: Changing "Return-Path" in
>> PHPmailfunction - Final posting
>>
>>
>>> le 18.10.2001 15:29, Adrian Boismoreau à aboismoreau@xxxxxxxxxxxxxxx a
>>> écrit :
>>>
>>>> Well, I've tried that but didn't work for me.
>>>>
>>>> Adrián E. Boismoreau
>>>> __________________
>>>> S K Y m e d i a
>>>> info@xxxxxxxxxxxxxxx
>>>> www.skymedia.com.ar
>>>>
>>>> ----- Original Message -----
>>>> From: "Marco Baurdoux" <linux@xxxxxxxxxxxxx>
>>>> To: <cobalt-users@xxxxxxxxxxxxxxx>
>>>> Sent: Thursday, October 18, 2001 9:18 AM
>>>> Subject: Re: [cobalt-users] Re: Re: Changing "Return-Path" in PHP
>>>> mailfunction - Help needed
>>>>
>>>>
>>>>> le 18.10.2001 13:38, Adrián Boismoreau à aboismoreau@xxxxxxxxxxxxxxx a
>>>>> écrit :
>>>>>
>>>>>> Well,
>>>>>> As I've tested many coding from php.net and other solutions sugested
>>>> here
>>>>>> and none of them did work for me, I did the following:
>>>>>>
>>>>>> Edited the /etc/mail/sendmail.cf. The header stuff looks like this:
>>>>>>
>>>>>> #########################
>>>>>> # Format of headers #
>>>>>> #########################
>>>>>>
>>>>>> H?P?Return-Path: <$g>
>>>>>> HReceived: $?sfrom $s $.$?_($?s$|from $.$_)
>>>>>> $.$?{auth_type}(authenticated)
>>>>>> $.by $?{if_name}${if_name}$|$j$. ($v/$Z)$?r with $r$. id $i$?u
>>>>>> for $u; $|;
>>>>>> $.$b
>>>>>> H?D?Resent-Date: $a
>>>>>> H?D?Date: $a
>>>>>> H?F?Resent-From: $?x$x <$g>$|$g$.
>>>>>> H?F?From: $?x$x <$g>$|$g$.
>>>>>> H?x?Full-Name: $x
>>>>>> # HPosted-Date: $a
>>>>>> # H?l?Received-Date: $b
>>>>>> H?M?Resent-Message-Id: <$t.$i@$j>
>>>>>> H?M?Message-Id: <$t.$i@$j>
>>>>>>
>>>>>>
>>>>>> I replaced the 2 first lines for this:
>>>>>>
>>>>>> H?P?Return-Path: <admin@xxxxxxxxxx>
>>>>>> HReceived: $?sfrom $s $.$?_(admin@xxxxxxxxxx)
>>>>>>
>>>>>> And now mail headers sent from every script using sendmail has a
>> return
>>>> path
>>>>>> that's not <httpd>
>>>>>> Hope hosts not to filter emails anymore.
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Adrián E. Boismoreau
>>>>>
>>>>>
>>>>> Nice starting point, but wouldn't it be better to set the return path
>> to
>>>> be
>>>>> the same as the "from" header ???
>>>>>
>>>
>>> OK well here's the answer to this PHP problem.
>>> Do not touch the sendmail config file.
>>> within your httpd.conf file you can add this to every virtualhost section
>>> php_admin_value sendmail_path " /usr/sbin/sendmail -t -i
>>> -fcatchall@xxxxxxxxxxxx"
>>>
>>> This will solve the return path problem for all the PHP users.
>>>
>>
>> Well.... thank you very much my friend. That solved the Return-Path issue
>> for me, and didn't have to modify every script :)
>>
MB> Now for future installations you might want this to be automised:
MB> Edit the /usr/lib/perl5/site_perl/5.005/Cobalt/Vsite.pm module
MB> Scroll down until the vsite_add function ( sub ):
MB> Replace these lines :
MB> my ($addr,$name,$group,$serveradmin,$mask) = @_;
MB> my($found_interface,$found_namev,$conf,$new_conf,$found_group);
MB> my $ret;
MB> with these lines :
MB> my ($addr,$name,$group,$serveradmin,$mask) = @_;
MB> my $emaildomain = substr($name,4,length($name));
MB> my($found_interface,$found_namev,$conf,$new_conf,$found_group);
MB> my $ret;
MB> And then these lines:
MB> <VirtualHost $addr>
MB> ServerName $name
MB> ServerAdmin $serveradmin
MB> CustomLog $Htgroup_dir/$group/$Logdir/webnew.log combined
MB> Alias /stats $Htgroup_dir/$group/stats
MB> DocumentRoot $Htgroup_dir/$group/$Webdir
MB> RewriteEngine on
MB> RewriteCond %{HTTP_HOST} !^$addr(:80)?$my
MB> RewriteCond %{HTTP_HOST} !^$name(:80)?$my
MB> RewriteRule ^/(.*) http://$name/\$1 [L,R]
MB> RewriteOptions inherit
MB> AliasMatch ^/~([^/]+)(/(.*))? $Htgroup_dir/$group/users/\$1/web/\$3
MB> AliasMatch ^/users/([^/]+)(/(.*))? $Htgroup_dir/$group/users/\$1/web/\$3
MB> </VirtualHost>
MB> with these lines:
MB> <VirtualHost $addr>
MB> ServerName $name
MB> ServerAdmin $serveradmin
MB> CustomLog $Htgroup_dir/$group/$Logdir/webnew.log combined
MB> Alias /stats $Htgroup_dir/$group/stats
MB> DocumentRoot $Htgroup_dir/$group/$Webdir
MB> RewriteEngine on
MB> RewriteCond %{HTTP_HOST} !^$addr(:80)?$my
MB> RewriteCond %{HTTP_HOST} !^$name(:80)?$my
MB> RewriteRule ^/(.*) http://$name/\$1 [L,R]
MB> RewriteOptions inherit
MB> AliasMatch ^/~([^/]+)(/(.*))? $Htgroup_dir/$group/users/\$1/web/\$3
MB> AliasMatch ^/users/([^/]+)(/(.*))? $Htgroup_dir/$group/users/\$1/web/\$3
MB> php_admin_value upload_tmp_dir $Htgroup_dir/$group
MB> php_admin_value open_basedir $Htgroup_dir/$group:/tmp
MB> php_admin_value sendmail_path " /usr/sbin/sendmail -t
MB> -i-fcatchall\@$emaildomain"
MB> </VirtualHost>
MB> The sendmail_path line has to be on one line off course !!
MB> Now for some explanations,
MB> The first extra php_admin_value, sets the upload directory to be the root of
MB> the website. No more /tmp filling up.
MB> The second extra php_admin_value, stops php from accessing file outside of
MB> the websites folder.
MB> The third extra php_admin_value will set a default return path, within all
MB> mails sent via the mail() function of PHP, it will still allow you to
MB> specifiy the other headers such as From, Reply-to etc via this function
MB> These cobalt boxes are very nice, and with some Linux knowledge, you can
MB> make them even better :-))
MB> People don't always believe what Cobalt says, because if you scroll through
MB> the Vsite perl module of a RaQ3, you'll find out that it contains functions
MB> such as:
MB> vsite_get_php3
MB> vsite_set_php3
MB> And this althought these boxes are sold without PHP :-))
MB> Hope this helps.
MB> _______________________________________________
MB> cobalt-users mailing list
MB> cobalt-users@xxxxxxxxxxxxxxx
MB> To Subscribe or Unsubscribe, please go to:
MB> http://list.cobalt.com/mailman/listinfo/cobalt-users