Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dirty fix for 500 on outgoing mail #651

Merged
merged 2 commits into from
Sep 24, 2023
Merged

Conversation

capocasa
Copy link
Contributor

Pullrequest

There is a hard-to-reproduce bug that was first reported on gitter and now by me here on github, #650

This is not a clean fix in that it does not addres root causes, but it allows me to use the software right now apparently without issue and might give additional information.

Issues

Checklist

  • None

How2Test

Reproduce bug #650 and watch it go away with this patch.

Todo

  • Reproduce: Spin up a debian bullseye instance somewhere, install apache, php and cypht and install cypht using the install script.
  • Find root cause and fix properly

@marclaporte
Copy link
Member

I need validation from @jasonmunro or @henrique-borba

@@ -1033,7 +1033,7 @@ protected function output() {
$cc = $imap_draft['Cc'];
}
if (array_key_exists('From', $imap_draft)) {
$from = $imap_draft['From'];
$from = $imap_draft['From'];select_mailbox
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably accidentally pasted select_mailbox at the end of this line - it will generate a syntax error, can you remove please?

@@ -1573,7 +1574,7 @@ function rrmdir($dir) {
if (filetype($dir . "/" . $object) == "dir") {
rrmdir($dir . "/" . $object);
} else {
unlink($dir . "/" . $object);
unlink($dir . "/" . $object);select_mailbox
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably accidentally pasted select_mailbox at the end of this line - it will generate a syntax error, can you remove please?

@@ -1528,6 +1528,7 @@ function get_primary_recipient($profiles, $headers, $smtp_servers, $is_draft=Fal
if (!hm_exists('delete_draft')) {
function delete_draft($id, $cache, $imap_server_id, $folder) {
$imap = Hm_IMAP_List::connect($imap_server_id);
if ( ! $imap ) return false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a result of incorrectly setup imap server which is used in a profile but cannot be authenticated (wrong password maybe). At any rate, I agree we should check if imap is authenticated before trying to select a mailbox. Can you use this, instead:

if (! imap_authed($imap)) {
    return false;
}

@marclaporte
Copy link
Member

@capocasa We'll soon release Cypht 1.4.0, and it would be ideal to get this fix in.

Thanks!

@marclaporte
Copy link
Member

@capocasa We need you :-)

@capocasa
Copy link
Contributor Author

I'm afraid I don't have a setup ready at the moment- perhaps try to reproduce on a vanilla debian install?

@josaphatim josaphatim merged commit fd5bfb3 into cypht-org:master Sep 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants