Hello - Logwatch is a program that watch your system and creates logs.You can pick different levels of your logs of your system - low, medium and high security.And you can pick what to monitor with your logging - http, sudo and more ...This is a great way monitor you system - where you can pick to get yeasterdays logs or todays logs sent to your email.

First i just want to tell you how difficult it was to get all this working.I try to get a working email system to work with my Ubuntu so Logwatch can send me emails using my Ubuntu system.And i end up trying to configurating Postfix - i follow many guides online and none working.This made me very angry.

But thanks to this great forum [ubuntu org] i describe my issue and got help to solve my problem.A user suggest me to install SSMTP instead of Postfix and it did work direct after the first install and configuration.After that i was going to install Logwatch - but then i notice that the guides say different things how to install Logwatch.This was at first confusing - but at the end i solve the wrong information to a working solution to install and configurating Logwatch.

1) So now i will show you how to install and configurating the mail software SSMTP so you can get emails from Logwatch.

2) After getting SSMTP working i will show you how to install and configurating LOGWATCH.

3) During this installation process you need a gmail.com account to get this guide to work.

Installing and configurationg SSMTP to send emails from your Ubuntu system

First you run the following code to get updated system:

Kod:

sudo apt-get update

After that you install ssmtp

Kod:

sudo apt-get install ssmtp

Now you will open a text file using a editor with the name nano.After editing a file you click on "ctrl" and "o" to save the changes and click "enter" then close nano with "ctrl" and "x"This is the all commands you need to open, save and close using nano.

Type the following in the command line:

Kod:

sudo nano /etc/ssmtp/ssmtp.conf

Then you will get a file and it should look like this:You have to add the missing parts and add your email.

Kod:

# Config file for sSMTP sendmail## The person who gets all mail for userids < 1000# Make this empty to disable rewriting.#root=postmasterroot=MyEmailAddress@gmail.com

# The place where the mail goes. The actual machine name is required no# MX records are consulted. Commonly mailhosts are named mail.domain.com#mailhub=mailmailhub=smtp.gmail.com:587

# Where will the mail seem to come from?#rewriteDomain=rewriteDomain=gmail.com

# The full hostname#hostname=MyMediaServer.homehostname=MyEmailAddress@gmail.com

# Are users allowed to set their own From: address?# YES - Allow the user to specify their own From: address# NO - Use the system generated From: addressFromLineOverride=YES - See more at: http://www.havetheknowhow.com/Configure-the-server/Install-ssmtp.html#sthash.vpOeOryu.dpuf

# Config file for sSMTP sendmail## The person who gets all mail for userids < 1000# Make this empty to disable rewriting.#root=postmasterroot=MyEmailAddress@gmail.com

# The place where the mail goes. The actual machine name is required no# MX records are consulted. Commonly mailhosts are named mail.domain.com#mailhub=mailmailhub=smtp.gmail.com:587

# Where will the mail seem to come from?#rewriteDomain=rewriteDomain=gmail.com

# The full hostname#hostname=MyMediaServer.homehostname=MyEmailAddress@gmail.com

# Are users allowed to set their own From: address?# YES - Allow the user to specify their own From: address# NO - Use the system generated From: addressFromLineOverride=YES

When you are done you can test to send email to your gmail account.But at first it will not work because gmail will complain about you being spamming the email account and also issue how the deamon can know your password to your gmail account.Then gmail will ask if you want to change secutiry settings and you should answaer yes or activate the funktion allowing emails from your Ubuntu system.When this is done you can test send email again - then it should work just fine.

This is how you send email using the command line with ssmtp:

Kod:

ssmtp recipient_YourEmail@gmail.com

Afer typing this into the command line you click on Enter and type your message.For example:

We have to create a directory that Logwatch dosent do by default.Write the following code to create /var/cache/logwatch

Kod:

sudo mkdir /var/cache/logwatch

Now we should not add and configurationg the logwatch.conf file using this path /usr/share/logwatchWe should copy logwatch.conf to /etc/logwatch/conf/ and that is the file we will configurate.So now we copy the file using following code

If you don't see that, you'll need to talk to your ISP and make sure they are not filtering traffic to remote SMTP servers.To close the telnet session, hold down the Ctrl key and type the "]" character. Then type "quit" at the prompt.

Note, most ISPs I have seen will block any traffic on port 25 if the connection is residential. If this is the case, it is unlikely they will unblock it, so you would need to send email via port 587, instead of port 25.