Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Mail-Sender CPAN distribution.

Report information
The Basics
Id: 87825
Status: resolved
Priority: 0/
Queue: Mail-Sender

People
Owner: Nobody in particular
Requestors: Jon.Jacobson [...] charter.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



CC: "Rechtin, Ray" <Ray.Rechtin [...] charter.com>, "Warren, Brian" <brian.warren [...] charter.com>
Subject: spaces prevent delivery of email; no warning raised
Date: Tue, 13 Aug 2013 13:07:43 -0500
To: "bug-Mail-Sender [...] rt.cpan.org" <bug-Mail-Sender [...] rt.cpan.org>
From: "Jacobson, Jon K" <Jon.Jacobson [...] charter.com>
Dear Mail::Sender maintainer: First off, thanks for a great Module. We use it extensively. However, I did find a surprising "gotcha" recently: if the 'to' parameter is given an array ref, any element that contains a space will be ignored. Assuming that 'works@email.com','also_works@email.com', and 'skipped@email.com' are all valid emails: (1) ..., 'to' => 'works@email.com, also_works@email.com', ... (2) ..., 'to' => ['works@email.com',' skipped@email.com'], ... (3) ..., 'to' => ['works@email.com'], ... (4) ..., 'to' => [' skipped@email.com'], ... In these examples, 'works' and 'also_works' would receive their emails, but 'skipped' would not receive any emails due to the leading space. I encountered this issue when I took a working "to string" that contained whitespace and converted it into an array of elements by splitting on the comma. I thought to use the resulting arrayref in the to-field of Mail::Sender. Some recipients got their emails, but those that had a space did not. It looks like a change might be made to _prepare_addressess (line 1150) to remove whitespace from elements of the array ref or throw an error. Thanks for your time!
I decided to trim the addresses. You should test the $sender->{'skipped_recipients'} after an attempt to send a message to several recipients. Jenda