1

Topic: 2 questions

Hi,

I'm french. So please don't be surprised if I make mistakes.
As I said in the title, I have 2 questions:

1 - I use the pack for french langage. The problem is that only in the admin part the langage is english yet. How can I modify the langage for the admin part?

2 - I've got a second problem with the mailer. Is it possible to specify the name which will appear (from) in the mails which will be sent? In the admin part?Apparently, at the moment I've got a default name I would like to change.

Really thanks for you answers,

Respectfully,

Ludo

2

Re: 2 questions

v.fr

1. Pour les pages d'administration, il faut éditer dirctement les fichiers, il n'y a pas de variables déclarées pour cela. Si tu veux, je l'ai fait pour ma copie de punbb, donc je peux t'envoyer mes fichiers, mais je dois les "nettoyer" un peu car j'ai modifié d'autres choses...

2. Aucune idée, je n'ai pas encore joué avec le mailer, mais cela ne devrait pas être trop compliqué...
--

v.en.

1. In the admin pages, you have to modify the sentences directly in the files, there are no variables for that. If you want, I've done it for myself so I can send you my files (they are not too heavily modded... I hope...)

2. No idea since haven't messed up with the mailer yet, but that shouldn't be too hard to do.

Re: 2 questions

1. Currently no.

2. Go to admin/options and edit "Webmaster e-mail".

"Programming is like sex: one mistake and you have to support it for the rest of your life."

4

Re: 2 questions

Rickard wrote:

1. Currently no.

2. Go to admin/options and edit "Webmaster e-mail".

That's what I do but the adress i enter is not the adress which appear in sent mail. I also tell you that I do not use any smtp because when I do there is an error.
So it doesn't work as I want it to.

Have you got a solution

Re: 2 questions

What address appears in the mails then?

"Programming is like sex: one mistake and you have to support it for the rest of your life."

6 (edited by Ludo 2004-06-23 20:32)

Re: 2 questions

Rickard wrote:

What address appears in the mails then?

The adress e-mail which appears is the default one used by my host.
So, as my web site is http://ldevergne.free.fr/forum e-mails are sent from ldevergne at free dot fr

Thanks for your answers,

LD

PS: I ad that i've tried with others smtp (with or without authentification, with or without pass) and always the same problem occured :
"an error was encountered, could not connect to smtp host"
What's the problem with smtp?
I also ad that my smtp works with outlook. (smtp.free.fr)

Re: 2 questions

Could you give me an example of where this happens. I just can't seem to find anything wrong with the code.

I don't know what wrong with your SMTP setup. Have you entered a username and a password? Are you sure you need one to just send e-mail?

"Programming is like sex: one mistake and you have to support it for the rest of your life."

8

Re: 2 questions

Rickard wrote:

Could you give me an example of where this happens. I just can't seem to find anything wrong with the code.

I don't know what wrong with your SMTP setup. Have you entered a username and a password? Are you sure you need one to just send e-mail?

It happens for example when a user has forgotten his pass and ask for receiving a new one by mail.

As I told you, I've tried whith a username and a password and it doesn't work. I also tried without password and username and it doesn't work yet. It's strange because as I told you, with outlook my username and pass make it work.

Respectfully,

Ludo

Re: 2 questions

Ludo wrote:

It happens for example when a user has forgotten his pass and ask for receiving a new one by mail.

I just double-checked the code and that can't be right. When a user requests a new password, the reply-to address is set to the value of "Webmaster e-mail" in admin/options. The "reply-to name" is set to "Your board title Mailer", but the address is the webmaster e-mail.

Ludo wrote:

As I told you, I've tried whith a username and a password and it doesn't work. I also tried without password and username and it doesn't work yet. It's strange because as I told you, with outlook my username and pass make it work.

I don't know why it doesn't work. Does your SMTP server operate on a non-standard port perhaps? In that case, have you specified that port in the admin interface? (i.e. mail.example.com:500).

"Programming is like sex: one mistake and you have to support it for the rest of your life."

10 (edited by pgregg 2004-06-24 10:59)

Re: 2 questions

Ok, I there's several different issues at play here, so lets eliminate the red herrings and focus on the problem.

When you try to use SMTP - it doesn't connect.
When you try to use the local mailer it has the wrong email address.

So first, lets ignore the SMTP method.

So, using the local mailer, punBB injects the email via PHPs mail() function via its own pun_mail() wrapper function in includes.email.php

Depending on your PHP install *AND* the mail injection program that is used this MAY result in the SMTP envelope address using the From: address you specify - otherwise it MAY end up as the user@host that the webserver runs as - regardless of any admin options you set in punBB.

So, the question now is - What emailer is running on the punBB webserver?
Also, what is the sendmail_path = line in your php.ini
Finally, can you post as sample header from an email that is delivered via this route?

Given these answers, I am sure I can point you in the right direction.

Paul.

[addition] Rickard: you might like to change the email.php from:
function pun_mail($to, $subject, $message, $from = '')
to
function pun_mail($to, $subject, $message, $from = '', $extra='')

