osDate Forum - osDate Dating Script

osDateEvo => osDateEvo Updated Files - Fixed Bugs => Topic started by: Pharg on March 30, 2018, 04:29:58 AM

Title: SMTP email sending Fix
Post by: Pharg on March 30, 2018, 04:29:58 AM
Hi Members,

I have found the fix for the SMTP issue either getting a white-page or just not sending.

In the /includes/internal/Functions.php find this on line 499
Code: [Select]
if ( trim( $config['MAIL_TYPE'] ) == '' ) {
$mail_type = 'mail';
}
else {
$mail_type = ($config['MAIL_TYPE']!='MAIL_TYPE')?$config['MAIL_TYPE']:'smtp';
}

Change to this:
Code: [Select]
if ( trim( $config['MAIL_TYPE'] ) == '' ) {
$mail_type = 'mail';
}
else {
$mail_type = ($config['MAIL_TYPE']!='MAIL_TYPE');
}

That's it, all done.
Title: Re: SMTP email sending Fix
Post by: bart on June 12, 2018, 12:19:31 PM
Hi,
My site is not sending mail.
The setup is on a Google Cloud Compute Engine, so I had to use SMTP or Postfix Relay.
Used this manual to get Postfix done: https://cloud.google.com/compute/docs/tutorials/sending-mail/using-sendgrid
(I tried Mailgun and Mailjet too, without success.)
 
I have installed and tested postfix on SSH. Tested sending email works.
Code: [Select]
echo 'Test passed.' | mail -s Test-Email EMAIL@EXAMPLE.COM
But when I use the same settings in Osdate, only an error message is showing.

When tried with sendmail, I get the same error.
Issues with mail sending

In my php.ini
Code: [Select]
sendmail_path = "/jet/bin/sendmail -t -i "
Do I need some compatibility?
http://www.postfix.org/COMPATIBILITY_README.html

Or changes in the source of senMimeMail.php or smtp.php?
Title: Re: SMTP email sending Fix
Post by: Pharg on June 12, 2018, 11:11:06 PM
Hi Bart,

Put sendmail back to mail and there won't be any issue.

Quote

I have installed and tested postfix on SSH. Tested sending email works.
Code: [Select]

echo 'Test passed.' | mail -s Test-Email EMAIL@EXAMPLE.COM


But when I use the same settings in Osdate, only an error message is showing.

When tried with sendmail, I get the same error.
Title: Re: SMTP email sending Fix
Post by: bart on June 13, 2018, 08:33:02 AM
Hi Pharg,
With this setting, there is the same message when trying to send an email.

Port 25 is blocked, so Postfix is set to port 2525
But when I open smtp.php I see default port 25

Title: Re: SMTP email sending Fix
Post by: CBG on June 13, 2018, 01:52:59 PM
Hi Bart,

We are looking into this SMTP issue, we will work on this as fast as possible.
I am going to fully look at the code later today and see, if I can work out the issue, but it may need to be re-written to come up with a fix.
I will post updates to this post, when I have a better idea on what going on, hopefully by tomorrow sometime.

I believe the reason for port 25 being there is it a default just incase it is not set, and should be replaced with the one that is set, in the admin area.

Title: Re: SMTP email sending Fix
Post by: bart on June 13, 2018, 05:12:21 PM
ok thank you.
I have tried a clean install on a new instance on Google Cloud Computing. But the same results, sending mail on the command line is working for root and users

The setup on the instance was as following:
Machinetype g1-small
CPU-platform Intel Skylake
Zone europe-west4-c

LAMP Stack PHP 7 Jetware https://console.cloud.google.com/launcher/details/jetware/lamp7
Apache HTTP Server 2.4.25
MySQL 5.7.18
PHP 7.1.4

-----------------------------------

OK, got it ready on a different server setup
It seems to be the Jetware version of LAMP Stack
The clean and regular stack is working https://console.cloud.google.com/launcher/details/click-to-deploy-images/lamp
Now the stack is: Development stack featuring Apache HTTP Server, MySQL, and PHP
Debian 9
Apache 2.4.25
MySQL 5.7.19
PHP 7.0.19

