dpkg: error processing virtualmin-base

I don't have postfix installed on this box... sendmail is so why would virtualmin-base try and configure for postfix ?

-------------------------------------------------------------------
Setting up virtualmin-base (1.0-36.1) ...
Error: Failed to query Postfix config command to get the current value of parameter mailbox_command:
Error
-----
Failed to query Postfix config command to get the current value of parameter mailbox_command:
-----
dpkg: error processing virtualmin-base (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
virtualmin-base
E: Sub-process /usr/bin/dpkg returned an error code (1)

Status: 
Closed (fixed)

Comments

Was this during a new install, or an upgrade of virtualmin-base?

Joe released a new version recently, but an upgrade shouldn't re-run the install script.

Joe's picture
Submitted by Joe on Thu, 09/11/2014 - 14:00 Pro Licensee

Is this system running Sendmail, rather than Postfix? That might account for this.

And, we probably need to remove that "fix email" bit that was outside of the "run only on fresh install" test. Jamie, does that need to be in the package at all, anymore, or should we remove it going forward or put it inside the only-on-install block?

Joe's picture
Submitted by Joe on Thu, 09/11/2014 - 14:05 Pro Licensee

Oops. You already said this is sendmail. So, yes, that's the source of the problem...but, it shouldn't be this clumsy, so I'll need to fix that one way or another.

Joe's picture
Submitted by Joe on Sat, 09/13/2014 - 22:32 Pro Licensee

Jamie, can I remove this part of virtualmin-base in future versions? It seems to only be needed for existing systems that had an old (ancient now) version of Virtualmin that setup spam/AV filtering with something other than procmail-wrapper. It's been years since that's been the case; I think it's probably safe to assume no Virtualmin instances that meet that description are still out there. I'll likely only roll it out for the current generation of operating systems, also, which probably never had a possibility of having the old Virtualmin.

Which section are you referring to?

Joe's picture
Submitted by Joe on Sun, 09/14/2014 - 00:40 Pro Licensee

This bit that's outside of the test to see if we're installing for the first time or upgrading (so it always runs, including in cases like Scott's where the system doesn't even have Postfix running):

  # Fix up the Postfix config to use the procmail wrapper, regardless if we are
  # installing or upgrading (but only if spam filtering is active)
  eval {
    foreign_require("postfix", "postfix-lib.pl");
    $mailcmd = postfix::get_current_value("mailbox_command");
    %vconfig = foreign_config("virtual-server");
    if ($vconfig{'spam'} && $mailcmd =~ /procmail/ &&
        $mailcmd !~ /procmail-wrapper/) {
        postfix::set_current_value("mailbox_command",
            "/usr/bin/procmail-wrapper -o -a \$DOMAIN -d \$LOGNAME", 1);
        postfix::reload_postfix();
        }

    # Turn on caching for downloads by Virtualmin
    if (!$gconfig{'cache_size'}) {
            $gconfig{'cache_size'} = 50*1024*1024;
            $gconfig{'cache_mods'} = "virtual-server";
            write_file("$config_directory/config", \%gconfig);
            }
    1;
    }
    or do {
        print "Error occurred while setting up procmail-wrapper. \n";
    };

I just removed virtualmin-base because this is not a new server and no need for it. I rather have a working apt instead of a broken one at this point.

Right, that section is un-needed since the mailbox_command is set already earlier in the install process. I will remove it.

Joe's picture
Submitted by Joe on Sun, 09/14/2014 - 15:34 Pro Licensee

Scott, that's a reasonable solution. Just remember to instruct dpkg to not run the postinst script if you ever have reason to re-install virtualmin-base (I can't think of any reason to do so).

Any future versions of virtualmin-base will lose that code.

Since we haven't had any other reports of this problem, and it sounds like Scott's got it sorted on his system, I'll mark this one fixed. I'm not gonna roll a new virtualmin-base unless someone else runs into the problem (or we need to roll a new one for other reasons).

Automatically closed -- issue fixed for 2 weeks with no activity.