and the call from:
mail($to, $subject, $message, $headers);
to
mail($to, $subject, $message, $headers, $extra);

to prepare the code to be able to pass "-f [adminemail]" in the extra arg for some webservers.

Other MTAs such as QMAIL, you have to use: (iirc)
putenv('QMAILSUSER=sendername');
putenv('QMAILSHOST=senderhost');
before you call the mail();

11 (edited by Ludo 2004-06-24 13:17)

Re: 2 questions

Hi,

I've forgotten to tell you that the webserver on which is intalled punbb does not allow mail with php but only with cgi. For example, my provider give this script to send mail :
<FORM METHOD="POST" ACTION="http://perso0.free.fr/cgi-bin/form2mail.pl">

So I think the problem is here but I don't know how to resolve it.

To reply to your demand this is for example the route used by email to be delivered via this route. This is the header.

Return-Path: <ldevergne ats free dot fr>
Delivered-To: online.fr-ldevergne ats free dot fr
Received: (qmail 1676 invoked from network); 24 Jun 2004 13:09:05 -0000
Received: from b1.ovh.net (HELO mail26.ha.ovh.net) (213.186.33.51)
  by mrelay5-1.free.fr with SMTP; 24 Jun 2004 13:09:05 -0000
Received: (qmail 22088 invoked by uid 508); 24 Jun 2004 13:09:04 -0000
Delivered-To: oyre.net-administrateur ats oyre dot net
Received: (qmail 22086 invoked by uid 503); 24 Jun 2004 13:09:03 -0000
Received: (QMFILT: 1.0); 24 Jun 2004 13:09:03 -0000
Received: from perso0.free.fr (212.27.40.248)
  by mx1.ovh.net with SMTP; 24 Jun 2004 13:08:58 -0000
Received: by perso0.free.fr (Postfix, from userid 33)
    id 8D77A92F3A; Thu, 24 Jun 2004 15:08:52 +0200 (MEST)
To: administrateur ats oyre dot net
From: ldevergne ats free dot fr
Subject: Demande de nouveau mot de passe
XOriginateFrom: http://ldevergne.free.fr
From: Oyre dot net@perso0.free.fr:le forum Mailer <forum ats oyre dot net>
Date: Thu, 24 Jun 2004 15:08:53 +0200
MIME-Version: 1.0
Content-transfer-encoding: 8bit
Content-type: text/plain; charset=iso-8859-1
X-Mailer: PunBB Mailer
Message-Id: <20040624130852.8D77A92F3A@perso0.free.fr>
X-Spam-Check: DONE|type 2&3|H 0.000109481
X-Remote-Ip: 212.27.40.248
X-Remote-Reverse: perso0.free.fr


respectfully,

Ludo

Re: 2 questions

I've had some problems dealing with mail() and the 5:th arg in a win32 dev env.
Just FYI.

13

Re: 2 questions

RNilsson wrote:

I've had some problems dealing with mail() and the 5:th arg in a win32 dev env.
Just FYI.

I don't understand what you mean. I prefer waiting an answer from Rickard or pgregg

Ludo

14

Re: 2 questions

Ludo wrote:

I've forgotten to tell you that the webserver on which is intalled punbb does not allow mail with php but only with cgi. For example, my provider give this script to send mail :
<FORM METHOD="POST" ACTION="http://perso0.free.fr/cgi-bin/form2mail.pl">

So I think the problem is here but I don't know how to resolve it.

Oh dear!  Well this certainly puts the cat among the pigeons.... sad

Ludo wrote:

Return-Path: <ldevergne ats free dot fr>
...

This probably isn't going to help, but it shows that the local machine runs postfix and that the form2mail.pl injects directly to this.  The machine is not running (or listening) on the SMTP port, so you can't use the SMTP method.


First thing to try: Do you have shell access?  If so, look up some documentation on postfix and find out what program controls the injection of email from the shell.  Even if you don't have shell access, find this out anyway.  Then you're going to have to do some hacking of email.php.  If you aren't good with PHP, then I'd give up now, because this involves a popen() to open a handle to the injection program and then fwrite() to manually enter the email including headers.

The second option, is another hack job sad  It involves reading up on cURL www.php.net/curl and having PHP generate a POST call to your formmail.pl url to send the email.

Good luck.

15 (edited by Ludo 2004-06-24 19:53)

Re: 2 questions

sorry but I don't know what shell access is.... so I think I don't have any access unless I would certainly know it.

Second, I had a look at curl but it's very hard for me. I just wanted to have an easy solution for my problem. Am I the only one to have this kind of problem?

Thanks,

Ludo

16

Re: 2 questions

Ludo wrote:

sorry but I don't know what shell access is.... so I think I don't have any access unless I would certainly know it.

Second, I had a look at curl but it's very hard for me. I just wanted to have an easy solution for my problem. Am I the only one to have this kind of problem?

I guess you dont have shell access then.

