Open Bug 1440978 Opened 7 years ago Updated 6 years ago

smtp username not clearing in form: add space and trim

Categories

(Bugzilla :: Bugzilla-General, defect)

defect
Not set
normal

Tracking

()

UNCONFIRMED

People

(Reporter: lkcl, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0 Build ID: 20160607223741 Steps to reproduce: diff --git a/Bugzilla/Mailer.pm b/Bugzilla/Mailer.pm index 5ccf2d1ed..cb8df3e48 100644 --- a/Bugzilla/Mailer.pm +++ b/Bugzilla/Mailer.pm @@ -26,6 +26,7 @@ use Date::Format qw(time2str); use Email::Sender::Simple qw(sendmail); use Email::Sender::Transport::SMTP::Persistent; use Bugzilla::Sender::Transport::Sendmail; +use Text::Trim qw(trim); sub generate_email { my ($vars, $templates) = @_; @@ -153,7 +154,7 @@ sub MessageToMTA { Email::Sender::Transport::SMTP::Persistent->new({ host => $host, defined($port) ? (port => $port) : (), - sasl_username => Bugzilla->params->{'smtp_username'}, + sasl_username => trim(Bugzilla->params->{'smtp_username'}), sasl_password => Bugzilla->params->{'smtp_password'}, helo => $hostname, ssl => Bugzilla->params->{'smtp_ssl'}, Actual results: SMTP user field could not be blanked (which is a valid thing to do on a network where there is a VPN running and the systems on that VPN are TRUSTED) so it was forcibly required to enter a space into the field. this was then passed (illegally) to the MTA module which attempted to use it for authentication purposes... which of course failed. by stripping the space out it was possible to get the desired behaviour

has this yet been fixed by allowing blank SMTP user fields?

You need to log in before you can comment on or make changes to this bug.