Skip to main content

Ralsina.Me — Roberto Alsina's website

A different UNIX Part I: Mail in not-mail-servers

I have been pro­cras­ti­nat­ing about cre­at­ing my own Lin­ux dis­tro for at least three years. Guess what? I will still pro­cras­ti­nate about it for a few more, but that doesn mean I can't write about how it's sup­posed to work ;-)

So, here is a first piece of the puz­zle...

What do I mean by "Main in not-­mail-server­s"?

If by mail serv­er we mean a box that has the re­spon­s­abil­i­ty to han­dle send­ing mail for user­s, non-­mail-servers are all the rest.

And what is it they do with mail? They gen­er­ate it. Both the users and the pro­cess­es of those box­es gen­er­ate mail. They do it for cron job­s, they do it for main­te­nance pro­cess­es, they do it for alert­s, what­ev­er.

And what is it they do with that email? They send it some­where.

Usu­al­ly, they send it to them­selves. Which is a pret­ty use­less thing.

Go now and check the root mail­box in your com­put­er­s. I bet most of you have a bunch of mails in them you nev­er checked. Ei­ther it's im­por­tan­t, in which case you should have placed it in a mail­box you ac­tu­al­ly read, or it's not, in which case it's use­less to store.

In any case, it should­n't be there.

How does your box send those mail­s? Us­ing ei­ther the send­mail bi­na­ry, or the mail pro­gram (prob­a­bly mailx), which us­es the send­mail bi­na­ry.

Just be­cause it's called send­mail it does­n't mean it is send­mail, of course. Post­fix and qmail pro­vide a send­mail wrap­per to in­ject mail in­to their queues.

But the main prob­lem is that us­ing those means you need to have a well con­fig­ured mail serv­er in ev­ery box, even if they are not mail servers! Yes, your dis­tro gives you a de­cent con­fig­u­ra­tion by de­fault which makes things usu­al­ly work... for lo­cal mail de­liv­ery at least. Which is prob­a­bly not re­al­ly what you wan­t.

En­ter null­mail­er. A sort of heav­i­ly se­dat­ed, neutered qmail.

Con­fig­u­ra­tion:

  • De­­fault do­­main name of out­­­go­ing mail in /etc/nul­l­­mail­er/me

  • List of SMTP servers in /etc/null­mail­er/re­motes:

    mx1.mydomain.com smtp --user=ralsina --pass=notmyrealpass

You can put sev­er­al, it will try them in or­der.

And that's that. A tiny ser­vice, which us­es no TCP port­s. The whole thing is 59KB (or less if you use di­et libc), has one SUID bi­na­ry (but it is not SUID root), two con­fig files (both one-­lin­er­s), no need for alias­ing the sys­tem user­s.... and you can re­move post­fix/send­mail/q­mail from most of your server­s.

Sounds like a good idea to me.

Long update

I have not post­ed in a long time, not be­cause noth­ing hap­pened, but be­cause too much hap­pened.

So, here is an up­date...

Ba­by

The ba­by is do­ing great. The first ul­tra­sound was on Sep­t. 15th, and hree he is:

ecografiaPoroto

Birth­day

That was on Sep­t. 15th be­cause Rosario want­ed it to be my 35th birth­day presen­t. So hap­py birth­day to me.

Work

The lit­tle com­pa­ny I am start­ing up is do­ing great

Hob­by

I have de­cid­ed that I have al­most enough pack­aged for Arch that it's start­ing to make sense to mas­ter some ISOs. Ba­si­cal­ly: a some­what-D­JB-way-ori­ent­ed lin­ux dis­tro.

  • Boots us­ing runit

  • Maybe some­­day will use LUA in­­stead of sh for start­up scripts

  • All ser­vices should be man­aged

  • Will in­­tro­­duce ge­net­ic di­ver­si­­ty to the ecosys­tem

That mean­s: no send­mail, no post­fix, no BIND, no Apache (at least for ba­sic stuff), no many oth­er "lead­ing" pro­gram­s. That is in­ten­tion­al. If ev­ery­one us­es BIND, a BIND fail­ure is cat­a­stroph­ic.

If I have learned any­thing from Out­look/IE it's that hav­ing ev­ery­one use the same thing is com­fort­able, but trou­ble­some.

Going Higher Level, Leaving the Shell (Part I)

What hap­pens if you try not to use a shell in Lin­ux?

And no, I don't mean for in­ter­ac­tive use. Many do that.

No... what hap­pens if you try not to use a shel­l... to boot your sys­tem?

Read more to find out.

Logging in style

I wrote a short in­tro to sys­log, in or­der to stop us­ing it.

Learn about sock­log, svlogd and oth­er al­ter­na­tive log­ging mech­a­nism­s.

Be­cause logs are your best friend­s.

The bad side of Arch Linux

I post­ed yes­ter­day that I liked Arch but I called it "not too good". So, Mark Kretschmann post­ed a com­ment ask­ing what I did­n't like.

It's not too much, but here it goes:

  1. The up­­­grades some­­times are a bit painful (switch­ing to udev was a bit hard).

  2. The pol­i­­cy of delet­ing the pack­­age doc­u­­men­­ta­­tion is evil. Re­al­­ly.

  3. The start­up sys­tem is too sim­­plis­tic. No de­­fault or­der of start­up scripts means some­­times it takes tri­al and er­ror to fig­ure out what goes first. Hal or dbus? hwd?

  4. The pack­­age se­lec­­tion (with­­out un­­sup­­port­ed) is some­what skimpy (no per­l-net-server? no per­l-ht­m­l-tem­­plate?) but that's prob­a­bly my POV be­­cause I am a bit server-ori­en­t­ed.

  5. Some ba­sic pack­­ages make scary as­­sump­­tion­s. For ex­am­­ple, if you have a us­er with UID 89 when you in­­stall mysql server, weird things may hap­pen. Same for UID 40 and named.

On the oth­er hand, the good side (at least for an am­a­teur like me) is a bazil­lion times big­ger.


Contents © 2000-2022 Roberto Alsina