You are not logged in.

#1 2025-05-29 21:37:30

barbaros
Member
From: Lisbon, Portugal
Registered: 2017-02-15
Posts: 17
Website

mail, local delivery only [SOLVED]

Hello,
I have a computer running archlinux and I want to attend to the event of a cron job (or an 'at' job) wanting to send its output by e-mail. That is, I want only delivery of local messages, and I am looking for a simple (minimalistic) setup.
Any suggestions ?
Thank you. Cristian

Last edited by barbaros (2025-06-05 21:07:03)

Offline

#2 2025-05-30 08:55:43

barbaros
Member
From: Lisbon, Portugal
Registered: 2017-02-15
Posts: 17
Website

Re: mail, local delivery only [SOLVED]

Well, I guess that was a rather silly question. It is enough to install the 'at' package and it will install automatically the 'smtp-forwarder' group, right ?
In that case, which command shall I use for checking the (local) mail ?

Offline

#3 2025-05-30 09:10:27

Fixxer
Member
From: Poland
Registered: 2011-08-29
Posts: 231

Re: mail, local delivery only [SOLVED]

You could use postfix to setup local mail system:
https://wiki.archlinux.org/title/Postfix#Local_mail

Local mailboxes, located at /var/spool/mail/$USER you can check in console / terminal by 'mail' command, from s-nail package.You can also use email client supporting /var/spool/mail boxes (eg. not ThunderSnork)

Good luck!

Last edited by Fixxer (2025-05-30 09:12:48)

Offline

#4 2025-05-30 10:50:32

cryptearth
Member
Registered: 2024-02-03
Posts: 1,511

Re: mail, local delivery only [SOLVED]

even simpler than full blown postfix would be simple sendmail which takes the mail drop from cron and does a local delivery as mbox

Offline

#5 2025-05-30 14:19:45

seth
Member
Registered: 2012-09-03
Posts: 65,016

Re: mail, local delivery only [SOLVED]

Is this a desktop system?
In that case I'd bend the cronjob to use notify-send/dunstify for your user unless you intend to frequently check the local mail spooler.

Online

#6 2025-05-31 07:41:16

barbaros
Member
From: Lisbon, Portugal
Registered: 2017-02-15
Posts: 17
Website

Re: mail, local delivery only [SOLVED]

seth wrote:

Is this a desktop system?
In that case I'd bend the cronjob to use notify-send/dunstify for your user unless you intend to frequently check the local mail spooler.

Yes it's a desktop, several actually : https://webpages.ciencias.ulisboa.pt/~c … onfig.html

My intention is to redirect the standard output and standard error so that no e-mail should be ever sent. But I want to be covered "just in case".

Last edited by barbaros (2025-05-31 07:49:36)

Offline

#7 2025-05-31 07:47:22

barbaros
Member
From: Lisbon, Portugal
Registered: 2017-02-15
Posts: 17
Website

Re: mail, local delivery only [SOLVED]

cryptearth wrote:

even simpler than full blown postfix would be simple sendmail which takes the mail drop from cron and does a local delivery as mbox

I see the 'at' package depends on the 'smtp-forwarder' group which contains both 'postfix' and 'dma'. 'dma' provides the command 'sendmail'. I'm confused.

Offline

#8 2025-05-31 09:37:26

cryptearth
Member
Registered: 2024-02-03
Posts: 1,511

Re: mail, local delivery only [SOLVED]

barbaros wrote:
cryptearth wrote:

even simpler than full blown postfix would be simple sendmail which takes the mail drop from cron and does a local delivery as mbox

I see the 'at' package depends on the 'smtp-forwarder' group which contains both 'postfix' and 'dma'. 'dma' provides the command 'sendmail'. I'm confused.

the sendmail binary is often expected no matter which mailer you use hence postfix and exim usually both supply a drop-in replacement - I guess that's just the way how arch resolves it
I use opensuse on my servers and for a long time sendmail was a hard requirement of the base meta group package (seem to got removed not long ago) and hence you coulnd't install even the most basic system without any sendmail provider
IIRC years ago there was a hard dependency of either apache or php on sendmail so whenever you tried to setup a LAMP stack sendmail was pretty much part of it

Offline

#9 2025-05-31 09:42:41

seth
Member
Registered: 2012-09-03
Posts: 65,016

Re: mail, local delivery only [SOLVED]

There're also drop-ins like femtomail and I'm pretty sure I've some bash script that just cat's into your mbox, posing as sendmail, for this purpose.
I'll try to find it later this day and if I do, post it (after a review, it's probably 20 years old and embarrassing)

Online

#10 2025-05-31 21:05:16

seth
Member
Registered: 2012-09-03
Posts: 65,016

Re: mail, local delivery only [SOLVED]

Nope, was a simplistic script "local_mail $SUBJECT $BODY $USER", not even handling stdin, let alone any sendmail parameters.
I'll leave it here, yell if you need to turn this into more of a simple sendmail drop-in.

#!/bin/bash

SENDER="$(whoami)"
RECEIVER="${3:-$SENDER}"

echo "From ${SENDER} $(LC_ALL=C date +%c)
From: ${SENDER}
Date: $(date -R)
To: ${RECEIVER}
Subject: $1
User-Agent: local_mail script
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

$2

" >> /var/spool/mail/${RECEIVER}

Online

#11 2025-06-05 21:06:00

barbaros
Member
From: Lisbon, Portugal
Registered: 2017-02-15
Posts: 17
Website

Re: mail, local delivery only [SOLVED]

I installed 'at', 'dma' and 's-nail'.
Practically no configuration needed.
Thank you all

Offline

Board footer

Powered by FluxBB