Can you confirm this?
Title: Re: SMTP email sending Fix
Post by: Pharg on June 14, 2018, 01:02:12 AM
Hi Bart,

I have tested the email system in MAIL and in SMTP and I don't get a error or problem, emails get sent.

The SMTP system as CBG said is going to get a update soon.

Here attached are all the emails pics I tested and all went through.
Title: Re: SMTP email sending Fix
Post by: Pharg on June 14, 2018, 01:05:25 AM
Here is the SMTP Pics.

Attached below.
Title: Re: SMTP email sending Fix
Post by: bart on June 14, 2018, 09:35:05 AM
Hi Pharg,
Thank you, I have found out it was a problem with the server version.
Normaly a linux server has it's files installed in something like /var/www/html
in Jetware version it is in /jet/var/www/html just as /etc/* are located in /jet/etc/*
Title: Re: SMTP email sending Fix
Post by: CBG on June 14, 2018, 09:43:00 AM
Hi Bart,

Is this working ok for you now?
Title: Re: SMTP email sending Fix
Post by: bart on June 14, 2018, 09:50:10 AM
YEs i have found the solution in using a different server package
Title: Re: SMTP email sending Fix
Post by: bart on June 16, 2018, 03:04:02 PM
But in the error.log there is still an error
Code: [Select]
sendmail: option requires an argument -- 'f'
sendmail: option requires an argument -- 'f'
sendmail: fatal: usage: sendmail [options]

Sending mail without buffering in database is working, but using the database still doesn't work.

This new server has a different problem. The site is showing, but it cannot load javascript files.
Code: [Select]
GET https://www.site.TLD/templates/FreshDate/css/mobile.css 404 ()
index.php:16 GET https://www.site.com/javascript/functions.js 404 ()
index.php:19 GET https://www.site.com/javascript/enlargeit.js 404 ()
index.php:17 GET https://www.site.com/javascript/validate.js 404 ()
index.php?page=credits:19 GET https://www.site.TLD/javascript/enlargeit.js 404 ()
index.php?page=credits:32 Uncaught ReferenceError: createRequestObject is not defined
    at index.php?page=credits:32

functions.js:1 Failed to load resource: the server responded with a status of 404 ()
float-panel.js:1 Failed to load resource: the server responded with a status of 404 ()
validate.js:1 Failed to load resource: the server responded with a status of 404 ()
functions.js:1 Failed to load resource: the server responded with a status of 404 ()
validate.js:1 Failed to load resource: the server responded with a status of 404 ()
float-panel.js:1 Failed to load resource: the server responded with a status of 404 ()
index.php:450 Uncaught ReferenceError: updateOnlineTime is not defined
Title: Re: SMTP email sending Fix
Post by: CBG on June 16, 2018, 04:28:06 PM
Hi Bart,

Have you confirmed that the files are there and not missing, and not corrupted
Title: Re: SMTP email sending Fix
Post by: bart on June 16, 2018, 04:59:03 PM
Yes
I even tried with a test.php file, but could not open this.
Code: [Select]
Not Found
The requested URL /javascript/test.php was not found on this server.

Could it be something with a js-engine on this server?
Title: Re: SMTP email sending Fix
Post by: bart on June 16, 2018, 05:03:46 PM
When trying to access the folder in Chrome, I get this:
Code: [Select]
Forbidden
You don't have permission to access /javascript/ on this server.
Title: Re: SMTP email sending Fix
Post by: bart on June 16, 2018, 05:38:07 PM
So I have found a config file on the server: javascript-common.conf with the content:
Code: [Select]
Alias /javascript /usr/share/javascript/

<Directory "/usr/share/javascript/">
Options FollowSymLinks MultiViews
</Directory>

Changed this and... it works
Title: Re: SMTP email sending Fix
Post by: Pharg on June 16, 2018, 10:34:53 PM
Hi Bart,

Thanks for the fix share  ;)