Version 1.2.6 -- CVS
--------------------
+ - Added POP3 Before SMTP option (feature request: #498428)
- Added a server-side thread sorting option per folder
- Added a server-side sorting global option
- Fix for jumping buttons in Mozilla (bug #522149)
print "6. SMTP Server : $WHT$smtpServerAddress$NRM\n";
print "7. SMTP Port : $WHT$smtpPort$NRM\n";
print "8. Authenticated SMTP : $WHT$use_authenticated_smtp$NRM\n";
+ print "9. POP Before SMTP : $WHT$pop_before_smtp$NRM\n";
}
- print "9. Server : $WHT$imap_server_type$NRM\n";
- print "10. Invert Time : $WHT$invert_time$NRM\n";
- print "11. Delimiter : $WHT$optional_delimiter$NRM\n";
+ print "10. Server : $WHT$imap_server_type$NRM\n";
+ print "11. Invert Time : $WHT$invert_time$NRM\n";
+ print "12. Delimiter : $WHT$optional_delimiter$NRM\n";
print "\n";
print "R Return to Main Menu\n";
} elsif ( $menu == 3 ) {
elsif ( $command == 6 ) { $smtpServerAddress = command16(); }
elsif ( $command == 7 ) { $smtpPort = command17(); }
elsif ( $command == 8 ) { $use_authenticated_smtp = command18(); }
- elsif ( $command == 9 ) { $imap_server_type = command19(); }
- elsif ( $command == 10 ) { $invert_time = command110(); }
- elsif ( $command == 11 ) { $optional_delimiter = command111(); }
+ elsif ( $command == 9 ) { $pop_before_smtp = command18a(); }
+ elsif ( $command == 10 ) { $imap_server_type = command19(); }
+ elsif ( $command == 11 ) { $invert_time = command110(); }
+ elsif ( $command == 12 ) { $optional_delimiter = command111(); }
} elsif ( $menu == 3 ) {
if ( $command == 1 ) { $default_folder_prefix = command21(); }
elsif ( $command == 2 ) { $show_prefix_option = command22(); }
return $use_authenticated_smtp;
}
+# pop before SMTP
+sub command18a {
+ print "Do you wish to use POP3 before SMTP? Your server must\n";
+ print "support this in order for SquirrelMail to work with it.\n";
+
+ $YesNo = 'n';
+ $YesNo = 'y' if ( lc($pop_before_smtp) eq "true" );
+
+ 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;
+}
+
# imap_server_type
sub command19 {
print "Each IMAP server has its own quirks. As much as we tried to stick\n";
print CF "\$smtpPort = $smtpPort;\n";
print CF "\$sendmail_path = '$sendmail_path';\n";
print CF "\$use_authenticated_smtp = $use_authenticated_smtp;\n";
+ print CF "\$pop_before_smtp = $pop_before_smtp;\n";
print CF "\$imap_server_type = '$imap_server_type';\n";
print CF "\$invert_time = $invert_time;\n";
print CF "\$optional_delimiter = '$optional_delimiter';\n";
if (!$from_addr) {
$from_addr = "$popuser@$domain";
}
+
+ /* POP3 BEFORE SMTP CODE HERE */
+ global $pop_before_smtp;
+ if (isset($pop_before_smtp) && $pop_before_smtp === true) {
+ if (!isset($pop_port)) {
+ $pop_port = 110;
+ }
+ if (!isset($pop_server)) {
+ $pop_server = $smtpServerAddress; /* usually the same host! */
+ }
+ $popConnection = fsockopen($pop_server, $pop_port, $err_no, $err_str);
+ if (!$popConnection) {
+ error_log("Error connecting to POP Server ($pop_server:$pop_port)"
+ . " $err_no : $err_str");
+ } else {
+ $tmp = fgets($popConnection, 1024); /* banner */
+ if (!eregi("^\+OK", $tmp, $regs)) {
+ return(0);
+ }
+ fputs($popConnection, "USER $username\r\n");
+ $tmp = fgets($popConnection, 1024);
+ if (!eregi("^\+OK", $tmp, $regs)) {
+ return(0);
+ }
+ fputs($popConnection, 'PASS ' . OneTimePadDecrypt($key, $onetimepad) . "\r\n");
+ $tmp = fgets($popConnection, 1024);
+ if (!eregi("^\+OK", $tmp, $regs)) {
+ return(0);
+ }
+ fputs($popConnection, "QUIT\r\n"); /* log off */
+ fclose($popConnection);
+ }
+ }
$smtpConnection = fsockopen($smtpServerAddress, $smtpPort,
$errorNumber, $errorString);
}
else {
$refer .= $inreplyto;
- }
+ }
}
trim($refer);
$refer = str_replace(' ', "$rn ", $refer);
if(strlen($hdr->message_id) > 2) {
$refs = get_reference_header ($imap_stream, $reply_id);
$inreplyto = $hdr->message_id;
- $old_reply_to = $hdr->inrepto;
+ $old_reply_to = $hdr->inrepto;
$refer = calculate_references ($refs, $inreplyto, $old_reply_to);
$more_headers['In-Reply-To'] = $inreplyto;
$more_headers['References'] = $refer;