Tag: Recoll

sSmtp Mail Server

So. I had Recoll working fine and Cron launching recollindex every night at 01:15 to update the index. I wanted to have Cron email me to let me know that recollindex had been launched successfully each night. That was easily achieved by adding the following line to the crontab file:

MAILTO=username@mail.com

I substituted my real email address for the dummy values shown here of course. That told Cron I wanted it to email me. But for Ubuntu to be able to email out it either needs to be set up as an email server or it needs to be able to authenticate against an existing external email server (like Thunderbird does). I didn’t want to have to configure an email server on my Ubuntu PC just for this, so I hunted round for ways to have it authenticate against an external mail server.

Happily, I found sSmtp. sSmtp is an extremely simple, resource conserving, SMTP server that will allow your PC to do just that. It allows processes in your PC to email out, by authenticating against an external mail server. One of my email accounts is a Google mail (gmail) account. I chose to use the gmail mail server as my external mail server.

To install sSmtp type the following into a terminal window:

sudo apt-get install ssmtp

When it had installed I used gedit to edit the ssmtp.conf  file.

gedit /etc/ssmtp/ssmtp.conf

I added or edited the following lines:

root=username@gmail.com
mailhub=smtp.gmail.com:587
rewriteDomain=
hostname=username@gmail.com
UseSTARTTLS=YES
AuthUser=username
AuthPass=password
FromLineOverride=YES

Of course I used my real gmail email adddress details, username and password.

Then I added each account that I wanted to be able to send mail from by editing the revaliases file.

gedit /etc/ssmtp/revaliases

I added two lines, one for root and one for me.

root:username@gmail.com:smtp.gmail.com:587
localusername:username@gmail.com:smtp.gmail.com:587

Again, I used my real gmail email address and my Ubuntu local username.

Now all I had to do was configure gmail to accept POP.

Once I had done that I could test the email throughput by sending an email to one of my other accounts using the following terminal command:

sudo ssmtp otheremail@other.com

Use a real, but different email address than your gmail one.

The message must be formatted in the following way:

To: destination_address@example.com
From: my_email@gmail.com
Subject: Example Message

Cowabunga, Dude!

Bart.

and then hit Ctrl-D. Note the blank line following the Subject: to line. Everything after that is the body of the email. Then go and check your other email account and see if the email got there. If there are any immediate issues, you will see an error message in the terminal window.

If everything has gone according to plan, you should receive the email. It all worked, and that meant that Cron would be able to email me when the recollindex program was launched each night. And that is what happened. In the wee wee hours of the morning I got an email from Cron. All 22,000 lines of it! The output from recollindex is verbose, to understate the matter somewhat.

And that’s what brought me to Chronic.

Tags : , , , , ,

Recoll Desktop Search

To help me locate an item of interest amongst the ever growing collection of documents, emails, photographs and other data files I have on my computer, I use a desktop search program. Desktop search programs create and maintain an index of the contents of your files. You can specify a word or phrase that you know is in the file and the program will display the list of files that match your search clue. You can preview or open the file from the list of matches.

A good desktop search program will go further. You should be able to specify the file types to include or exclude from a search, and which files and folders to ignore when indexing.

To be really useful the desktop search program needs to be able to burrow through the databases of other applications, such as the email store of Thunderbird, and index the data it finds there. (Actually the search in Thunderbird is very good on its own, but sometimes I need to search for something and see all matching images, documents and emails in one place.)

Recoll
Recoll with search results

The program I’ve settled on in Ubuntu is called Recoll. It is very flexible, it indexes all sorts of files – and the search is fast. Recoll needs to have its index updated periodically to keep it in synch with the changing content of your files. There is a program called recollindex which updates the Recoll index. I didn’t want to have to remember to manually run recollindex, I wanted to find a way to have recollindex started automatically for me.

The answer to that was Cron.

Tags : , , ,