Ticket #1485678 (closed Bugs: fixed)

Opened 14 months ago

Last modified 11 months ago

Several e-mail addresses per user set automatically by virtUser file

Reported by: Napsty Owned by:
Priority: 5 Milestone: 0.2.2
Component: Core functionality Version: 0.2-stable
Severity: normal Keywords: virtUser, email address
Cc:

Description

Hello

I try to use RC 0.2-stable with a virtUser file. I have several e-mail addresses which are pointing to same users -> means some users have several e-mail addresses. Because some MTA's show some information in a virtUser file that RC probably can't handle, I've made an automatic cleanup that only "valid and good" data is in the newly created virtUserfile. It looks like this then:

info@… web45p1 yoshi@… web74p1 user@… web150p2 test@… web74p1 info@… web74p1 roland@… web11p7 charlotte@… web11p8

I've seen that RC takes the first entry it finds in the virtUser-file to set as e-mail address of the logged in user. But it would be great if RC also is able to see the other e-mail addresses for the logged in user and would create automatically new identities in the identities table.

Best regards, Napsty

Change History

Changed 14 months ago by alec

  • type changed from Feature Requests to Bugs

'virtuser_query' is working as you expect, so I think we can assume it's a bug in 'virtuser_file' handling.

Changed 14 months ago by Napsty

Just to be sure that we're talking about the same: Did you see that I used several times the same unix user (web74p1) in the example? Would be great if it would work like I described it.

Changed 13 months ago by Napsty

I have just made a test with two email addresses pointing to one unix user in the virtUser file.

I have also changed line 402 in rcube_user.php to use the e-mail address as name value in the identities table.

So when I now made the first login of this user, the virtUser file gets searched trough and only one entry is made. It seems like this code is being skipped:

        $standard = 1;
        while ($sql_arr = $dbh->fetch_array($sql_result))
        {
          $dbh->query(
            "INSERT INTO ".get_table_name('identities')."
              (user_id, del, standard, name, email)
             VALUES (?, 0, ?, ?, ?)",
            $user_id,
            $standard,
            strip_newlines($user_name),
            preg_replace('/^@/', $user . '@', $sql_arr[0]));
          $standard = 0;
        }

While this one was successfully committed:

      else
      {
        // also create new identity records
        $dbh->query(
          "INSERT INTO ".get_table_name('identities')."
            (user_id, del, standard, name, email)
           VALUES (?, 0, 1, ?, ?)",
          $user_id,
          strip_newlines($user_email),
          strip_newlines($user_email));
      }

Changed 11 months ago by alec

  • status changed from new to closed
  • resolution set to fixed
  • component changed from Other to Core functionality

Fixed in r2384.

Changed 11 months ago by Napsty

Just tested it, works great! Thank you so much!

Note: See TracTickets for help on using tickets.