You are not logged in.
Pages: 1
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
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
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
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
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
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
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
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
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
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
I installed 'at', 'dma' and 's-nail'.
Practically no configuration needed.
Thank you all
Offline
Pages: 1