Got this in a private message on the forums. Thought I'd pass it along:
You and the rest of the team are doing a great job. This might not be the right way to send this information but I have posted about this before with no results, so here it is for You and the rest of the team to do whatever You want with.
My improvements to the identity section. The easy one is about the sort order in the indentity list. Code:
/program/steps/settings/func.inc function rcmail_indentities_list..... // get contacts from DB ORDER BY standard DESC, name ASC, email ASC // this one is new....
The second one is a bit more. It improves the identity section in two ways.
You are logged in as 'mail@gunfro.com' You could only add identities to that domain. 2. You can NOT add an identity if it already exists in the domain. The domain You are logged into.
I made this in one chunk so it easier to add. It might be better to put the code more where it belongs, hope You get my point.
Code:
/program/steps/settings/save_identities.php
// check input if (empty($_POST['_name']) || empty($_POST['_email'])) { $OUTPUT->show_message('formincomplete', 'warning'); rcmail_overwrite_action('edit-identitiy'); return; }
//********************************************************************* // MOD GUNFRO START $newa = explode("@", $_POST['_email']); $curr = explode("@", $_SESSION['username']); // Check valid domain. if ($newa[1] != $curr[1]) { $OUTPUT->show_message('domainnotvalid', 'warning'); rcmail_overwrite_action($_framed ? 'edit-identity' : 'identities'); return; } // Check if changing email and it exits. if ($_POST['_iid']) { $DB->query("SELECT * FROM ".get_table_name('identities')." WHERE identity_id=? AND del<>1", $_POST['_iid']);
$curri = $DB->fetch_assoc(); if ($curri['email'] <> $_POST['_email']) { $DB->query("SELECT * FROM ".get_table_name('identities')." WHERE email=? AND del<>1", $_POST['_email']);
if ($DB->fetch_assoc() != NULL)
{
$OUTPUT->show_message('emailexists', 'warning');
rcmail_overwrite_action($_framed ? 'edit-identity' : 'identities');
return;
}
} } else { // Just new a identity $DB->query("SELECT * FROM ".get_table_name('identities')." WHERE email=? AND del<>1", $_POST['_email']);
if ($DB->fetch_assoc() != NULL) { $OUTPUT->show_message('emailexists', 'warning'); rcmail_overwrite_action($_framed ? 'edit-identity' : 'identities'); return; } }
// MOD GUNFRO END //*********************************************************************
// update an existing contact if ($_POST['_iid'])
That was my contribution for now. Best regards Gunnar Frödin / GunFro
- You can NOT add an identity 'outside' your own domain. That is
if You are logged in as 'mail@gunfro.com' You could only add
identities to that domain.
That's not really a good idea. I have a single mailbox with aliases
into it. Many of those aliases are from different domains, so this
patch would break my setup.
I suspect other people have identities for other domains, too.
On 7 Oct 2007, at 15:15, Brett Patterson wrote:
Got this in a private message on the forums. Thought I'd pass it
along:You and the rest of the team are doing a great job. This might not be the right way to send this information but I have
posted about this before with no results, so here it is for You and
the rest of the team to do whatever You want with.My improvements to the identity section. The easy one is about the sort order in the indentity list. Code:
/program/steps/settings/func.inc function rcmail_indentities_list..... // get contacts from DB
ORDER BY standard DESC, name ASC, email ASC // this one is new....
The second one is a bit more. It improves the identity section in
two ways.
- You can NOT add an identity 'outside' your own domain. That is
if You are logged in as 'mail@gunfro.com' You could only add
identities to that domain.
- You can NOT add an identity if it already exists in the domain.
The domain You are logged into.
I made this in one chunk so it easier to add. It might be better to
put the code more where it belongs, hope You get my point.Code:
/program/steps/settings/save_identities.php
// check input if (empty($_POST['_name']) || empty($_POST['_email'])) { $OUTPUT->show_message('formincomplete', 'warning');
rcmail_overwrite_action('edit-identitiy'); return; }
//
// MOD GUNFRO START $newa = explode("@", $_POST['_email']);
$curr = explode("@", $_SESSION['username']); // Check valid domain. if ($newa[1] != $curr[1]) { $OUTPUT->show_message('domainnotvalid', 'warning'); rcmail_overwrite_action($_framed ? 'edit-identity' : 'identities');
return; } // Check if changing email and it exits. if ($_POST['_iid']) { $DB->query("SELECT * FROM ".get_table_name('identities')." WHERE identity_id=?
AND del<>1", $_POST['_iid']);
$curri = $DB->fetch_assoc(); if ($curri['email'] <> $_POST['_email']) { $DB->query("SELECT * FROM ".get_table_name('identities')."
WHERE email=? AND del<>1", $_POST['_email']); if ($DB->fetch_assoc() != NULL) { $OUTPUT->show_message('emailexists', 'warning'); rcmail_overwrite_action($_framed ? 'edit-identity' :
'identities'); return; } } } else { // Just new a identity $DB->query("SELECT * FROM ".get_table_name('identities')."
WHERE email=? AND del<>1", $_POST['_email']);
if ($DB->fetch_assoc() != NULL) { $OUTPUT->show_message('emailexists', 'warning');
rcmail_overwrite_action($_framed ? 'edit-identity' :
'identities'); return; } }
// MOD GUNFRO END //
// update an existing contact if ($_POST['_iid'])
That was my contribution for now. Best regards Gunnar Frödin / GunFro -- ~ Brett Patterson _______________________________________________ List info: http://lists.roundcube.net/dev/
List info: http://lists.roundcube.net/dev/
Drarok Ithaqua a écrit :
- You can NOT add an identity 'outside' your own domain. That is if You are logged in as 'mail@gunfro.com' You could only add identities to that domain.
That's not really a good idea. I have a single mailbox with aliases into it. Many of those aliases are from different domains, so this patch would break my setup. I suspect other people have identities for other domains, too.
I believe this is appropriate for a corporate type setup. In this case, it could make sense that your only identities are inside the domain.
What about the case where the company has multiple domains?
Where I work, we operate a number of companies, each with their own
individual email addresses.
Or, an even simpler case: .co.uk vs .com mailing for international/ local... things. :)
On 7 Oct 2007, at 15:33, Aurélien Pocheville wrote:
Drarok Ithaqua a écrit :
- You can NOT add an identity 'outside' your own domain. That is
if You are logged in as 'mail@gunfro.com' You could only add
identities to that domain.That's not really a good idea. I have a single mailbox with aliases into it. Many of those aliases are from different domains, so this patch would break my setup. I suspect other people have identities for other domains, too.
I believe this is appropriate for a corporate type setup. In this case, it could make sense that your only identities are inside the domain.
-- Aurelien Pocheville PhD Student IBISC-CNRS Engineer IIE 2003
aurelien.pocheville@haptique.com http://www.haptique.com/ Tel : 33 6 60 07 75 29 Fax : 33 9 56 73 71 06 University of Evry Val d'Essonne 40 rue du Pelvoux - CE 1455 91020 EVRY CEDEX
List info: http://lists.roundcube.net/dev/
List info: http://lists.roundcube.net/dev/
I also have many aliases from different domains going to a single account.
Thunderbird has a feature to reply from whatever email address the message was sent to if an identity is setup. This is a *very* nice feature.
Matt
Drarok Ithaqua wrote:
- You can NOT add an identity 'outside' your own domain. That is if
You are logged in as 'mail@gunfro.com' You could only add identities to that domain.
That's not really a good idea. I have a single mailbox with aliases into it. Many of those aliases are from different domains, so this patch would break my setup. I suspect other people have identities for other domains, too.
On 7 Oct 2007, at 15:15, Brett Patterson wrote:
Got this in a private message on the forums. Thought I'd pass it along:
You and the rest of the team are doing a great job. This might not be the right way to send this information but I have posted about this before with no results, so here it is for You and the rest of the team to do whatever You want with.
My improvements to the identity section. The easy one is about the sort order in the indentity list. Code:
/program/steps/settings/func.inc function rcmail_indentities_list..... // get contacts from DB
ORDER BY standard DESC, name ASC, email ASC // this one is new....
The second one is a bit more. It improves the identity section in two ways.
- You can NOT add an identity 'outside' your own domain. That is if
You are logged in as 'mail@gunfro.com' You could only add identities to that domain.
- You can NOT add an identity if it already exists in the domain. The
domain You are logged into.
I made this in one chunk so it easier to add. It might be better to put the code more where it belongs, hope You get my point.
Code:
/program/steps/settings/save_identities.php
// check input if (empty($_POST['_name']) || empty($_POST['_email'])) { $OUTPUT->show_message('formincomplete', 'warning');
rcmail_overwrite_action('edit-identitiy'); return; }
//********************************************************************* // MOD GUNFRO START $newa = explode("@", $_POST['_email']);
$curr = explode("@", $_SESSION['username']); // Check valid domain. if ($newa[1] != $curr[1]) { $OUTPUT->show_message('domainnotvalid', 'warning'); rcmail_overwrite_action($_framed ? 'edit-identity' : 'identities');
return; } // Check if changing email and it exits. if ($_POST['_iid']) { $DB->query("SELECT * FROM ".get_table_name('identities')." WHERE identity_id=?
AND del<>1", $_POST['_iid']);
$curri = $DB->fetch_assoc(); if ($curri['email'] <> $_POST['_email']) { $DB->query("SELECT * FROM ".get_table_name('identities')."
WHERE email=? AND del<>1", $_POST['_email']); if ($DB->fetch_assoc() != NULL) { $OUTPUT->show_message('emailexists', 'warning'); rcmail_overwrite_action($_framed ? 'edit-identity' : 'identities'); return; }
} } else { // Just new a identity $DB->query("SELECT * FROM ".get_table_name('identities')."
WHERE email=? AND del<>1", $_POST['_email']);
if ($DB->fetch_assoc() != NULL) { $OUTPUT->show_message('emailexists', 'warning');
rcmail_overwrite_action($_framed ? 'edit-identity' : 'identities'); return;
} }
// MOD GUNFRO END //*********************************************************************
// update an existing contact if ($_POST['_iid'])
That was my contribution for now. Best regards Gunnar Frödin / GunFro -- ~ Brett Patterson _______________________________________________ List info: http://lists.roundcube.net/dev/
List info: http://lists.roundcube.net/dev/
List info: http://lists.roundcube.net/dev/
I believe RoundCube already has this feature implemented...
I have just sent an email to myself to my non-main identity. Clicking
Reply in RC sets the correct sender.
On 7 Oct 2007, at 17:08, Matt Kaatman wrote:
I also have many aliases from different domains going to a single
account.Thunderbird has a feature to reply from whatever email address the message was sent to if an identity is setup. This is a *very* nice
feature.Matt
Drarok Ithaqua wrote:
- You can NOT add an identity 'outside' your own domain. That is if
You are logged in as 'mail@gunfro.com' You could only add identities to that domain.
That's not really a good idea. I have a single mailbox with
aliases into it. Many of those aliases are from different domains, so this patch would break my setup. I suspect other people have identities for other domains, too.On 7 Oct 2007, at 15:15, Brett Patterson wrote:
Got this in a private message on the forums. Thought I'd pass it
along:You and the rest of the team are doing a great job. This might not be the right way to send this information but I have posted about this before with no results, so here it is for You and the rest of the team to do whatever You want with.
My improvements to the identity section. The easy one is about the sort order in the indentity list. Code:
/program/steps/settings/func.inc function rcmail_indentities_list..... // get contacts from DB
ORDER BY standard DESC, name ASC, email ASC // this one is new....
The second one is a bit more. It improves the identity section in
two ways.
- You can NOT add an identity 'outside' your own domain. That is if
You are logged in as 'mail@gunfro.com' You could only add identities to that domain.
- You can NOT add an identity if it already exists in the
domain. The domain You are logged into.
I made this in one chunk so it easier to add. It might be better to put the code more where it belongs, hope You get my point.
Code:
/program/steps/settings/save_identities.php
// check input if (empty($_POST['_name']) || empty($_POST['_email'])) { $OUTPUT->show_message('formincomplete', 'warning');
rcmail_overwrite_action('edit-identitiy'); return; }
//
// MOD GUNFRO START $newa = explode("@", $_POST['_email']);
$curr = explode("@", $_SESSION['username']); // Check valid domain. if ($newa[1] != $curr[1]) { $OUTPUT->show_message('domainnotvalid', 'warning'); rcmail_overwrite_action($_framed ? 'edit-identity' :
'identities');return; } // Check if changing email and it exits. if ($_POST['_iid']) { $DB->query("SELECT * FROM ".get_table_name('identities')." WHERE identity_id=?
AND del<>1", $_POST['_iid']);
$curri = $DB->fetch_assoc(); if ($curri['email'] <> $_POST['_email']) { $DB->query("SELECT * FROM ".get_table_name('identities')."
WHERE email=? AND del<>1", $_POST['_email']); if ($DB->fetch_assoc() != NULL) { $OUTPUT->show_message('emailexists', 'warning'); rcmail_overwrite_action($_framed ? 'edit-identity' :
'identities'); return; } } } else { // Just new a identity $DB->query("SELECT * FROM ".get_table_name('identities')."
WHERE email=? AND del<>1", $_POST['_email']);
if ($DB->fetch_assoc() != NULL) { $OUTPUT->show_message('emailexists', 'warning');
rcmail_overwrite_action($_framed ? 'edit-identity' :
'identities'); return; } }
// MOD GUNFRO END //
// update an existing contact if ($_POST['_iid'])
That was my contribution for now. Best regards Gunnar Frödin / GunFro -- ~ Brett Patterson _______________________________________________ List info: http://lists.roundcube.net/dev/
List info: http://lists.roundcube.net/dev/
List info: http://lists.roundcube.net/dev/