How to find SMTP email logs?

Evgeny Pro Posted in Technical Support 5 months ago

Hello,
I have a fresh OSSN installation on Ubuntu using this installer. So far, so good, except emails - they are not received. So I installed SMTP component from here https://github.com/opensource-socialnetwork/SMTP and enabled it, then configured with my existing SMTP server (Elasticemail) which is being used for other services and send mails just fine.
However from OSSN I still do not receive any emails. I tried to find any local logs but could not. In syslog there are no any errors.
Please advise what logs are generated by OSSN services and where to find them?
Thanks in advance

Replies
Welsh Evgeny Pro Replied 5 months ago

Thanks @Noah.
You mean Apache logs? I m using Ubuntu, so they are in /var/log/apache2. I was checking them before asking the question here - found nothing.
But now it works fine - advise from Arsalan helped.

us Noah Brown Replied 5 months ago

It seems like you're experiencing issues with email delivery in your OSSN installation. The logs for OSSN services are typically located in the ossndata/logs directory within your OSSN installation. You can check the errorlog and access_log files for any relevant information about email delivery or any errors that may have occurred.

Indonesian Arsalan Shah Replied 5 months ago

Glad you found the problem :) you may restore the debug back to original form.

Welsh Evgeny Pro Replied 5 months ago

Debug says that the sender address I am using is not allowed on MTA side. Wrong sender policy was applied on Elasticemail side. I will fix that shortly.
Many thanks for your help!

Indonesian Arsalan Shah Replied 5 months ago

If connection is success then the mail should work, do you see any log in mail Elasticemail dashboard? does the mail appeared there?

It would need to change SMTP debug settings and then create a test script to see the results. Create test.php file in your ossn root.

<?php
define('OSSN_ALLOW_SYSTEM_START', TRUE);
require_once('system/start.php');

$email = "[email protected]";
$sub = "Test";
$msg = "Test Message";

$mail = new OssnMail();
var_dump($mail->notifyUser($email, $sub, $msg));

https://github.com/opensource-socialnetwork/SMTP/blob/d778781c44a145409106f3b75f7cacc4ca4a0408/ossn_com.php#L80

Change to :

$mail->SMTPDebug = SMTP::DEBUG_SERVER; 

Now try to run the script yourwebsite.com/test.php and see the results

Welsh Evgeny Pro Replied 5 months ago

When I enter Elasticemail credentials, yes it shows success. But as it doesn't send any test emails I am not sure if connection is actually verified at this stage.
So my question was - where there are service logs where I can further see what happens during sending emails and whether such attempts take place at all

Indonesian Arsalan Shah Replied 5 months ago

Try to use aws ses and see if that connects? when you connect Elastic Mail does it show success connection?

Welsh Evgeny Pro Replied 5 months ago

Hi Arsalan,
If you mean under normal mailing something like Postfix, which sends email directly from the host this is not recommended. And in aws (where I am hosted) it will ne be allowed by default. Instead it's recommended to use specialised MSP like aws ses, Sendgrid or Elasticemail (my case). Is it possible to implement such a setup?
Thanks

Indonesian Arsalan Shah Replied 5 months ago

Disable the component. Install MTA software on your server. Configure dns example dkim spf txt records. Now try to send email from shell and let us know if that email goes out? forgot about OSSN mailing. First make the normal mailing from your server work.