- 
                Notifications
    You must be signed in to change notification settings 
- Fork 57
remove white chars from email address list #724
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that the preg fix will have specific downsides if people are using full name email syntax. Better to use array map and tokenize the emails, trim the on a t a time and then join the array. Or better yet, do that at send time.
So, pushing back on this one.
| Spaces are actually valid in email addresses before the prefix. Whilst we may trim the whole field we should not be adjusting any other part if it meets the RFC | 
| Clarification of the problem: Last two lines are valid (RFC 5322) but email is delivered only to first address. I don't know if the problem is in phpmailer, PHP, mailserver, ... Both addresses are in To: header but maybe second is missing in "envelope to". Easy fix - add < and > when saving notification list. @TheWitness What do you think? | 
| What is the difference between 4 & 6? | 
| Have you checked with the php mailer team? What about your mail server? What do the logs show? | 
| 
  | 
| 
 Yes, as I wrote - it is in To: header but it missing in envelope. I don't want to examine this too closely. An easy solution is to add  | 
| ok, I had few minutes for this. Problem is in our functions: I will fix it | 
| because of Cacti/cacti#6249 closing this | 
space (or other white chars) in "to" or "bcc" will cause email to be delivered only to users before first white space. Maybe it is problem only with specific email servers.
Second fix is for:
2025-10-03 09:37:13 - CMDPHP Input Validation Not Performed for 'thold_per_enabled' Backtrace: (/plugins/thold/thold.php[96]:save_thold(), /plugins/thold/thold_functions.php[5583]:get_reque
st_var(), /lib/html_utility.php[379]:html_log_input_error(), /lib/html_validate.php[44]:cacti_debug_backtrace())