Menu

#1789 $domain appended if email_address preference is unset

Development CVS
closed-fixed
nobody
Compose (426)
5
2005-06-13
2005-06-12
Anonymous
No

Hello,

In function get_identities() (in
functions/identity.php) $username@$domain is used as
email address if email_address is not set in
preferences. Most of the time that's fine, but in my
case users log in with their email address and those
who had not set email_address were given a weird
address of the format username@domain@default-domain
and the sendmail program (Exim) refused to send out
messages with such addresses.

In src/compose.php in deliverMessage() there's a hack
for usernames of the form username@domain, but that
hack stops working since it only comes to action if
$idents[$identity]['email_address'] is not set and now
it becomes set in get_identities() to $username@$domain
no matter what is the format of $username.

My fix was to replace

if ( ! $em ) $em = $username.'@'.$domain;

with

if ( ! $em ) $em = strpos($username, '@') == false
? $username.'@'.$domain : $username;

in get_identities().

Kirill

Discussion

  • Jonathan Angliss

    • status: open --> closed-fixed
     
  • Jonathan Angliss

    Logged In: YES
    user_id=620333

    I believe that the bug you reported has been fixed in the CVS version. Please either grab a live CVS version or wait and grab an archive of the CVS from tomorrow or later (just to make sure it has the changes in it).

    If the bug does not exist after you update to the CVS version, please close this bug report.

     

Log in to post a comment.