Connovar has asked for the wisdom of the Perl Monks concerning the following question:
jane.o'doe@domain.com.
The actuall address that is used when sending (after passing through the Mail::Sender internals) comes out like so,
doe@domain.com
I found the code responsible:
Regexs are not my strong point in perl, however I can see that the problem comes from the first class in the first regex group, i.e. [^"',]. What I am wondering is there a better way to handle the parsing of $self->{'to'}? Doing a split on "," then cleaning up trailing white space and boundary single and double quote characters.sub _prepare_addresses { my ($self, $type) = @_; if (ref $self->{$type}) { $self->{$type.'_list'} = $self->{$type}; $self->{$type} = join ', ', @{$self->{$type.'_list'}}; } else { $self->{$type} =~ s/\s+/ /g; $self->{$type} =~ s/, ?,/,/g; $self->{$type.'_list'} = [map {s/\s+$//;$_} $self->{$type} =~ /((? +:[^"',]+|"[^"]*"|'[^']*')+)(?:,\s*|\s*$)/g]; } }
I did a fair bit of googling and was surprised this has not come up before.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Mail::Sender not handling single quotes
by Jenda (Abbot) on Nov 01, 2005 at 17:41 UTC | |
by Connovar (Initiate) on Nov 02, 2005 at 00:20 UTC | |
|
Re: Mail::Sender not handling single quotes
by PodMaster (Abbot) on Nov 01, 2005 at 07:49 UTC | |
by virtualsue (Vicar) on Nov 01, 2005 at 10:59 UTC | |
|
Re: Mail::Sender not handling single quotes
by dtr (Scribe) on Nov 01, 2005 at 09:10 UTC |