postfix: fatal: chdir(/usr/libexec/postfix): No such file or directory

Virtualmin on a clean Ubuntu 10.04 is giving:

Error while checking current Postfix configuration. Please manually fix Postfix configuration.

postfix: fatal: chdir(/usr/libexec/postfix): No such file or directory
Manually edit the Postfix configuration file.

Tried to reinstall Postfix on a command line, but it returned lot’s of errors like:

Do you want to continue? [Y/n/?] y
Writing extended state information… Done
Get:1 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main postfix 2.7.0-1ubuntu0.2 [1,404kB]
Fetched 1,404kB in 4s (351kB/s)
Preconfiguring packages …
dpkg: ssmtp: dependency problems, but removing anyway as you requested:
mailman depends on exim4 | mail-transport-agent; however:
Package exim4 is not installed.
Package mail-transport-agent is not installed.
Package ssmtp which provides mail-transport-agent is to be removed.
Package postfix which provides mail-transport-agent is not installed.
bsd-mailx depends on default-mta | mail-transport-agent; however:
Package default-mta is not installed.
Package postfix which provides default-mta is not installed.
Package mail-transport-agent is not installed.
Package ssmtp which provides mail-transport-agent is to be removed.
Package postfix which provides mail-transport-agent is not installed.
(Reading database … 103836 files and directories currently installed.)
Removing ssmtp …
Processing triggers for man-db …
Selecting previously deselected package postfix.
(Reading database … 103819 files and directories currently installed.)
Unpacking postfix (from …/postfix_2.7.0-1ubuntu0.2_amd64.deb) …
Processing triggers for ureadahead …
Processing triggers for ufw …
Processing triggers for man-db …
Setting up postfix (2.7.0-1ubuntu0.2) …

Postfix configuration was not changed. If you need to make changes, edit
/etc/postfix/main.cf (and others) as needed. To view Postfix configuration
values, see postconf(1).

After modifying main.cf, be sure to run ‘/etc/init.d/postfix reload’.

Running newaliases

  • Stopping Postfix Mail Transport Agent postfix
    …done.
  • Starting Postfix Mail Transport Agent postfix
    postfix: fatal: chdir(/usr/libexec/postfix): No such file or directory
    …fail!
    invoke-rc.d: initscript postfix, action “restart” failed.
    dpkg: error processing postfix (–configure):
    subprocess installed post-installation script returned error exit status 1
    Processing triggers for libc-bin …
    ldconfig deferred processing now taking place
    Errors were encountered while processing:
    postfix
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    A package failed to install. Trying to recover:
    Setting up postfix (2.7.0-1ubuntu0.2) …

Postfix configuration was not changed. If you need to make changes, edit
/etc/postfix/main.cf (and others) as needed. To view Postfix configuration
values, see postconf(1).

After modifying main.cf, be sure to run ‘/etc/init.d/postfix reload’.

Running newaliases

  • Stopping Postfix Mail Transport Agent postfix
    …done.
  • Starting Postfix Mail Transport Agent postfix
    postfix: fatal: chdir(/usr/libexec/postfix): No such file or directory
    …fail!
    invoke-rc.d: initscript postfix, action “restart” failed.
    dpkg: error processing postfix (–configure):
    subprocess installed post-installation script returned error exit status 1
    Processing triggers for libc-bin …
    ldconfig deferred processing now taking place
    Errors were encountered while processing:
    postfix
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Reading extended state information
    Initializing package states… Done
    Writing extended state information… Done

Now, what are my options to avoid re-installing the system from zero (lot’s of configuration has already been done) and to enable virtual servers to have e-mail system? If postfix is not recoverable in my case, then could I easily switch to Sendmail or Qmail?

I hope I am not doing stupid thing, but have no time, so decided to install sendmail:

Module Index Help.. Install Package Installing package(s) with command apt-get -y --force-yes -f install sendmail ..

Setting up postfix (2.7.0-1ubuntu0.2) …

Postfix configuration was not changed. If you need to make changes, edit
/etc/postfix/main.cf (and others) as needed. To view Postfix configuration
values, see postconf(1).

