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

Fix Postfix dependency #964

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config.info
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
line1=Server settings,11
mail_system=Mail server to configure,4,1-Sendmail,0-Postfix,2-Qmail,3-Detect automatically
mail_system=Mail server to configure,4,0-Postfix,1-Sendmail,2-Qmail,3-Detect automatically,99-None
Copy link
Collaborator

Choose a reason for hiding this comment

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

Best to not re-order these

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Best to not re-order these

But I want to have it re-ordered — we have to re-order...

Best to put the "None" mode at the end of the list, because that way the code that merges in translation will work better.

I think it’s fine. Besides, my language manager script still doesn’t support translating module.info files. I never got around to implementing that. If I had, the order wouldn’t matter though.

generics=Also update outgoing addresses for mailboxes?,1,1-Yes,0-No
bccs=Allow automatic BCCing of outgoing email?,1,1-Yes,0-No
quotas=Set quotas for domain and mail users?,1,1-Yes (if enabled),0-No
Expand Down
2 changes: 1 addition & 1 deletion pro-tip-lib.pl
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ sub menu_link_pro_tips
'cat' => 'logs',
'url' => "$virtualmin_docs_pro/#edit_maillog",
'skip' => !($config{'mail'} &&
$mail_system <= 1 &&
&indexof($mail_system, 0, 1) != -1 &&
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use of indexof here is confusing! Instead just compare $mail_system to 0 or 1

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I reverted this, and one more below, because it seems you prefer comparing it using the > check instead...

$d->{'mail'}),
},

Expand Down
3 changes: 2 additions & 1 deletion virtual-server-lib-funcs.pl
Original file line number Diff line number Diff line change
Expand Up @@ -13745,7 +13745,8 @@ sub get_domain_actions
}

# Button to show mail logs
if ($virtualmin_pro && $config{'mail'} && $mail_system <= 1 &&
if ($virtualmin_pro && $config{'mail'} &&
&indexof($mail_system, 0, 1) != -1 &&
&can_view_maillog($d) && $d->{'mail'}) {
push(@rv, { 'page' => 'pro/maillog.cgi',
'title' => $text{'edit_maillog'},
Expand Down
2 changes: 1 addition & 1 deletion virtual-server-lib.pl
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@

$acme_providers_dir = "$module_config_directory/acme";

$mail_system = $config{'mail_system'};
$mail_system = $config{'mail_system'} == 99 ? -1 : $config{'mail_system'};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just leave it at 99, it's cleaner

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There are more cases to fix, as there are places where > is being used in comparisons...

Copy link
Collaborator

Choose a reason for hiding this comment

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

Really? I found and fixed one, but didn't see any others..

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Really?

Yeah, search for mail_system.*?> in VIM across the project.

I found and fixed one, but didn't see any others..

Ah, then there’s one more left in ratelimit-lib.pl. Also, previously the check was $mail_system > 1, but now the latest patch has it checked as $mail_system == 0 || $mail_system == 1 — how can that be right?


# generate_plugins_list([list])
# Creates the confplugins, plugins and other arrays based on the module config
Expand Down