If you’re a user of SquirrelMail and Dovecot 1.x, you may run across this error “ERROR: Bad or malformed request. Server responded: Error in IMAP command APPEND:” after sending a message. The composed email message still sends, but you get that annoying error. I don’t know exactly what caused it other than a possible Dovecot upgrade, but nevertheless, this is how to alter SquirrelMail to resolve the issue.
In the functions directory of your SquirrelMail install, open the imap_general.php file.
Alter the sqimap_append PHP function by commenting out the line that starts with the fputs function and type in the replacement so it reads as:
function sqimap_append ($imap_stream, $sent_folder, $length) {
// fputs ($imap_stream, sqimap_session_id() . " APPEND \"$sent_folder\" (\\Seen) \{$length}\r\n");
fputs ($imap_stream, sqimap_session_id() . " APPEND \"$sent_folder\" (\\Seen) {" . $length . "}\r\n");
$tmp = fgets ($imap_stream, 1024);
sqimap_append_checkresponse($tmp, $sent_folder);
}
Save the changes and the problem should be solved. FYI: Upgrading to the latest version of SquirrelMail will resolve this issue as well, but applying this code change is less of a hassle.
Fix Source: XMail Forum -> dovecot imap cannot append
Tags: Dovecot, IMAP, PHP, SquirrelMail
I have tried out sendmail configuration as you have given on xenocafe.com but the last part is not working. I don’t want to change DNS MX records. I want keep mails on external server only. I want to keep internal mail server for internal mailing and fetch mails from external server. Please help me out. My email id is ucmanish@rediffmail.com
Regards,
Manish