After modifying main.cf, be sure to run ‘/etc/init.d/postfix reload’.

Running newaliases

  • Stopping Postfix Mail Transport Agent postfix
    …done.
  • Starting Postfix Mail Transport Agent postfix
    …fail!
    invoke-rc.d: initscript postfix, action “restart” failed.
    dpkg: error processing postfix (–configure):
    subprocess installed post-installation script returned error exit status 1
    Processing triggers for libc-bin …
    ldconfig deferred processing now taking place
    Errors were encountered while processing:
    postfix
    Reading package lists…
    Building dependency tree…
    Reading state information…
    The following extra packages will be installed:
    m4 sendmail-base sendmail-bin sendmail-cf sensible-mda
    Suggested packages:
    sendmail-doc rmail logcheck resolvconf
    The following packages will be REMOVED:
    postfix
    The following NEW packages will be installed:
    m4 sendmail sendmail-base sendmail-bin sendmail-cf sensible-mda
    0 upgraded, 6 newly installed, 1 to remove and 0 not upgraded.
    1 not fully installed or removed.
    Need to get 1912kB of archives.
    After this operation, 2253kB of additional disk space will be used.
    Get:1 http://us.archive.ubuntu.com/ubuntu/ lucid/main m4 1.4.13-3 [286kB]
    Get:2 http://us.archive.ubuntu.com/ubuntu/ lucid/universe sendmail-base 8.14.3-9.1ubuntu1 [358kB]
    Get:3 http://us.archive.ubuntu.com/ubuntu/ lucid/universe sendmail-cf 8.14.3-9.1ubuntu1 [295kB]
    Get:4 http://us.archive.ubuntu.com/ubuntu/ lucid/universe sendmail-bin 8.14.3-9.1ubuntu1 [956kB]
    Get:5 http://us.archive.ubuntu.com/ubuntu/ lucid/universe sensible-mda 8.14.3-9.1ubuntu1 [12.4kB]
    Get:6 http://us.archive.ubuntu.com/ubuntu/ lucid/universe sendmail 8.14.3-9.1ubuntu1 [3488B]
    Fetched 1912kB in 5s (362kB/s)
    dpkg: postfix: dependency problems, but removing anyway as you requested:
    bsd-mailx depends on default-mta | mail-transport-agent; however:
    Package default-mta is not installed.
    Package postfix which provides default-mta is to be removed.
    Package mail-transport-agent is not installed.
    Package ssmtp which provides mail-transport-agent is not installed.
    Package postfix which provides mail-transport-agent is to be removed.
    mailman depends on exim4 | mail-transport-agent; however:
    Package exim4 is not installed.
    Package mail-transport-agent is not installed.
    Package ssmtp which provides mail-transport-agent is not installed.
    Package postfix which provides mail-transport-agent is to be removed.
    bsd-mailx depends on default-mta | mail-transport-agent; however:
    Package default-mta is not installed.
    Package postfix which provides default-mta is to be removed.
    Package mail-transport-agent is not installed.
    Package ssmtp which provides mail-transport-agent is not installed.
    Package postfix which provides mail-transport-agent is to be removed.
    (Reading database … 103973 files and directories currently installed.)
    Removing postfix …
  • Stopping Postfix Mail Transport Agent postfix
    …done.
    Processing triggers for man-db …
    Processing triggers for ufw …
    Processing triggers for ureadahead …
    Processing triggers for libc-bin …
    ldconfig deferred processing now taking place
    Selecting previously deselected package m4.
    (Reading database … 103819 files and directories currently installed.)
    Unpacking m4 (from …/archives/m4_1.4.13-3_amd64.deb) …
    Selecting previously deselected package sendmail-base.
    Unpacking sendmail-base (from …/sendmail-base_8.14.3-9.1ubuntu1_all.deb) …
    Selecting previously deselected package sendmail-cf.
    Unpacking sendmail-cf (from …/sendmail-cf_8.14.3-9.1ubuntu1_all.deb) …
    Selecting previously deselected package sendmail-bin.
    Unpacking sendmail-bin (from …/sendmail-bin_8.14.3-9.1ubuntu1_amd64.deb) …
    Selecting previously deselected package sensible-mda.
    Unpacking sensible-mda (from …/sensible-mda_8.14.3-9.1ubuntu1_amd64.deb) …
    Selecting previously deselected package sendmail.
    Unpacking sendmail (from …/sendmail_8.14.3-9.1ubuntu1_all.deb) …
    Processing triggers for install-info …
    Processing triggers for man-db …
    Processing triggers for ureadahead …
    Setting up m4 (1.4.13-3) …
    Setting up sendmail-base (8.14.3-9.1ubuntu1) …
    adduser: Warning: The home directory /var/lib/sendmail' does not belong to the user you are currently creating. adduser: Warning: The home directory /var/lib/sendmail’ does not belong to the user you are currently creating.

