4

I need some help with this please.

I started here as mentioned: in this post This post

nitapika@nitapika-51:~$ echo bla | mail -s testmail [email protected]

The program 'mail' is currently not installed. You can install it by typing:
sudo apt-get install mailutils

Then installed mailutils: and received this error

Running newaliases
newaliases: warning: valid_hostname: numeric hostname: 04
newaliases: fatal: file /etc/postfix/main.cf: parameter mydomain: bad parameter value: 04
dpkg: error processing package postfix (--configure):
 subprocess installed post-installation script returned error exit status 75
dpkg: dependency problems prevent configuration of mailutils:
 mailutils depends on default-mta | mail-transport-agent; however:
  Package default-mta is not installed.
  Package postfix which provides default-mta is not configured yet.
  Package mail-transport-agent is not installed.
  Package postfix which provides mail-transport-agent is not configured yet.

dpkg: error processing package mailutils (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.21-0ubuntu4) ...No apport report written because the error message indicates its a followup error from a previous failure.

Errors were encountered while processing:
 postfix
 mailutils
E: Sub-process /usr/bin/dpkg returned an error code (1)

nitapika@nitapika-51:~$ sudo /etc/init.d/postfix reload

[....] Reloading postfix configuration (via systemctl): postfix.serviceJob for postfix.service invalid.
 failed!

Then tried:

nitapika@nitapika-51:~$ sudo apt-get -f install 

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up postfix (2.11.3-1ubuntu2) ...

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
newaliases: warning: valid_hostname: numeric hostname: 04
newaliases: fatal: file /etc/postfix/main.cf: parameter mydomain: bad parameter value: 04
dpkg: error processing package postfix (--configure):
 subprocess installed post-installation script returned error exit status 75
dpkg: dependency problems prevent configuration of mailutils:
 mailutils depends on default-mta | mail-transport-agent; however:
  Package default-mta is not installed.
  Package postfix which provides default-mta is not configured yet.
  Package mail-transport-agent is not installed.
  Package postfix which provides mail-transport-agent is not configured yet.

dpkg: error processing package mailutils (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.21-0ubuntu4) ...No apport report written because the error message indicates its a followup error from a previous failure.

Errors were encountered while processing:
 postfix
 mailutils
E: Sub-process /usr/bin/dpkg returned an error code (1)

And then:

nitapika@nitapika-51:~$ sudo dpkg-reconfigure -plow postfix
/usr/sbin/dpkg-reconfigure: postfix is broken or not fully installed

Not sure how to fix this. I only need the logcheck app to send me abnormalities.

1
  • I was getting a similar error which seemed to be due to an bug. A fix is explained here.
    – SaTa
    Jul 31, 2021 at 16:48

3 Answers 3

6
  1. Correct mydomain in /etc/postfix/main.cf.

    04 is not a valid domain name - a valid value is an entry of the tour domain.tld.

  2. Change the value for valid_hostname as well.

    This is only a warning but hostnames are not numeric - use the output of

     hostname --fqdn
    

After that execute:

sudo newaliases
sudo apt-get install -f

mydomain

    The internet domain name of this mail system. The default is to use
    $myhostname minus the first component, or "localdomain" (Postfix 2.3 
    and later). $mydomain is used as a default value for many other
    configuration parameters.

myhostname

    The internet hostname of this mail system. The default is to use the
    fully-qualified domain name (FQDN) from gethostname(), or to use the
    non-FQDN result from gethostname() and append ".$mydomain".$myhostname
    is used as a default value for many other configuration parameters.
4
  • Thank you. This solved the email issue. Now on to the logcheck setup. Oct 30, 2015 at 14:36
  • I tried to test by running: sudo -u logcheck logcheck -o -t and received error: Oct 30 16:42:26 rotaderp gnome-session[2756]: Could not locate Tomboy on D-Bus. Perhaps it's not running? Oct 30 16:42:26 rotaderp gnome-session[2756]: [Error 16:42:26.406] [UniverseManager] Error while updating item source "Torrents": Cannot access Transmission RPC service Oct 30 16:42:26 rotaderp gnome-session[2756]: [Error 16:42:26.769] [UniverseManager] Error while updating item source "Firefox Places": Cannot cast from source type to destination type. Should Tomboy be installed? Oct 30, 2015 at 14:46
  • You have two completely different problems. I have solved the main problem. The other question is too specific. Ask a new question for this problem. Please accept this answer with a click on the check mark at the left side of the answer.
    – A.B.
    Oct 30, 2015 at 14:51
  • Thanks for the answer. For some reason sudo apt-get install -f keeps changing the configuration in /etc/postfix/main.cf to some invalid crap myserver.168.1.25 so install fails all time miserably. Any ideas?
    – Wtower
    Dec 30, 2016 at 6:31
1

First know your hostname using command:

hostname

Edit /etc/postfix/main.cf file by using:

sudo nano /etc/postfix/main.cf

Now, change:

myhostname =

to

myhostname = your_hostname #name of your hostname

Now reboot your system and run:

sudo apt install -f
1

Type the following command in the terminal:

$ postconf -d myhostname

Now edit the /etc/postfix/main.cf file by changing the myhostname to the hostname you got by executing the previous command. i.e change:

myhostname = new_hostname

Here, new_hostname is your hostname obtained executing the command $ postconf -d myhostname

After changing the file, save it and run the following commands:

$ /etc/init.d/postfix reload
$ service postfix reload

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .