xyj70 / fusionpbx

Automatically exported from code.google.com/p/fusionpbx
0 stars 0 forks source link

Email not being sent with fax to email #318

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Recieve an incoming fax

What is the expected output? What do you see instead?
Logs should be created but they are not no email is received and there are no 
messages queued as failed waiting to go out. 

What version of the product are you using? On what operating system?
3.1.2 on centos 5 

Please provide any additional information below.
Tried running the php file from the cli with the instructions found at 
http://wiki.fusionpbx.com/index.php/Fax_Server#Testing: the command would not 
complete if i removed all the variables except the email address i would get 
the php errors below.

PHP Notice:  Undefined offset: 1 in /var/www/fusionpbx/secure/fax_to_email.php 
on line 32
PHP Warning:  require_once(includes/require.php): failed to open stream: No 
such file or directory in /var/www/fusionpbx/secure/fax_to_email.php on line 40
PHP Fatal error:  require_once(): Failed opening required 
'includes/require.php' (include_path='.:/usr/share/pear:/usr/share/php') in 
/var/www/fusionpbx/secure/fax_to_email.php on line 40

Original issue reported on code.google.com by spartian...@gmail.com on 12 Sep 2012 at 4:11

GoogleCodeExporter commented 9 years ago
I am having this exact same issue. I have even copied the include file from 
/var/www/fusionpbx/ to the secure/ directory and still have not had any luck 
getting the email to work.

Original comment by sthorpe2...@gmail.com on 13 Dec 2012 at 8:29

GoogleCodeExporter commented 9 years ago
I believe I have this one figured out and it's a little disconcerting to me on 
the status of this software. The reason for all the PHP Notices is that the 
includes folder is not in the same directory as the fax_to_email.php script, 
but a directory below it in /var/www/fusionpbx. Copy that includes folder to 
/var/www/fusionpbx/secure and those errors will go away. In addition to that 
problem if you are just testing the script to see if it will work the script 
will not send out an email unless there is a image file in the users fax 
folder. This is because of this line in the code 
//send the email
 if (strlen($fax_email) > 0 && file_exists($dir_fax."/".$fax_name.".tif")) { 
You see the condition is that it must have a email address and a file . If you 
comment out this line and remove the second condition the test email will work. 
Now this is a problem in the event that a fax fails. The system will not email 
the fax reciept to the user that it failed. So the script needs to be updated 
with another condition to send out different email in the event that the fax 
fails. Not hard just a little annoying. I hope this helps someone.

Original comment by sthorpe2...@gmail.com on 10 Jan 2013 at 10:15

GoogleCodeExporter commented 9 years ago
This code wasn't designed to run from the command line. If you try to run it 
from command line you need to run it like this:

cd /var/www/fusionpbx
php /var/www/fusionpbx/secure/fax_to_email.php

By doing this the PHP code can get its bearing where everything is located.

To test general email there is an email.lua script which can run. Look in this 
lua script to see how to use it.

Original comment by markjcrane@gmail.com on 27 Apr 2014 at 5:38