Menu

#1290 Multiple admin email addresses not accepted on edit_area_room.php

open
nobody
1
2017-08-18
2017-08-17
Anonymous
No

Hi,
A couple of users reported they were no longer receiving booking notifications as room admins. Apparently this used to work. The system has been through many upgrades and is now on 1.6.1
I found their addresses in the room's properties in the form:

address1@example.com, address2@example.com

I checked if I had room_admin_on_bookings set to TRUE but found it to be FALSE. This must have been overlooked during the last upgrade I did so I corrected that.
I then tried adding my own address address (after a further comma) and making a test booking to quickly confirm if that's all that was the matter but "Invalid email address!" was displayed. The same happened when pasting back the original two addresses. I then confirmed a single address worked - address accepted and message received.

I assume multiple addresses should still work? The same is happening for other rooms and also in a completely separate 1.6.1 installation. Since room_admin_on_bookings was set to false whilst two addresses were in place I can't say if either or both would have been receiving them from 1.6.1 with the setting as I found it with two addresses.

I've asked users if they can pin down when it last used to work.
Thanks

Discussion

  • Andrew Hardisty

    Andrew Hardisty - 2017-08-17

    Oops. Wasn't logged in when I created that.

     
  • Campbell Morrison

    Yes, multiple addresses should still work. I've tested this and can't reproduce it. Would you be able to sdend me a PM with an example of email addresses that don't work?

     
  • Andrew Hardisty

    Andrew Hardisty - 2017-08-18

    PM sent.
    I tried all sorts of address formats but nothhing was accepeted by the MRBS interface.
    However, I've found that if I put the multiple addresses directly into the appropriate room_admin_email field of the mrbs_room database table, they do both receive emails as room admin when a booking is made.
    That is unless the Do not send email: box is checked on edit_entry.php - I assumed that would only prevent the booker receiving an email but it stops any emails being genrated for that booking?

     
  • Andrew Hardisty

    Andrew Hardisty - 2017-08-18

    I knew there was something else I was going to add.
    The server is running PHP 5.3.3 and the database server is running MySQL 10.1.19-MariaDB
    The MySQL server was recently upgraded from an old version - 5.1

     
  • Andrew Hardisty

    Andrew Hardisty - 2017-08-18

    I'll set up a fresh 1.6.1 installation in our environment when I have a few minutes and test that.

     
  • Campbell Morrison

    I think I can see what the problem is. I'll post a fix soon.

     
  • Campbell Morrison

    Can you try changing line 2201 of functions.inc from

          if (!validate_email($email))
    

    to

          if (!validate_email(trim($email)))
    
     
  • Campbell Morrison

    I've now committed this fix to the default branch in e54c32.

     
  • Andrew Hardisty

    Andrew Hardisty - 2017-08-18

    Bingo!
    Something to do with whitespace? I tried omiting spaces between the comma and next address.
    Thanks for the quick respone as ever.

     
  • Campbell Morrison

    Yes, it was to do with whitespace. Even though you were omitting the spaces, MRBS is putting them back in, to make the list more readable. That's fine, but in MRBS 1.6.1 the validation method was changed to use PHPMailer - and PHPMailer auto-selects a validation method depending on what's available in the system. I think that was why you were seeing the problem, but I couldn't reproduce it at first.