Hi list,
I am currently using the CVS from the first week of January.
In my config file I use the following pieces of code to generate a login based upon what domain a user is accessing round cube from.
// the mail host chosen to perform the log-in // leave blank to show a textbox at login, give a list of hosts // to display a pulldown menu or set one host as string. // To use SSL connection, enter ssl://hostname:993 $rcmail_config['default_host'] = 'mail.' . '' . str_replace("www.", "", $_SERVER['HTTP_HOST']);
(This allows me to accept just the user name in the login screen and use this install across different domains.)
I then do the same for the SMTP server.
// use this host for sending mails. // to use SSL connection, set ssl://smtp.host.com // if left blank, the PHP mail() function is used $rcmail_config['smtp_server'] = 'mail.' . '' . str_replace("www.", "", $_SERVER['HTTP_HOST']);
(This contacts the SMTP of the domain being accessed.)
Next, our SMTP server requires that the user specify their full email address as their user name. In round cube I have been making this happen automatically by using the following code:
// SMTP username (if required) if you use %u as the username RoundCube // will use the current username for login $rcmail_config['smtp_user'] = '%u' . '@' . '' . str_replace("www.", "", $_SERVER['HTTP_HOST']);
It has been working so that it takes the domain, converts it to @domain.com and then adds the user's name before the @ symbol. However, upon using the CVS version, I am now showing in my SMTP-Auth logs that it is trying to login as %u@domain.com instead of username@domain.com
Any ideas as to why this is no longer working? I am in the midst of updating to the newest CVS. I am just affraid that that is not going to be the problem.
Round Cube's error log shows the following: [17-Jan-2006 12:27:58 -0500] SMTP Error: SMTP error: authentication failure in /domain.com/www/roundcube/program/steps/mail/sendmail.inc on line 216
Thanks in advance, Kevin L.
Ok, still having the same problems, but this is what I have been testing.
I updated to today's CVS (2006-01-17). The problem still exists after this update.
I also followed a suggestion by Rob Smith to replace '%u' with "%u" followed by the rest of my code. However, this made no change.
As I continued to play with the code, I recognized that if I use:
$rcmail_config['smtp_user'] = "%u";
or
$rcmail_config['smtp_user'] = '%u';
Then the result is "username". However, as soon as I add the rest of my code:
$rcmail_config['smtp_user'] = "%u" . '@' . '' . str_replace("www.", "", $_SERVER['HTTP_HOST']);
The result is "%u@domain.com".
So, my guess is that the rest of my code makes some change that goofs things up. What the problem is, I dunno.
Any insight, anyone?
Thanks again!
Kevin L.
(BTW, should I be posting this in the user list? Used to posting here, but anywho.)
Kevin Landers wrote:
Hi list,
I am currently using the CVS from the first week of January.
In my config file I use the following pieces of code to generate a login based upon what domain a user is accessing round cube from.
// the mail host chosen to perform the log-in // leave blank to show a textbox at login, give a list of hosts // to display a pulldown menu or set one host as string. // To use SSL connection, enter ssl://hostname:993 $rcmail_config['default_host'] = 'mail.' . '' . str_replace("www.", "", $_SERVER['HTTP_HOST']);
(This allows me to accept just the user name in the login screen and use this install across different domains.)
I then do the same for the SMTP server.
// use this host for sending mails. // to use SSL connection, set ssl://smtp.host.com // if left blank, the PHP mail() function is used $rcmail_config['smtp_server'] = 'mail.' . '' . str_replace("www.", "", $_SERVER['HTTP_HOST']);
(This contacts the SMTP of the domain being accessed.)
Next, our SMTP server requires that the user specify their full email address as their user name. In round cube I have been making this happen automatically by using the following code:
// SMTP username (if required) if you use %u as the username RoundCube // will use the current username for login $rcmail_config['smtp_user'] = '%u' . '@' . '' . str_replace("www.", "", $_SERVER['HTTP_HOST']);
It has been working so that it takes the domain, converts it to @domain.com and then adds the user's name before the @ symbol. However, upon using the CVS version, I am now showing in my SMTP-Auth logs that it is trying to login as %u@domain.com instead of username@domain.com
Any ideas as to why this is no longer working? I am in the midst of updating to the newest CVS. I am just affraid that that is not going to be the problem.
Round Cube's error log shows the following: [17-Jan-2006 12:27:58 -0500] SMTP Error: SMTP error: authentication failure in /domain.com/www/roundcube/program/steps/mail/sendmail.inc on line 216
Thanks in advance, Kevin L.
Hi Kevin,
Roundcube did only replace the %u string when it was $rcmail_config['smtp_user'] == '%u'
I changed it to use str_replace(). Now your configuration should actually work. Just apply the attached patch.
Regards, Thomas
Kevin Landers wrote:
Ok, still having the same problems, but this is what I have been testing.
I updated to today's CVS (2006-01-17). The problem still exists after this update.
I also followed a suggestion by Rob Smith to replace '%u' with "%u" followed by the rest of my code. However, this made no change.
As I continued to play with the code, I recognized that if I use:
$rcmail_config['smtp_user'] = "%u";
or
$rcmail_config['smtp_user'] = '%u';
Then the result is "username". However, as soon as I add the rest of my code:
$rcmail_config['smtp_user'] = "%u" . '@' . '' . str_replace("www.", "", $_SERVER['HTTP_HOST']);
The result is "%u@domain.com".
So, my guess is that the rest of my code makes some change that goofs things up. What the problem is, I dunno.
Any insight, anyone?
Thanks again!
Kevin L.
(BTW, should I be posting this in the user list? Used to posting here, but anywho.)
Kevin Landers wrote:
Hi list,
I am currently using the CVS from the first week of January.
In my config file I use the following pieces of code to generate a login based upon what domain a user is accessing round cube from.
// the mail host chosen to perform the log-in // leave blank to show a textbox at login, give a list of hosts // to display a pulldown menu or set one host as string. // To use SSL connection, enter ssl://hostname:993 $rcmail_config['default_host'] = 'mail.' . '' . str_replace("www.", "", $_SERVER['HTTP_HOST']);
(This allows me to accept just the user name in the login screen and use this install across different domains.)
I then do the same for the SMTP server.
// use this host for sending mails. // to use SSL connection, set ssl://smtp.host.com // if left blank, the PHP mail() function is used $rcmail_config['smtp_server'] = 'mail.' . '' . str_replace("www.", "", $_SERVER['HTTP_HOST']);
(This contacts the SMTP of the domain being accessed.)
Next, our SMTP server requires that the user specify their full email address as their user name. In round cube I have been making this happen automatically by using the following code:
// SMTP username (if required) if you use %u as the username RoundCube // will use the current username for login $rcmail_config['smtp_user'] = '%u' . '@' . '' . str_replace("www.", "", $_SERVER['HTTP_HOST']);
It has been working so that it takes the domain, converts it to @domain.com and then adds the user's name before the @ symbol. However, upon using the CVS version, I am now showing in my SMTP-Auth logs that it is trying to login as %u@domain.com instead of username@domain.com
Any ideas as to why this is no longer working? I am in the midst of updating to the newest CVS. I am just affraid that that is not going to be the problem.
Round Cube's error log shows the following: [17-Jan-2006 12:27:58 -0500] SMTP Error: SMTP error: authentication failure in /domain.com/www/roundcube/program/steps/mail/sendmail.inc on line 216
Thanks in advance, Kevin L.
diff -u -r1.7 -r1.8 --- program/include/rcube_smtp.inc 16 Dec 2005 20:05:40 -0000 1.7 +++ program/include/rcube_smtp.inc 19 Jan 2006 22:48:40 -0000 1.8 @@ -91,13 +91,13 @@ // attempt to authenticate to the SMTP server if ($CONFIG['smtp_user'] && $CONFIG['smtp_pass']) {
if ($CONFIG['smtp_user'] == '%u')
$smtp_user = $_SESSION['username'];
if (strstr($CONFIG['smtp_user'], '%u'))
$smtp_user = str_replace('%u', $_SESSION['username'], $CONFIG['smtp_user']);
else
$smtp_user = $CONFIG['smtp_user'];
if ($CONFIG['smtp_pass'] == '%p')
$smtp_pass = decrypt_passwd($_SESSION['password']);
if (strstr($CONFIG['smtp_pass'], '%p'))
$smtp_pass = str_replace('%p', decrypt_passwd($_SESSION['password']), $CONFIG['smtp_pass']);
else
$smtp_pass = $CONFIG['smtp_pass'];