Lost Website

You Are Here

Archive for January, 2008

Receiving Mail Directly

without comments

This is for the record. As I write this entry, I no longer use this technique.

For no particular reason, I’ve always wanted to receive emails directly on my computer through SMTP. For readers not familiar with how SMTP works, let’s just say that SMTP is a postman able to deliver your emails to the post-office, but that is also able to deliver emails directly to your door.

People have got used to get their emails through a Post-Officile Protocol (POP3). You can also use IMAP for the same purpose but it doesn’t really fit my metaphor so I will not talk about it. The SMTP postman can also knock to your door (port 25) and deposit the mail right at your computer if you let the rest of the Internet know you want to receive your mail that way (through MX records).

Using a cheap ISP with a dynamic IP address is like changing the door address every so often. Nobody out in the Internet really knows where you live at any point. You can mitigate that by using an handy dynamic DNS service, which I do, but it’s not like having a permanent home with a domain that everyone knows about.

Also, Sympatico, my ISP, blocks port 25. That means nobody will every be able to knock at my door. I can’t let the whole Internet know that I should receive mail at port 10025 for example.

There are some service that can receive mail for you then route it to the correct port. The prices vary with the features provided by the service. I have not seriously considered paying for something that I can find no practical advantages to.

Nonetheless, I still wanted to receive mail from the Internet directly on my small network, without needing to switch to another ISP.

I successfully received mails from the wide Internet yesterday.

What you need is:

  • An Email Service Provider that lets you use procmail and a dumb SMTP sender.
  • A SMTP server listening on an alternative port that is not blocked by your ISP.
  • A simple procmail hack.

The provider

I use HCOOP. It it my Hosting Provider, and Email Provider, and Pretty-Much-Everything Provider. It’s quite cheap and very flexible. It doesn’t have any big uptime guarantees and expects a below average knownledge of Apache and DNS configuration but I can deal with that. In fact, I love to deal with that.

So the provider was not a problem for me. Other hosting solutions might not provide you with the possibility of using procmail at all.

The SMTP server

I use Postfix on the receiving computer. It defaults to port 25 of course. All I needed to do in order to make use another port was to edit the /etc/postfix/master.cf file, find the line describing the SMTP service, and change the service the port number you want Postfix to listen on for SMTP requests.

The dumb SMTP server

Some places call that a nullmailer. This is a SMTP client that is just meant to send a mail to an SMTP host.

My provider already had ssmtp installed. I also looked at esmtp for inspirations. There are probably several variants of such software out in the Internet.

The procmail hack

I did not find this verbatim on Internet, but I’m pretty sure you can find several variants of that through Google.

:0wc
| formail -k -X "From:" -X "Subject:" -X "To:" -n 3 -s \
      /usr/sbin/ssmtp -Cssmtp.conf your@email.com

This rule basically tell procmail to send all mail through a pipe starting with the formail program. formail is used to format a mail message before further processing. The switch I pass it tells it to remove all headers but From and Subject from the mail before calling ssmtp. ssmtp.conf is the configuration file for ssmtp. I won’t paste it here since it’s quite trivial and anybody interested in using it will figure out what to write there from the manual page.

This is probably not an exhaustive shopping list of how I got it done, but without those basic blocks, you wont get it done.

Once I got that working. An avanlanche of problems and potential problems made me realize that this was way much troubles that it was worth.

  • It meant that I needed to keep the receiving computer running at all time, and I don’t have the infrastructure for that. I have no UPS and no backup system
  • That computer as limited capacity so I could not have used it has an store for emails, at least, not for every long. So I needed to send the mail to a computer that is more capable inside the network. That means I need to learn to configure Postfix, something I would certainly enjoy but that I don’t think is worth spending time on.
  • Finally, the the formail command line I describe above is probably incorrect since the email I was receiving were partially munged, in various ways.

In short, such acrobatics with emails was too much trouble for me. It doesn’t mean I could not have made it work, but that the energy needed to make it work correctly was too much for the value of the end-result I was after. I write this entry as a statement to say that I will spend time trying working on this again, unless I find a reason better than “It’d be cool!”.

Written by fdgonthier

January 27th, 2008 at 2:51 am

Posted in Linux,Tips and Tricks

Tagged with , , , ,

KDE 4.0 release

without comments

New year

Happy year 2008. I would like to say that blogging more often is not one of my formal resolve for the year.

I will be happy if I consider I’m still blogging by the end of the year. All my other attemps at blogging regularly have failed.

KDE 4.0 has been released

Everyone following tech blog know that KDE 4.0 has been released this friday. I’m quite happy about that since I’ve been a KDE user since I’m full time on Linux. What has changed over the years is that I’m not longer a strong KDE advocate. I will always prefer KDE over GNOME, but I can’t say I would argue strongly for KDE against GNOME. Both a 2 very complete and excellent desktop environment.

The following is my opinion on KDE 4.0. I have tested the Ubuntu Gutsy remastered LiveCD for KDE 4.0. I’ll admint it’s probably not a complete experience of KDE 4.0, but what I’ve seen is enough for me to say that I will not use KDE 4.0 until a while.

I don’t understand people saying they don’t like KDE because it looks too much like Windows. I don’t really care about how my system look if there is a good operating system under the hood.

The look of the environment for me is not a good reason to dislike a desktop environment, be it GNOME or KDE. I’ve got good reasons to dislike GNOME, and most people probably have good reasons to dislike KDE.

Both environment can be themed to change several aspects of their graphical appearance. Also, you can change components of the system until you find the look that suits you. Once that is done, you are left with what really matters in the environment: the quality of the software suite. That is, I believe, the only worthy point of comparison.

The subject has already beaten to death so I’ll keep the following short. This is not an exhaustive list of my opinions about KDE.

The good: it’s KDE 4.0

KDE 4.0 is the next step for the KDE environment. It will get all the development and all the cool apps. If I stick to KDE in general, I will eventually use KDE 4.x, but maybe not KDE 4.0.

The bad

Unstability

I expected nothing else of KDE 4.0. It’s a dot-zero release and thus as many shortcomings and bugs.

When I tried the SuSE LiveCD for KDE 4.0, I badly wrecked my system to the point I had to shutdown my virtual machine. Don’t ask me what happened, I don’t remember. It was with an older version anyway.

With the Ubuntu LiveCD, Gwenview crashed twice, one time right at the moment it was starting.

This is not unexpected. I’m used to living on the edge with very recent software so I am familiar with applications crashing. Sometimes I will even fire-up the debugger and try to fix the problem.

Lack of KMail

I’m a KMail user. I know I could use KDE 3.5 KMail in KDE 4.0 yes, but I can also run KMail in KDE 3.5.8 too if there is not more reasons to switch to KDE 4.0.

The ugly

There is one thing that keeps me from using KDE 4.0 right now. If someone instructs me how to fix that, I’m a taker.

The huge taskbar

It’s huge. Like, 5 times the size I would want it to be. To maximize screen real estate, I have configured my KDE 3 kicker to be minuscule. It’s current 630 pixel wide, and just 30 pixel high, on a 1600×1200 19 inch screen. There is no taskbar, just the system tray, a small set of shortcuts icons, the clock and the desktop switcher. I’ve become used to switching between tasks using Ctrl+Tab and other shortcuts.

I’m not gonna install KDE 4.0 packages and run a KDE 4.0 session on my system until this taskbar can be shrinked to the size I want.

Written by fdgonthier

January 13th, 2008 at 2:50 am

Posted in Linux,News,Reviews,X11

Tagged with , ,