Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DotProject Can't send emails, how to fix ? #85

Open
muhammadkohail opened this issue Jul 15, 2019 · 15 comments

Comments

@muhammadkohail
Copy link

commented Jul 15, 2019

Hi,
im trying to run (sending emails feature) in dotproject while:
1- my current mail server is outside the one which i uploaded the files on
2- i tried these steps in (System Configuration) :

  • (SMTP)
  • mail.mydomain.net
  • Port 25
  • Host requires login "checked"
  • SMTP Username and Password (done)
  • Queue Email for later sending "checked"
  • SMTP Server Timeout "30"
  • Enable TLS for SMTP "checked"
  • Save

3- i tried to make a new log, and choose emails
4- i got the log saved with these details:

(( Emailed 15/07/2019 14:52:18 to:
myuser@mydomain.com (myuser@mydomain.com)
))

5- i did't get any emails sent to my account
6- i tried those fixes #36

and there is no results too, can you help me plz ?

@muhammadkohail

This comment has been minimized.

Copy link
Author

commented Jul 15, 2019

@ajdonnison please help

@ajdonnison

This comment has been minimized.

Copy link
Contributor

commented Jul 16, 2019

@muhammadkohail if you set Queued email it won't send it unless you have either a cron job to run the queue runner or you have also set Scan Event Queue on Session Garbage Collection in the Session Handling Settings` in System Admin.

If you want to test the email settings, in the System Admin main menu you will see at the bottom of the screen Send Test Email.

@muhammadkohail

This comment has been minimized.

Copy link
Author

commented Jul 16, 2019

i did that (Scan Event Queue on Session Garbage Collection in the Session Handling Settings` in System Admin) but NO results found yet.
please advice

@muhammadkohail

This comment has been minimized.

Copy link
Author

commented Jul 16, 2019

@muhammadkohail

This comment has been minimized.

Copy link
Author

commented Jul 16, 2019

Look, i changed the main way like this:
1 - i created mail server on the current domain which dotproject setup-ed on
2 - i did the system configuration like this:
- (SMTP)
- mail.mydomain.net
- Port 465
- Host requires login "checked"
- SMTP Username and Password (done)
- Queue Email for later sending "checked"
- SMTP Server Timeout "30"
- Enable TLS for SMTP "checked"
- Scan Event Queue on Session Garbage Collection "checked"
- Save

is that right ?

@muhammadkohail

This comment has been minimized.

Copy link
Author

commented Jul 16, 2019

@ajdonnison please help

@ajdonnison

This comment has been minimized.

Copy link
Contributor

commented Jul 16, 2019

Did you try using the "Send Test Email" function? Also, uncheck the queue email option until you make sure the email is working - one problem at a time.

@ajdonnison

This comment has been minimized.

Copy link
Contributor

commented Jul 16, 2019

The other thing you can do is point your browser to queuescanner.php which will run anything caught in the queue.

@muhammadkohail

This comment has been minimized.

Copy link
Author

commented Jul 16, 2019

Did you try using the "Send Test Email" function? Also, uncheck the queue email option until you make sure the email is working - one problem at a time.

  • Yes, i did "Send Test Email" as i told, i did the all fixing points in the 3 editet files which you uploaded
  • I removed now the checked on "queue email option", but the page "Send Test Email" still loading with NO finish
@muhammadkohail

This comment has been minimized.

Copy link
Author

commented Jul 16, 2019

queuescanner.php

How i can do that in code steps and lines please ?

@muhammadkohail

This comment has been minimized.

Copy link
Author

commented Jul 16, 2019

Did you try using the "Send Test Email" function? Also, uncheck the queue email option until you make sure the email is working - one problem at a time.

* Yes, i did "Send Test Email" as i told, i did the all fixing points in the 3 editet files which you uploaded

* I removed now the checked on "queue email option", but the page "Send Test Email" still loading with NO finish

504 Gateway Time-out
nginx/1.15.10

@muhammadkohail

This comment has been minimized.

Copy link
Author

commented Jul 16, 2019

queuescanner.php

How i can do that in code steps and lines please ?

This file is part of dotProject. dotProject is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. dotProject is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with dotProject; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA The full text of the GPL is in the COPYING file. */ // Function to scan the event queue and execute any functions required. require_once 'base.php'; require_once DP_BASE_DIR.'/includes/config.php'; require_once DP_BASE_DIR.'/includes/main_functions.php'; require_once DP_BASE_DIR.'/includes/db_connect.php'; require_once DP_BASE_DIR.'/classes/ui.class.php'; require_once DP_BASE_DIR.'/classes/event_queue.class.php'; require_once DP_BASE_DIR.'/classes/query.class.php'; $AppUI = new CAppUI; $AppUI->setUserLocale(); $perms =& $AppUI->acl(); echo "Scanning Queue ...\n"; $queue = EventQueue::getInstance(); # Determine if we are called from the command line or from a web page, # In either case we may have an argument telling us if we are scanning # the batch or the immediate queue. If no argument, scan everything. $batch = null; if (isset($_REQUEST['batch'])) { $batch = strtolower($_REQUEST['batch']); } else if (isset($argv) && !empty($argv[1])) { $batch = strtolower($argv[1]); } if (!empty($batch)) { if ( is_numeric($batch)) { $batch = intval($batch); if ($batch[0] == 'y' || $batch[0] == 't') { $batch = 1; } else { $batch = 0; } } if ($batch) { $queue->scanBatched(); } else { $queue->scanImmediate(); } } else { $queue->scan(); } echo 'Done, '.$queue->eventCount().' events processed'."\n";
@ajdonnison

This comment has been minimized.

Copy link
Contributor

commented Jul 16, 2019

If your web server is set up correctly, pointing a browser to queuescanner.php will run it as a PHP file and not display the file contents as it appears to have done. If you want to run it from a command line you'd use php queuescanner.php.

The timeout information seems to suggest that it is a network issue rather than a code issue. If you have access to the server can you try debugging the connection? Either using tcpdump to see if the connection is being made and responded to, or use telnet to ensure the connection details are correct.

Also look at the nginx error log to see if there is anything of use there.

@muhammadkohail

This comment has been minimized.

Copy link
Author

commented Jul 16, 2019

out informatio

the connection is good, and the system is running well but emails
also, i tried to point queuescanner.php on my browser and i got (504 Gateway Time-out), there is a long loading while the other files can be run fast !
please advice with anyway
Note: the code which i sent to you wasnt from pointing my browser, i got it from inside the file from cpanel

@ajdonnison

This comment has been minimized.

Copy link
Contributor

commented Jul 17, 2019

A couple of things, "the connection is good", how do you know? What tests have you done? Can you connect to port 465 from the server? If so, what did you do to test that?

As for the timeout, I've already said that the most likely issue is that it isn't able to connect to the mail server, so the fact that other files run fast is completely irrelevant. If the send test email page is also hanging - therein lies your problem. Set the timeout to a smaller value so you don't hit the default PHP execution time limit - say 10 seconds. Then try the test page again, if nothing else you should at least see an error coming back. The default execution timeout on PHP is 30 seconds, so if you haven't altered that it will be kicking in before your SMTP timeout. The fact that either timeout is triggered means that the server connection details are wrong, or there is a network issue, or something else causing the connection issue.

You said that the mail server is "on the same domain", does that mean it is on the same server? Is it listening to the local loopback network?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.