Closed Bug 507108 Opened 15 years ago Closed 15 years ago

Bugzilla suffers internal error when sending email through gmail

Categories

(Bugzilla :: Email Notifications, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 466419

People

(Reporter: skochkarev, Unassigned)

Details

User-Agent:       Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322)
Build Identifier: Bugzilla 3.4

[Wed Jul 29 13:37:33 2009] [error] [client 82.179.65.88] [Wed Jul 29 13:37:33 2009] process_bug.cgi: Use of uninitialized value $username in length at C:/usr/site/lib/Net/SMTP.pm line 130., referer: http://82.179.65.88/bugzilla-3.4/process_bug.cgi

sub auth {
  my ($self, $username, $password) = @_;

  eval {
    require MIME::Base64;
    require Authen::SASL;
  } or $self->set_status(500, ["Need MIME::Base64 and Authen::SASL todo auth"]), return 0;

  my $mechanisms = $self->supports('AUTH', 500, ["Command unknown: 'AUTH'"]);
  return unless defined $mechanisms;

  my $sasl;

  if (ref($username) and UNIVERSAL::isa($username, 'Authen::SASL')) {
    $sasl = $username;
    $sasl->mechanism($mechanisms);
  }
  else {
>>>>> [130]    die "auth(username, password)" if not length $username;
    $sasl = Authen::SASL->new(
      mechanism => $mechanisms,
      callback  => {
        user     => $username,
        pass     => $password,
        authname => $username,
      }
    );
  }


Reproducible: Always

Steps to Reproduce:
1. Create a bug
2. Choose Submit
3. Voila
Actual Results:  
An error message: undef auth(username, password)

Expected Results:  
Sending mail to the person responsible for bugs

I managed to fix it by changing line 169 of bugzilla/mailer.pm:

    if ($method eq "SMTP") {
to
    if ($method eq "SMTP" || $method eq "Gmail") {
Version: unspecified → 3.4
The reason it fails is that Gmail requires SSL, and we don't support that yet.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → DUPLICATE
Thanks.

As I wrote earlier, my bugzilla works with gmail. It is apache 2.2, WinXP.

I also managed to make it work on Linux.

Should I post my diffs?
(In reply to comment #2)
> Should I post my diffs?

If they are not hacks, yes, attach your patch. But do this in bug 466419, please.
You need to log in before you can comment on or make changes to this bug.