Setting up sendmail-cf (8.14.3-9.1ubuntu1) …
Setting up sendmail-bin (8.14.3-9.1ubuntu1) …
update-rc.d: warning: sendmail stop runlevel arguments (0 1 6) do not match LSB Default-Stop values (1)
update-alternatives: using /usr/lib/sm.bin/sendmail to provide /usr/sbin/sendmail-mta (sendmail-mta) in auto mode.
update-alternatives: using /usr/lib/sm.bin/sendmail to provide /usr/sbin/sendmail-msp (sendmail-msp) in auto mode.
update-alternatives: warning: not replacing /usr/share/man/man8/sendmail.8.gz with a link.

You are doing a new install, or have erased /etc/mail/sendmail.mc.
If you’ve accidentaly erased /etc/mail/sendmail.mc, check /var/backups.

I am creating a safe, default sendmail.mc for you and you can
run sendmailconfig later if you need to change the defaults.

  • Stopping Mail Transport Agent (MTA) sendmail
    …done.
    Updating sendmail environment …
    Validating configuration.
    Writing configuration to /etc/mail/sendmail.conf.
    Writing /etc/cron.d/sendmail.
    Could not open /etc/mail/databases(No such file or directory), creating it.
    Could not open /etc/mail/sendmail.mc(No such file or directory)
    Reading configuration from /etc/mail/sendmail.conf.
    Validating configuration.
    Writing configuration to /etc/mail/sendmail.conf.
    Writing /etc/cron.d/sendmail.
    Turning off Host Status collection
    Could not open /etc/mail/databases(No such file or directory), creating it.
    Reading configuration from /etc/mail/sendmail.conf.
    Validating configuration.
    Creating /etc/mail/databases…

Checking filesystem, this may take some time - it will not hang!
… Done.

Checking for installed MDAs…
Adding link for newly extant program (mail.local)
Adding link for newly extant program (procmail)
Creating /etc/mail/sasl/sasl.m4…

Ah, you’re setup with SASL2 !

Unfortunately, there is no automagic way to migrate to /etc/sasldb2 :frowning:

You’ll want to make sure /etc/default/saslauthd is setup to start,
and has at least MECHANISMS=“pam” !

If you find out what more is needed, please let me know!

To enable sendmail to use SASLS, you need to:

  1. Add this line to /etc/mail/sendmail.mc and optionally
    to /etc/mail/submit.mc:
    include(`/etc/mail/sasl/sasl.m4’)dnl
  2. Run sendmailconfig
  3. Restart sendmail

SASL2 is now minimally setup, there are a few ways to handle users:
*) Allow only shell users (default)
You’re all set, nothing else to do !
*) Allow users other than shell
Add users via /usr/sbin/saslpasswd2 and make sure that the
realm you used matches what your users specify in their
netscape/outlook/mutt/etc profiles.

If you need to authorize sendmail as a sender, also update
/etc/mail/default-auth-info and rerun /usr/share/sendmail/update_auth.

Creating/Updating SSL(for TLS) information
Creating /etc/mail/tls/starttls.m4…
Creating SSL certificates for sendmail.
Generating DSA parameters, 2048 bit long prime
This could take some time
…+…+++++++++++++++++++++++++++++++++++++++++++++++++++*
…+…+…+…+…+…+…+…+…+…+…+…+.+…+…+…+…+…+…+…+…+…+…+…+…+…+…+…+…+.+…+…+…+…+…+…+.+…+…+…+…+…+…+…+…+…+…+…+…+…+…+…+.+.+…+…+…+…+…+…+…+…+…+…+…+…+…+…+…+…+…+…+…+…+…+…+.+…+…+…+…+…+…+…+.+…+…+…+…+…+…+…+…+…+…+…+…+…+…+…+…+…+…+…+…+…+.+…+.+…+…+…+.+…+…+…+…+…+…+.+.+…+…+…+…+…+++++++++++++++++++++++++++++++++++++++++++++++++++*
Generating RSA private key, 2048 bit long modulus
…+++
…+++
e is 65537 (0x10001)

*** *** *** WARNING *** WARNING *** WARNING *** WARNING *** *** ***

Everything you need to support STARTTLS (encrypted mail transmission
and user authentication via certificates) is installed and configured
but is NOT being used.

To enable sendmail to use STARTTLS, you need to:

  1. Add this line to /etc/mail/sendmail.mc and optionally
    to /etc/mail/submit.mc:
    include(`/etc/mail/tls/starttls.m4’)dnl
  2. Run sendmailconfig
  3. Restart sendmail

Updating /etc/hosts.allow, adding “sendmail: all”.

