Mail alias readme file says "a user may associate additional email addresses with his account".
Should associate email address belong to a registered user email address?

What i have tried so far (before that i have a working module of mailhandler and also installed and enabled mailalias module)...
Now...
i have an account1 with user email address aaa@hotmal.com and account2 another user with email add. bbb@hotmal.com.

Now in the Email aliases field of user1 i gave the email address of user2 and
in the email aliases field of user2 is filled with email address of user1.

So when a blog/story/image is posted from user 1 (email address) the user 2 will also receve a copy of the blog and same functionalty if the email is sent from user 2.

Users who have a working model of mail alias module share your thoughts.....

Versons : drupal 4.5rc and mailalias (// $Id: mailalias.module,v 1.9 2004/10/01 21:51:48 ankur Exp $)

Comments

javanaut’s picture

It looks as if the validate process for mailalias needs to make sure that:

1) no user already exists with one of the email addresses submitted.
2) no user already has an alias specified that matches any of the submitted aliases.

This should probably be submitted as a feature request for the mailalias module.

The only hangup I can see is if someone "steals" your email address before you get around to specifying it as an alias. I guess the site admin is there to settle such disputes ;)

gkrishna’s picture

i would like to know what is the functionality of current(cvs) mailalias module. Can you give an example here on how to test the same...

--**--
krishna

javanaut’s picture

Currently, all the mailalias module does is to check to see that each email address is valid before setting a user property.

The code is here: http://cvs.drupal.org/viewcvs/contributions/modules/mailalias/mailalias....

It is a very small module. Here's the entire module:

// $Id: mailalias.module,v 1.9 2004/10/01 21:51:48 ankur Exp $

function mailalias_user($type, &$edit, &$user, $category = NULL) {
  if ($type == 'form' && $category == 'account') {
    // when user tries to edit his own data $output =
    $output = form_textfield(t('Email aliases'), 'mailalias', $user->mailalias, 70, 255, t('Add any additional email addresses, separated by commas. We use these to identify the author of email submissions. These email addresses are private and are not shared with other users.'));
    return array(array('title' => t('Personal information'), 'data' => $output, 'weight' => 2));
  }
  else if ($type == 'validate' && $category == 'account') {
    $mailalias = strtr($edit["mailalias"], array (" " => "")); // strip spaces
    $mailsarr = explode(",", $mailalias);
    foreach ($mailsarr as $mail) {
      if ($mail != null && $error = user_validate_mail($mail)) {
        form_set_error(t('Mail Alias'), $error);
      }
    }
    return $edit;
  }
}

function mailalias_help($section) {
  if ($section == "admin/modules#description") {
    return t("A user may associate additional email addresses with his account.");
  }
}

As you can see, it merely calls user_validate_mail($mail) for each email address specified. This function calls valid_email_address($mail), which just validates the format of the email address without checking the database.

gkrishna’s picture

shall i wrap up by saying that the current mailalias module just validates (server validation) the email address . In that case, if i have an email address (say ccc@email.com, ie., not a registered email address) under Email aliases field under my account, the blog posted from ccc@email.com will have to be posted in to my account.

--**--
krishna

javanaut’s picture

Yes, that is correct.

gkrishna’s picture

thanks.
well, i can receive emails from ccc@....

--**--
krishna

moshe weitzman’s picture

anyone is welcome to commit a fix to mailalias which prevents this stealing of email addresses. i think its sufficient for now to prevent addition of emails that have been previously used as primary or alias.

-moshe