[prev in list] [next in list] [prev in thread] [next in thread]
List: squirrelmail-cvs
Subject: [SM-CVS] SF.net SVN: squirrelmail:[13239] trunk/squirrelmail
From: pdontthink () users ! sourceforge ! net
Date: 2008-07-19 17:30:14
Message-ID: E1KKGG6-0002bI-0o () 74yxhf1 ! ch3 ! sourceforge ! com
[Download RAW message or body]
Revision: 13239
http://squirrelmail.svn.sourceforge.net/squirrelmail/?rev=13239&view=rev
Author: pdontthink
Date: 2008-07-19 17:27:54 +0000 (Sat, 19 Jul 2008)
Log Message:
-----------
Allow a different server address for the POP server to be configured when using POP \
before SMTP
Modified Paths:
--------------
trunk/squirrelmail/ChangeLog
trunk/squirrelmail/class/deliver/Deliver_SMTP.class.php
trunk/squirrelmail/config/conf.pl
trunk/squirrelmail/config/config_default.php
trunk/squirrelmail/functions/compose.php
trunk/squirrelmail/src/compose.php
trunk/squirrelmail/src/configtest.php
trunk/squirrelmail/src/read_body.php
Modified: trunk/squirrelmail/ChangeLog
===================================================================
--- trunk/squirrelmail/ChangeLog 2008-07-19 07:31:43 UTC (rev 13238)
+++ trunk/squirrelmail/ChangeLog 2008-07-19 17:27:54 UTC (rev 13239)
@@ -259,6 +259,8 @@
have long been in the file-based prefs backend
- Removed the Address Take (abook_take) plugin; please see the Add Address
(third party) plugin.
+ - Allow a different server address for the POP server to be configured when
+ using POP before SMTP.
Version 1.5.1 (branched on 2006-02-12)
--------------------------------------
Modified: trunk/squirrelmail/class/deliver/Deliver_SMTP.class.php
===================================================================
--- trunk/squirrelmail/class/deliver/Deliver_SMTP.class.php 2008-07-19 07:31:43 UTC \
(rev 13238)
+++ trunk/squirrelmail/class/deliver/Deliver_SMTP.class.php 2008-07-19 17:27:54 UTC \
(rev 13239) @@ -62,11 +62,11 @@
}
}
- function initStream($message, $domain, $length=0, $host='', $port='', $user='', \
$pass='', $authpop=false) { + function initStream($message, $domain, $length=0, \
$host='', $port='', $user='', $pass='', $authpop=false, $pop_host='') { global \
$use_smtp_tls,$smtp_auth_mech;
if ($authpop) {
- $this->authPop($host, '', $user, $pass);
+ $this->authPop($pop_host, '', $user, $pass);
}
$rfc822_header = $message->rfc822_header;
Modified: trunk/squirrelmail/config/conf.pl
===================================================================
--- trunk/squirrelmail/config/conf.pl 2008-07-19 07:31:43 UTC (rev 13238)
+++ trunk/squirrelmail/config/conf.pl 2008-07-19 17:27:54 UTC (rev 13239)
@@ -372,6 +372,7 @@
$useSendmail = 'false' if ( lc($useSendmail) ne 'true' );
$sendmail_path = "/usr/sbin/sendmail" if ( !$sendmail_path );
$pop_before_smtp = 'false' if ( !$pop_before_smtp );
+$pop_before_smtp_host = '' if ( !$pop_before_smtp_host );
$default_unseen_notify = 2 if ( !$default_unseen_notify );
$default_unseen_type = 1 if ( !$default_unseen_type );
$config_use_color = 0 if ( !$config_use_color );
@@ -1333,13 +1334,38 @@
$YesNo = 'n';
$YesNo = 'y' if ( lc($pop_before_smtp) eq 'true' );
- print "Use pop before SMTP (y/n) [$WHT$YesNo$NRM]: $WHT";
+ print "Use POP before SMTP (y/n) [$WHT$YesNo$NRM]: $WHT";
$new_pop_before_smtp = <STDIN>;
$new_pop_before_smtp =~ tr/yn//cd;
- return 'true' if ( $new_pop_before_smtp eq "y" );
- return 'false' if ( $new_pop_before_smtp eq "n" );
- return $pop_before_smtp;
+ if ( $new_pop_before_smtp eq "y" ) {
+ $new_pop_before_smtp = "true";
+ } elsif ( $new_pop_before_smtp eq "n" ) {
+ $new_pop_before_smtp = "false";
+ } else {
+ $new_pop_before_smtp = $pop_before_smtp;
+ }
+
+ # if using POP before SMTP, allow setting of custom POP server address
+ if ($new_pop_before_smtp eq "true") {
+ print "$NRM\nIf the address of the POP server is not the same as\n";
+ print "your SMTP server, you may specify it here. Leave blank (to\n";
+ print "clear this, enter only spaces) to use the same address as\n";
+ print "your SMTP server.\n";
+ print "POP before SMTP server address [$WHT$pop_before_smtp_host$NRM]: \
$WHT"; +
+ $new_pop_before_smtp_host = <STDIN>;
+ if ( $new_pop_before_smtp_host eq "\n" ) {
+ $new_pop_before_smtp_host = $pop_before_smtp_host;
+ } elsif ($new_pop_before_smtp_host =~ /^\s+$/) {
+ $new_pop_before_smtp_host = '';
+ } else {
+ $new_pop_before_smtp_host =~ s/[\r|\n]//g;
+ }
+ $pop_before_smtp_host = $new_pop_before_smtp_host;
+ }
+
+ return $new_pop_before_smtp;
}
# imap_server_type
@@ -4570,6 +4596,8 @@
# boolean
print CF "\$pop_before_smtp = $pop_before_smtp;\n";
# string
+ print CF "\$pop_before_smtp_host = '$pop_before_smtp_host';\n";
+ # string
print CF "\$imap_server_type = '$imap_server_type';\n";
# boolean
print CF "\$invert_time = $invert_time;\n";
Modified: trunk/squirrelmail/config/config_default.php
===================================================================
--- trunk/squirrelmail/config/config_default.php 2008-07-19 07:31:43 UTC (rev 13238)
+++ trunk/squirrelmail/config/config_default.php 2008-07-19 17:27:54 UTC (rev 13239)
@@ -322,7 +322,18 @@
*/
$pop_before_smtp = false;
+/**
+ * POP before SMTP server address
+ *
+ * When using POP3 before SMTP, if the POP server address is
+ * not the same as the SMTP server address, specify it here.
+ * If this is left empty, the SMTP server address will be
+ * used by default.
+ * @global bool $pop_before_smtp_host
+ */
+$pop_before_smtp_host = '';
+
/*** Folder Settings ***/
/**
* Default IMAP folder prefix
Modified: trunk/squirrelmail/functions/compose.php
===================================================================
--- trunk/squirrelmail/functions/compose.php 2008-07-19 07:31:43 UTC (rev 13238)
+++ trunk/squirrelmail/functions/compose.php 2008-07-19 17:27:54 UTC (rev 13239)
@@ -130,14 +130,16 @@
if (!$useSendmail) {
require_once(SM_PATH . 'class/deliver/Deliver_SMTP.class.php');
$deliver = new Deliver_SMTP();
- global $smtpServerAddress, $smtpPort, $pop_before_smtp, $domain;
+ global $smtpServerAddress, $smtpPort, $pop_before_smtp,
+ $domain, $pop_before_smtp_host;
$authPop = (isset($pop_before_smtp) && $pop_before_smtp) ? true : false;
+ if (empty($pop_before_smtp_host)) $pop_before_smtp_host = $smtpServerAddress;
$user = '';
$pass = '';
get_smtp_user($user, $pass);
$stream = $deliver->initStream($message,$domain,0,
- $smtpServerAddress, $smtpPort, $user, $pass, $authPop);
+ $smtpServerAddress, $smtpPort, $user, $pass, $authPop, \
$pop_before_smtp_host); } else {
require_once(SM_PATH . 'class/deliver/Deliver_SendMail.class.php');
global $sendmail_path, $sendmail_args;
Modified: trunk/squirrelmail/src/compose.php
===================================================================
--- trunk/squirrelmail/src/compose.php 2008-07-19 07:31:43 UTC (rev 13238)
+++ trunk/squirrelmail/src/compose.php 2008-07-19 17:27:54 UTC (rev 13239)
@@ -1577,12 +1577,13 @@
if (!$useSendmail && !$draft) {
require_once(SM_PATH . 'class/deliver/Deliver_SMTP.class.php');
$deliver = new Deliver_SMTP();
- global $smtpServerAddress, $smtpPort, $pop_before_smtp;
+ global $smtpServerAddress, $smtpPort, $pop_before_smtp, \
$pop_before_smtp_host;
$authPop = (isset($pop_before_smtp) && $pop_before_smtp) ? true : false;
+ if (empty($pop_before_smtp_host)) $pop_before_smtp_host = \
$smtpServerAddress; get_smtp_user($user, $pass);
$stream = $deliver->initStream($composeMessage,$domain,0,
- $smtpServerAddress, $smtpPort, $user, $pass, $authPop);
+ $smtpServerAddress, $smtpPort, $user, $pass, $authPop, \
$pop_before_smtp_host); } elseif (!$draft) {
require_once(SM_PATH . 'class/deliver/Deliver_SendMail.class.php');
global $sendmail_path, $sendmail_args;
Modified: trunk/squirrelmail/src/configtest.php
===================================================================
--- trunk/squirrelmail/src/configtest.php 2008-07-19 07:31:43 UTC (rev 13238)
+++ trunk/squirrelmail/src/configtest.php 2008-07-19 17:27:54 UTC (rev 13239)
@@ -660,15 +660,16 @@
/* POP before SMTP */
if($pop_before_smtp) {
- $stream = fsockopen($smtpServerAddress, 110, $err_no, $err_str);
+ if (empty($pop_before_smtp_host)) $pop_before_smtp_host = \
$smtpServerAddress; + $stream = fsockopen($pop_before_smtp_host, 110, $err_no, \
$err_str); if (!$stream) {
- do_err("Error connecting to POP Server ($smtpServerAddress:110) "
+ do_err("Error connecting to POP Server ($pop_before_smtp_host:110) "
. $err_no . ' : ' . htmlspecialchars($err_str));
}
$tmp = fgets($stream, 1024);
if (substr($tmp, 0, 3) != '+OK') {
- do_err("Error connecting to POP Server ($smtpServerAddress:110)"
+ do_err("Error connecting to POP Server ($pop_before_smtp_host:110)"
. ' '.htmlspecialchars($tmp));
}
fputs($stream, 'QUIT');
Modified: trunk/squirrelmail/src/read_body.php
===================================================================
--- trunk/squirrelmail/src/read_body.php 2008-07-19 07:31:43 UTC (rev 13238)
+++ trunk/squirrelmail/src/read_body.php 2008-07-19 17:27:54 UTC (rev 13239)
@@ -255,11 +255,12 @@
} else {
require_once(SM_PATH . 'class/deliver/Deliver_SMTP.class.php');
$deliver = new Deliver_SMTP();
- global $smtpServerAddress, $smtpPort, $pop_before_smtp;
+ global $smtpServerAddress, $smtpPort, $pop_before_smtp, \
$pop_before_smtp_host;
$authPop = (isset($pop_before_smtp) && $pop_before_smtp) ? true : false;
+ if (empty($pop_before_smtp_host)) $pop_before_smtp_host = \
$smtpServerAddress; get_smtp_user($user, $pass);
$stream = $deliver->initStream($composeMessage,$domain,0,
- $smtpServerAddress, $smtpPort, $user, $pass, \
$authPop); + $smtpServerAddress, $smtpPort, \
$user, $pass, $authPop, $pop_before_smtp_host); }
$success = false;
if ($stream) {
This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
-----
squirrelmail-cvs mailing list
List address: squirrelmail-cvs@lists.sourceforge.net
List info (subscribe/unsubscribe/change options): \
https://lists.sourceforge.net/lists/listinfo/squirrelmail-cvs
Repository: http://squirrelmail.org/svn
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic