From 3ed2faffc9f155f351895793615b9b54420a6797 Mon Sep 17 00:00:00 2001 From: lkehresman Date: Mon, 14 Aug 2000 20:20:31 +0000 Subject: [PATCH] tweaked conf.pl added patch from Bill Thousand to allow sending with virtual domains (see smtp.php for more info in function sendSMTP) git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@712 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- ChangeLog | 3 ++- config/conf.pl | 12 ++++++------ functions/smtp.php | 31 +++++++++++++++++++++++++++++-- 3 files changed, 37 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 82e92b21..45140632 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ Version 0.5pre2 -- DEVELOPMENT ------------------------------ +- Added a patch from Bill Thousand to allow easier virtual domains +- Security updates with attachments - Added more hooks for plugins, updated plugin.txt - Improved HTML address book - Fixed bugs in parsing email addresses in smtp.php @@ -10,7 +12,6 @@ Version 0.5pre2 -- DEVELOPMENT - Made message highlighting case insensative - Added French translation from Ali Nedjimi - Version 0.5pre1 -- August 9, 2000 --------------------------------- - Searching folders functionality added diff --git a/config/conf.pl b/config/conf.pl index ee11dffe..8ae7ddda 100755 --- a/config/conf.pl +++ b/config/conf.pl @@ -252,11 +252,6 @@ while (($command ne "q") && ($command ne "Q")) { print "8. Plugins\n"; print "\n"; print "D. Set pre-defined settings for specific IMAP servers\n"; - if ($config_use_color == 1) { - print "C. Turn color off\n"; - } else { - print "C. Turn color on\n"; - } print "\n"; } elsif ($menu == 1) { print $WHT."Organization Preferences\n".$NRM; @@ -374,6 +369,11 @@ while (($command ne "q") && ($command ne "Q")) { print "\n"; print "R Return to Main Menu\n"; } + if ($config_use_color == 1) { + print "C. Turn color off\n"; + } else { + print "C. Turn color on\n"; + } print "S Save data\n"; print "Q Quit\n"; @@ -409,7 +409,7 @@ while (($command ne "q") && ($command ne "Q")) { $WHT = "\x1B[37;1m"; $NRM = "\x1B[0m"; } - } elsif (($command eq "d") || ($command eq "D")) { + } elsif ((($command eq "d") || ($command eq "D")) && $menu == 0) { set_defaults (); } else { $saved = 0; diff --git a/functions/smtp.php b/functions/smtp.php index eecd74fa..f8c3fdbb 100644 --- a/functions/smtp.php +++ b/functions/smtp.php @@ -285,8 +285,35 @@ $bcc = parseAddrs($b); $from_addr = getPref($data_dir, $username, "email_address"); - if ($from_addr == "") - $from_addr = "$username@$domain"; + + /* + * A patch from Bill Thousand + * + * "I don't know if anyone else needs this or not, but it totally makes squirrelmail usable for us. + * This quick patch checks the username and from address for the domain information. We use + * a virtual domain patch for our imap server that allows multiple domains by using username@domain.com + * as the login username." + */ + if ($from_addr == "") { + if (strstr($username, "@")) { + $from_addr = $username; + $address_pieces = explode("@",$username); + $domain = $address_pieces[1]; + } else { + $from_addr = "$username@$domain"; + } + } else { + // If the From Address is specified, use the domain in the from + // address if it's there. + if (strstr($from_addr, "@")) { + $address_pieces = explode("@", $from_addr); + $domain = $address_pieces[1]; + } + } + /* + * End patch from Bill Thousand + */ + $smtpConnection = fsockopen($smtpServerAddress, $smtpPort, $errorNumber, $errorString); if (!$smtpConnection) { -- 2.25.1