look in phpinfo() and let us know what sendmail_path is set to.  Also ask your host why mail() is broken or disabled.  It is very rare for ISPs to disable mail() since that's perhaps the single most useful feature in PHP (for companies hosting their sites).

RNilsson wrote:

I've had some problems dealing with mail() and the 5:th arg in a win32 dev env.
Just FYI.

Well, I hate to be the one to point this out, but the 5th arg is (as the manual notes) is passed as additional parameters to the sendmail_path program, which by definition is unix only; therefore the 5th arg has no relevance to Win32.

17 (edited by Ludo 2004-06-25 09:43)

Re: 2 questions

Hi,

It's a choice made by my webhoster. It's ot an error. They assume it.
They made this choice because of people who abused with sending lots of mail whith php. There were problems because it was too much. Since this moment, only
<FORM METHOD="POST" ACTION="http://perso0.free.fr/cgi-bin/form2mail.pl">
works.
It's a free webhoster so I can't complain

Apparently this is the php info for my webhoster :
http://free.box.free.fr/info.php3

Ludo

18 (edited by pgregg 2004-06-25 20:50)

Re: 2 questions

Hmm, ok - this might work:

$email = <<<EOMAIL
From: ludo <ludo at free d0t fr>
To: ludo <ludo at free d0t fr>
Subject: Test

testing

EOMAIL;
$fh = popen('/usr/sbin/sendmail -t -i', 'w');
fwrite($fh, $email);
fclose($fh);

If this works, then there is your method for sending emails...

19 (edited by Ludo 2004-06-25 11:24)

Re: 2 questions

pgregg wrote:

Hmm, ok - this might work:

$email = <<<EOMAIL
From: ludo <ludo at free dot fr>
To: ludo <ldevergneat free dot fr>
Subject: Test

testing

EOMAIL;
$fh = popen('/usr/sbin/sendmail -t -i', 'w');
fwrite($fh, $email);
fclose($fh);

If this works, then there is your method for sending emails...

Sorry to have problem to understand but In which file must I ad or modify this code?

PS: please could you edit your last post and modify the email adress you write in order to avoid spam. For example, you can write ludo at free dot fr and ldevergne at free dot fr. I thank you for this.

Re: 2 questions

pgregg wrote:
RNilsson wrote:

I've had some problems dealing with mail() and the 5:th arg in a win32 dev env.
Just FYI.

Well, I hate to be the one to point this out, but the 5th arg is (as the manual notes) is passed as additional parameters to the sendmail_path program, which by definition is unix only; therefore the 5th arg has no relevance to Win32.


Yeah, that is why i brought it up so pun won't break if the changed is implemented

[addition] Rickard: you might like to change the email.php from:
function pun_mail($to, $subject, $message, $from = '')
to
function pun_mail($to, $subject, $message, $from = '', $extra='')

and the call from:
mail($to, $subject, $message, $headers);
to
mail($to, $subject, $message, $headers, $extra);

to prepare the code to be able to pass "-f [adminemail]" in the extra arg for some webservers.

Even using a empty 5th arg will give error on win32.

21

Re: 2 questions

RNilsson wrote:

Even using a empty 5th arg will give error on win32.

I'm sorry, but that information is incorrect.  PHP will not error, neither will it give a warning if you pass a 5th argument to mail() on Windows.  It will simply ignore it.

22

Re: 2 questions

Ludo wrote:

Sorry to have problem to understand but In which file must I ad or modify this code?

PS: please could you edit your last post and modify the email adress you write in order to avoid spam. For example, you can write ludo at free dot fr and ldevergne at free dot fr. I thank you for this.

Just put it in it's own php file and run it - it is a test to see if we can make PHP send an email.

Email changed.

23 (edited by Ludo 2004-06-26 09:28)

Re: 2 questions

Hi,

So I tell you what I made and what I obtained.
As you asked me to, I have created a file named test.php in which I put this:

<?php
$email = <<<EOMAIL
From: ludo <ludo at free d0t fr>
To: ludo <ldevergne at free d0t fr>
Subject: Test

testing

EOMAIL;
$fh = popen('/usr/sbin/sendmail -t -i', 'w');
fwrite($fh, $email);
fclose($fh);

?>

I've uploaded this file to the root of my website.

I've executed it entering ldevergne.free.fr/test.php

This is what I obtained:

Warning: fwrite(): supplied argument is not a valid stream resource in /var/www/free.fr/1/7/ldevergne/forum/test.php on line 11

Warning: fclose(): supplied argument is not a valid stream resource in /var/www/free.fr/1/7/ldevergne/forum/test.php on line 12

Waiting for your reply,

Ludo

24

Re: 2 questions

Guess they have removed sendmail then.  Start reading up on cURL - you will be able to use curl to make a e.g. curlmail() function which creates a POST to your formmail.pl script to send the email.

It's a non-trivial task - not impossible, but beyond the scope and time I have available here.  Good luck.

25

Re: 2 questions

ok. It's too hard for me.
I'll try to obtain an answer with a new post.

Thank you for all.

Respectfully,

Ludo