Please edit /etc/hosts.allow and check the rules location to
make sure your security measures have not been overridden -
it is common to move the sendmail:all line to the end of
the file, so your more selective rules take precedence.
Checking {sendmail,submit}.mc and related databases…
Reading configuration from /etc/mail/sendmail.conf.
Validating configuration.
Creating /etc/mail/databases…
Reading configuration from /etc/mail/sendmail.conf.
Validating configuration.
Creating /etc/mail/databases…
Reading configuration from /etc/mail/sendmail.conf.
Validating configuration.
Creating /etc/mail/Makefile…
Reading configuration from /etc/mail/sendmail.conf.
Validating configuration.
Writing configuration to /etc/mail/sendmail.conf.
Writing /etc/cron.d/sendmail.
Disabling HOST statistics file(/var/lib/sendmail/host_status).
Creating /etc/mail/sendmail.cf…
*** ERROR: FEATURE() should be before MAILER()
*** MAILER(local') must appear after FEATURE(always_add_domain’)*** ERROR: FEATURE() should be before MAILER()
*** MAILER(local') must appear after FEATURE(allmasquerade’)*** ERROR: FEATURE() should be before MAILER()

Creating /etc/mail/submit.cf…
Informational: confCR_FILE file empty: /etc/mail/relay-domains
Warning: confCT_FILE source file not found: /etc/mail/trusted-users
it was created
Informational: confCT_FILE file empty: /etc/mail/trusted-users
Warning: confCW_FILE source file not found: /etc/mail/local-host-names
it was created
Warning: access_db source file not found: /etc/mail/access
it was created
Updating /etc/mail/access…
Linking /etc/aliases to /etc/mail/aliases
Updating /etc/mail/aliases…
/etc/mail/aliases: 4 aliases, longest 82 bytes, 143 bytes total

Warning: 3 database(s) sources
were not found, (but were created)
please investigate.

Warning: These messages were issued while creating sendmail.cf
make sure they are benign before starting sendmail!

Errors in generating sendmail.cf
*** ERROR: FEATURE() should be before MAILER()
*** MAILER(local') must appear after FEATURE(always_add_domain’)*** ERROR: FEATURE() should be before MAILER()
*** MAILER(local') must appear after FEATURE(allmasquerade’)*** ERROR: FEATURE() should be before MAILER()

  • Starting Mail Transport Agent (MTA) sendmail
    …done.

Setting up sensible-mda (8.14.3-9.1ubuntu1) …
Setting up sendmail (8.14.3-9.1ubuntu1) …
… install complete.
Package m4 was installed successfully

Now trying to configure sendmail. Following advice on http://www.virtualmin.com/node/5784#comment-25271, I have created VIRTUSER_TABLE, rebuild configuration and also ran ‘sendmailconfig’ at command like. Unfortunately got lot’s of errors:

root@hoster:~# sendmailconfig Configure sendmail with the existing /etc/mail/sendmail.conf? [Y] y Reading configuration from /etc/mail/sendmail.conf. Validating configuration. Writing configuration to /etc/mail/sendmail.conf. Writing /etc/cron.d/sendmail. Configure sendmail with the existing /etc/mail/sendmail.mc? [Y] y Updating sendmail environment ... Reading configuration from /etc/mail/sendmail.conf. Validating configuration. Writing configuration to /etc/mail/sendmail.conf. Writing /etc/cron.d/sendmail. Reading configuration from /etc/mail/sendmail.conf. Validating configuration. Writing configuration to /etc/mail/sendmail.conf. Writing /etc/cron.d/sendmail. Could not open /etc/mail/databases(No such file or directory), creating it. Reading configuration from /etc/mail/sendmail.conf. Validating configuration. Creating /etc/mail/databases...

Checking filesystem, this may take some time - it will not hang!
… Done.

Checking for installed MDAs…
Creating /etc/mail/sasl/sasl.m4…

Ah, you’re setup with SASL2 !

Unfortunately, there is no automagic way to migrate to /etc/sasldb2 :frowning:

You’ll want to make sure /etc/default/saslauthd is setup to start,
and has at least MECHANISMS=“pam” !

If you find out what more is needed, please let me know!

Creating/Updating SSL(for TLS) information
Creating /etc/mail/tls/starttls.m4…
You already have sendmail certificates

*** *** *** WARNING *** WARNING *** WARNING *** WARNING *** *** ***

Everything you need to support STARTTLS (encrypted mail transmission
and user authentication via certificates) is installed and configured
but is NOT being used.

To enable sendmail to use STARTTLS, you need to:

  1. Add this line to /etc/mail/sendmail.mc and optionally
    to /etc/mail/submit.mc:
    include(`/etc/mail/tls/starttls.m4’)dnl
  2. Run sendmailconfig
  3. Restart sendmail

Checking {sendmail,submit}.mc and related databases…
Reading configuration from /etc/mail/sendmail.conf.
Validating configuration.
Creating /etc/mail/databases…
Reading configuration from /etc/mail/sendmail.conf.
Validating configuration.
Creating /etc/mail/databases…
Reading configuration from /etc/mail/sendmail.conf.
Validating configuration.
Creating /etc/mail/Makefile…
Reading configuration from /etc/mail/sendmail.conf.
Validating configuration.
Writing configuration to /etc/mail/sendmail.conf.
Writing /etc/cron.d/sendmail.
Disabling HOST statistics file(/var/lib/sendmail/host_status).
Creating /etc/mail/sendmail.cf…
*** ERROR: FEATURE() should be before MAILER()
*** MAILER(local') must appear after FEATURE(always_add_domain’)*** ERROR: FEATURE() should be before MAILER()
*** MAILER(local') must appear after FEATURE(allmasquerade’)*** ERROR: FEATURE() should be before MAILER()
*** ERROR: FEATURE() should be before MAILER()

Creating /etc/mail/submit.cf…
Informational: confCR_FILE file empty: /etc/mail/relay-domains
Informational: confCT_FILE file empty: /etc/mail/trusted-users
Updating /etc/mail/access…
Warning: virtusertable source file not found: /etc/mail/virtusertable
it was created
Informational: virtusertable file empty: /etc/mail/virtusertable
Updating /etc/mail/virtusertable…
Updating /etc/mail/aliases…
/etc/mail/aliases: 4 aliases, longest 82 bytes, 143 bytes total

Warning: 1 database(s) sources
were not found, (but were created)
please investigate.

Warning: These messages were issued while creating sendmail.cf
make sure they are benign before starting sendmail!

Errors in generating sendmail.cf
*** ERROR: FEATURE() should be before MAILER()
*** MAILER(local') must appear after FEATURE(always_add_domain’)*** ERROR: FEATURE() should be before MAILER()
*** MAILER(local') must appear after FEATURE(allmasquerade’)*** ERROR: FEATURE() should be before MAILER()
*** ERROR: FEATURE() should be before MAILER()

Reload the running sendmail now with the new configuration? [Y] y
Reloading sendmail …
root@hoster:~#

Howdy,

Those are some strange problems you’re seeing!

I would suggest sticking with Postfix, we’d just need to figure out what’s going on with it.

It looks like even when you reinstalled it, you still received this error:

Starting Postfix Mail Transport Agent postfix postfix: fatal: chdir(/usr/libexec/postfix): No such file or directory ...fail!

What that in mind, I have a couple of questions for you –

  • Are you using a VPS, or a dedicated server?

  • What is the output of this command: postconf -n

That should help us figure out what’s going on… thanks!

-Eric

Hi Eric,

Thank you for your response. I would appreciate if you could help me since I have almost got Sendmail working, but really liked simplicity of Postfix.

  1. I am on a dedicated Ubuntu 10.04 LTS server with a root access.

Now before giving you the output of postconf -n, I’d like to once again re-install Postfix. In order to do that I go to Webmin->Postfix Mail Server and see

The Postfix control command /usr/sbin/postfix is not installed on your system. Maybe your module configuration is incorrect, or Postfix is not installed.

The Postfix package can be automatically installed by Webmin. Click here to have it downloaded and installed using APT.

I hit Click here and it starts to install giving me:

Install Package Installing package(s) with command apt-get -y --force-yes -f install postfix ..

Reading package lists…
Building dependency tree…
Reading state information…
The following packages were automatically installed and are no longer required:
pwgen libnet-daemon-perl postgresql-8.4 bind9 proftpd-basic
libdigest-sha1-perl sensible-mda sasl2-bin libnet-ip-perl db4.8-util irb1.8
libnet-dns-perl re2c clamav mysql-server bind9utils dovecot-common
webmin-virtual-server libnet-xwhois-perl php5 awstats libdbi-perl
webmin-security-updates apt-listchanges rdoc ri clamav-base
mysql-server-core-5.1 libclamav6 apache2 procmail spamc libapache2-mod-fcgid
php-pear procmail-wrapper apache2-suexec-custom scponly libreadline5
mysql-client-core-5.1 libpg-perl dovecot-imapd webmin-virtualmin-awstats irb
clamav-docs postgresql-common libdbd-mysql-perl libapache2-svn postgresql
webmin-virtualmin-htpasswd usermin-virtual-server-theme rdoc1.8
postgresql-client-8.4 liberror-perl webalizer libplrpc-perl
webmin-virtualmin-dav libsocket6-perl libdbd-pg-perl clamav-freshclam
apache2-doc postgresql-client-common dovecot-pop3d libpq5 libtommath0
libnetaddr-ip-perl webmin-virtualmin-mailman webmin-virtual-server-theme
libmail-spf-perl libreadline-ruby1.8 clamav-daemon libsys-hostname-long-perl
openbsd-inetd mysql-server-5.1 libdigest-hmac-perl webmin-virtualmin-svn
ri1.8 libltdl7 spamassassin mysql-client-5.1 clamav-testfiles
libio-socket-inet6-perl
Use ‘apt-get autoremove’ to remove them.
Suggested packages:
postfix-mysql postfix-pgsql postfix-ldap postfix-pcre resolvconf postfix-cdb
mail-reader
The following packages will be REMOVED:
sendmail sendmail-bin
The following NEW packages will be installed:
postfix
Preconfiguring packages …
0 upgraded, 1 newly installed, 2 to remove and 0 not upgraded.
Need to get 0B/1404kB of archives.
After this operation, 1262kB of additional disk space will be used.
(Reading database … 100411 files and directories currently installed.)
Removing sendmail …
dpkg: sendmail-bin: dependency problems, but removing anyway as you requested:
sensible-mda depends on sendmail-bin | mail-transport-agent; however:
Package sendmail-bin is to be removed.
Package mail-transport-agent is not installed.
Package ssmtp which provides mail-transport-agent is not installed.
Package sendmail-bin which provides mail-transport-agent is to be removed.
Package postfix which provides mail-transport-agent is not installed.
sensible-mda depends on sendmail-bin | mail-transport-agent; however:
Package sendmail-bin is to be removed.
Package mail-transport-agent is not installed.
Package ssmtp which provides mail-transport-agent is not installed.
Package sendmail-bin which provides mail-transport-agent is to be removed.
Package postfix which provides mail-transport-agent is not installed.
Removing sendmail-bin …
Processing triggers for man-db …
Processing triggers for ureadahead …
Selecting previously deselected package postfix.
(Reading database … 100360 files and directories currently installed.)
Unpacking postfix (from …/postfix_2.7.0-1ubuntu0.2_amd64.deb) …
Processing triggers for ureadahead …
Processing triggers for ufw …
Processing triggers for man-db …
Setting up postfix (2.7.0-1ubuntu0.2) …

Postfix configuration was not changed. If you need to make changes, edit
/etc/postfix/main.cf (and others) as needed. To view Postfix configuration
values, see postconf(1).

After modifying main.cf, be sure to run ‘/etc/init.d/postfix reload’.

Running newaliases

  • Stopping Postfix Mail Transport Agent postfix
    …done.
  • Starting Postfix Mail Transport Agent postfix
    …fail!
    invoke-rc.d: initscript postfix, action “restart” failed.
    dpkg: error processing postfix (–configure):
    subprocess installed post-installation script returned error exit status 1
    Processing triggers for libc-bin …
    ldconfig deferred processing now taking place
    Errors were encountered while processing:
    postfix
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    … install failed!

Frustrating. Anyway I am running postconf -n and it gives:

root@hoster:~# postconf -n alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases broken_sasl_auth_clients = yes command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/libexec/postfix debug_peer_level = 2 home_mailbox = Maildir/ html_directory = no inet_interfaces = all inet_protocols = ipv4 mail_owner = postfix mailbox_command = procmail -a "$EXTENSION" mailbox_size_limit = 0 mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man mydestination = mydomainname.com mynetworks = 127.0.0.0/8 217.217.139.240/29 (<-- not real IP, modified) myorigin = /etc/mailname newaliases_path = /usr/bin/newaliases.postfix queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES recipient_delimiter = + relayhost = sample_directory = /usr/share/doc/postfix-2.3.3/samples sender_bcc_maps = hash:/etc/postfix/bcc sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination check_policy_service unix:/var/spool/postfix/postgrey/socket smtpd_sasl_auth_enable = yes smtpd_tls_cert_file = /etc/postfix/postfix.cert.pem smtpd_tls_key_file = /etc/postfix/postfix.key.pem smtpd_tls_mandatory_ciphers = high smtpd_tls_security_level = may unknown_local_recipient_reject_code = 550 virtual_alias_maps = hash:/etc/postfix/virtual

I just decided to re-install the system. But if anyone will find himself in exactly the same shoes with me, then possible solution offered here: http://ubuntuforums.org/showthread.php?t=1951878

I had exactly the same problem today. Copying from one server to another somehow changed some settings from the /etc/postfix/main.cf file. I couldn’t even stop postfix and after rebooting the server I couldn’t get it to come up. In order to fix this, you need to edit your main.cf file and change:

daemon_directory = /usr/libexec/postfix

to:

daemon_directory = /usr/lib/postfix

Then restart postfix:

/etc/init.d/postfix reload

And you should be good to go.

OK, it looks like the restore process wreaked havoc on my new system. I accidentally clicked the boxes under “Virtualmin settings to also backup” thinking that this was related to the backups and not a system-wide thing (I admit, I didn’t read it closely enough), and since I was restoring from Centos to Debian, it didn’t work. In fact, I had a lot of customized things in my main.cf file (like SPF) that I had to completely rebuild everything again. After many hours, I am down to only a few warning messages in my /var/log/mail.log file to go through and fix.

However, I strongly believe that when overwriting system files from backups some controls should be put in place:

  1. Backups of all replaced files should be made by default unless otherwise specified! Seriously. Just append the timestamp to the file or something. This can’t be hard and can save a system admin hours trying to piece things back together. Simply overwriting system files is just asking for trouble.

  2. Perhaps including the operating system type (maybe even version as well) with the system files would not be a bad idea. Then if the systems do not match, prompt the user to make the changes again and warn them that things will very likely break.