My users unfortunately would be sending email as username@localhost for a good 10 years before they read my email saying "Set up your identity so you don't look like an idiot".
Either way I developed a small patch that creates the global config variable "from_domain" and is set to the servers variable MAILDOMAIN as in this example:
<VirtualHost *> .. SetEnv MAILDOMAIN mydomain.com ..
</VirtualHost>
this modifies only the email portion of the identity creation functions, if no MAILDOMAIN it will revert to the default behaviour.
Is this just a fixup in what would be a large patchset for better vhost setups? hopefully.
Hi,
Is there any chance that this patch will be included? I think it's very usefull! (Or is there any other way, to accomplish this?)
Pieter.
Shane R. Spencer schreef:
My users unfortunately would be sending email as username@localhost for a good 10 years before they read my email saying "Set up your identity so you don't look like an idiot".
Either way I developed a small patch that creates the global config variable "from_domain" and is set to the servers variable MAILDOMAIN as in this example:
<VirtualHost *> .. SetEnv MAILDOMAIN mydomain.com ..
</VirtualHost>
this modifies only the email portion of the identity creation functions, if no MAILDOMAIN it will revert to the default behaviour.
Is this just a fixup in what would be a large patchset for better vhost setups? hopefully.
Index: config/main.inc.php.dist
RCS file: /cvsroot/roundcubemail/roundcubemail/config/main.inc.php.dist,v retrieving revision 1.11 diff -b -u -r1.11 main.inc.php.dist --- config/main.inc.php.dist 31 Oct 2005 23:40:22 -0000 1.11 +++ config/main.inc.php.dist 13 Nov 2005 20:55:58 -0000 @@ -36,6 +36,9 @@ // TCP port used for IMAP connections $rcmail_config['default_port'] = 143;
+// Server variable for setting default domain for identity +$rcmail_config['from_domain'] = $_SERVER['MAILDOMAIN'];
// use this host for sending mails. // if left blank, the PHP mail() function is used $rcmail_config['smtp_server'] = ''; Index: program/include/main.inc =================================================================== RCS file: /cvsroot/roundcubemail/roundcubemail/program/include/main.inc,v retrieving revision 1.25 diff -b -u -r1.25 main.inc --- program/include/main.inc 7 Nov 2005 00:32:55 -0000 1.25 +++ program/include/main.inc 13 Nov 2005 20:56:17 -0000 @@ -369,7 +369,11 @@
if ($user_id = $DB->insert_id('user_ids')) {
if($CONFIG['from_domain'])
$user_email = strstr($user, '@') ? $user : sprintf('%s@%s', $user, $CONFIG['from_domain']);
else $user_email = strstr($user, '@') ? $user : sprintf('%s@%s', $user, $host);
$user_name = $user!=$user_email ? $user : '';
// also create a new identity record
Pieter Hoekstra wrote:
Hi,
Is there any chance that this patch will be included? I think it's very usefull! (Or is there any other way, to accomplish this?)
It will be included soon. I just chose to name the config parameter 'mail_domain' insted of 'from_domain'.
It will also be possible to define an array of mail_domains with domains for each possible host.
Regards, Thomas
Pieter.
Shane R. Spencer schreef:
My users unfortunately would be sending email as username@localhost for a good 10 years before they read my email saying "Set up your identity so you don't look like an idiot".
Either way I developed a small patch that creates the global config variable "from_domain" and is set to the servers variable MAILDOMAIN as in this example:
<VirtualHost *> .. SetEnv MAILDOMAIN mydomain.com ..
</VirtualHost>
this modifies only the email portion of the identity creation functions, if no MAILDOMAIN it will revert to the default behaviour.
Is this just a fixup in what would be a large patchset for better vhost setups? hopefully.
Index: config/main.inc.php.dist
RCS file: /cvsroot/roundcubemail/roundcubemail/config/main.inc.php.dist,v retrieving revision 1.11 diff -b -u -r1.11 main.inc.php.dist --- config/main.inc.php.dist 31 Oct 2005 23:40:22 -0000 1.11 +++ config/main.inc.php.dist 13 Nov 2005 20:55:58 -0000 @@ -36,6 +36,9 @@ // TCP port used for IMAP connections $rcmail_config['default_port'] = 143;
+// Server variable for setting default domain for identity +$rcmail_config['from_domain'] = $_SERVER['MAILDOMAIN'];
// use this host for sending mails. // if left blank, the PHP mail() function is used $rcmail_config['smtp_server'] = ''; Index: program/include/main.inc =================================================================== RCS file: /cvsroot/roundcubemail/roundcubemail/program/include/main.inc,v retrieving revision 1.25 diff -b -u -r1.25 main.inc --- program/include/main.inc 7 Nov 2005 00:32:55 -0000 1.25 +++ program/include/main.inc 13 Nov 2005 20:56:17 -0000 @@ -369,7 +369,11 @@
if ($user_id = $DB->insert_id('user_ids')) {
- if($CONFIG['from_domain'])
$user_email = strstr($user, '@') ? $user : sprintf('%s@%s',
$user, $CONFIG['from_domain']);
- else $user_email = strstr($user, '@') ? $user : sprintf('%s@%s',
$user, $host);
- $user_name = $user!=$user_email ? $user : ''; // also create a new identity record