meeting-room-booking-system / mrbs-code

MRBS application code
Other
117 stars 58 forks source link

Email sent by MRBS fails. #2227

Open jberanek opened 6 years ago

jberanek commented 6 years ago

When some users complete the booking form, and click the Submit button, they are told that it failed. They are then sent an email that says something like:

Unauthenticated email from btinternet.com is not accepted due to domain's DMARC policy.

I have added a SPF record to the domain of the website where the MRBS booking form resides. I guess the question is whether MRBS 'authenticates' emails.

Any ideas of what this might mean? Note that MRBS works for most people, however, it would be good if it worked for all email addresses. Huge thanks for any help!

Reported by: hazelnut-sky

Original Ticket: mrbs/support-requests/1518

jberanek commented 6 years ago

If your site/ISP offers it, try using an SMTP connector instead of the bult-in PHP Mail function (Or whatever you're currently using). BT will normally accept that and you can specify authentication params in the settings for it. You'll need to mod your config file to reflect the SMTP usage.

Original comment by: *anonymous

jberanek commented 6 years ago

I'd agree with Anonymous, above - you should be looking at config somthing like:

$mail_settings['admin_backend'] = 'smtp';
$smtp_settings['host'] = 'mailserver.example.com';  // SMTP server
$smtp_settings['port'] = 25;           // SMTP port number
$smtp_settings['auth'] = true;        // Whether to use SMTP authentication
$smtp_settings['secure'] = '';
$smtp_settings['username'] = 'mysmtpusername';
$smtp_settings['password'] = 'mysmtppassword';

Original comment by: jberanek

jberanek commented 6 years ago

hi how can i get an email notification wen the user has login

Original comment by: *anonymous

jberanek commented 6 years ago

If you're using the default session scheme ('php'), and assumong you are using MRBS 1.7.1, then you'll need to modify session/session_php.inc so that on successful login (the section of code at lines 167-170) you send an email. You'll need to do this by calling sendMail() in functions_mail.inc. So the code would look something like this:

      // Successful login.  As a defence against session fixation, regenerate
      // the session id and delete the old session.
      require_once 'functions_mail.inc';
      // Set up the parameters to sendMail()
      sendMail($addresses, $subject, $text_body, $html_body);
      session_regenerate_id(true);
      $_SESSION["UserName"] = $valid_username;

Original comment by: campbell-m

jberanek commented 6 years ago

To Anonymous: Better to start your own support request, than jump into someone elses!

Original comment by: hazelnut-sky

jberanek commented 6 years ago

Thanks for everyone's advice. Really appreciated.

Apologies for not replying earlier. I found a bug with SourceForge passwords. Unfortunately, my password manager creates passwords that SourceForge doesn't like, so I couldn't sign in for ages!

Original comment by: hazelnut-sky