LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Trapping system auto-mails to /var/mail without an MTA? (https://www.linuxquestions.org/questions/linux-from-scratch-13/trapping-system-auto-mails-to-var-mail-without-an-mta-4175501678/)

Luridis 04-14-2014 11:29 AM

Trapping system auto-mails to /var/mail without an MTA?
 
Basically, I'm setting up a Linux From Scratch machine. Everything works great so far, except crap like this:

AT command

Quote:

at Dependencies: Required: an MTA
EDIT:

I've spent more than a day looking at this and it's a fairly common issue that most seem to just give up and install sendmail or postfix in default configuration to solve. (See my next post.)

I might have a go at solving it once I get the system set up. I've got enough source from other apps at this point to see how to wash all that out into only the necessary parts for a workstation or server that is not acting as a proper mail server.

stefan1959 04-14-2014 03:12 PM

Quote:

I mean, this is how things use to work on multi-seat systems before MTA's were around. It can grab stuff and deliver to local accounts, right?
MTA's have been around before linux, you are making it hard for yourself, just install a MTA.


Steve

Luridis 04-14-2014 06:26 PM

Quote:

Originally Posted by stefan1959 (Post 5152534)
MTA's have been around before linux, you are making it hard for yourself, just install a MTA.


Steve

Actually, it appears this is an unsolved problem around the net for a lot of people. There are full blown mail servers and then just a couple of smaller projects that deal with the issue specifically as a Lightweight MTA via client protocols to actual mail servers. (SSMPT/Nullmailer) None of which implement an MDA for local-to-local communication. That's not surprising since most MDA's appear to have large libraries used for spam / malware filtering and user quotas. The big name servers are large and complicated beasts that no one wants to touch, even on a workstation, delivering only automated messages.

Now that I've read enough to understand the issue. What is needed for non-mail servers and desktops, as a mail handler, is a pseudo-MTA wrapper, i.e. "sendmail -i" impersonator/pipe-processor, in a very simple MTA. This MTA would speak to actual MTA Servers through client protocols AND to a local light MDA. The local MDA would only accept mail from the local MTA (users and processes), and need not provide spam/malware filters as it's only purpose is to accept job to User-Y or event to local root mail, etc.

In other words, a single-seat, client-centric MTA that handles only local mail.

stefan1959 04-14-2014 06:38 PM

Quote:

Originally Posted by Luridis (Post 5152667)
Actually, it appears this is an unsolved problem around the net for a lot of people. There are full blown mail servers and then just a couple of smaller projects that deal with the issue specifically as a Lightweight MTA via client protocols to actual mail servers. (SSMPT/Nullmailer) None of which implement an MDA for local-to-local communication. That's not surprising since most MDA's appear to have large libraries used for spam / malware filtering and user quotas. The big name servers are large and complicated beasts that no one wants to touch, even on a workstation, delivering only automated messages.

Now that I've read enough to understand the issue. What is needed for non-mail servers and desktops, as a mail handler, is a pseudo-MTA wrapper, i.e. "sendmail -i" impersonator/pipe-processor, in a very simple MTA. This MTA would speak to actual MTA Servers through client protocols AND to a local light MDA. The local MDA would only accept mail from the local MTA (users and processes), and need not provide spam/malware filters as it's only purpose is to accept job to User-Y or event to local root mail, etc.

In other words, a single-seat, client-centric MTA that handles only local mail.

What mail is the system generating? Or are you writing the mail. Can cron job be of help?

Steve

Luridis 04-14-2014 08:26 PM

I'm building a Linux From Scratch, the issue is packages that require... sendmail, that are not "mail applications." Sendmail is a bag of frustration for people whom do not need or want a mail server, yet some applications insist on it's presence to deliver automated messages.

Hence the need for a lightweight MTA & MDA that impersonates sendmail and only does: local-to-local and local-to-outbound via client protocols. This doesn't appear to exist currently, in spite of it being ideal for desktops and servers that aren't mail-servers. A minimal and uncomplicated configuration file.

I think this will most likely be my first free software project, it or a frame-buffer configuration utility.

stefan1959 04-14-2014 10:44 PM

Quote:

Originally Posted by Luridis (Post 5152705)
I'm building a Linux From Scratch, the issue is packages that require... sendmail, that are not "mail applications." Sendmail is a bag of frustration for people whom do not need or want a mail server, yet some applications insist on it's presence to deliver automated messages.

Hence the need for a lightweight MTA & MDA that impersonates sendmail and only does: local-to-local and local-to-outbound via client protocols. This doesn't appear to exist currently, in spite of it being ideal for desktops and servers that aren't mail-servers. A minimal and uncomplicated configuration file.

I think this will most likely be my first free software project, it or a frame-buffer configuration utility.

Sendmail is all I've ever used, ran a small isp for a while.

One reason I put put webmin on, alows for easier config of programs like sendmail.
http://www.linuxquestions.org/questi...ed-4175501416/
BLFS has other MTA's. Not sure whats the easiest to config as I've never used them

P.S. I installed Exim and dovcot, managed to get it working locally after some goggling the errors I got in the mail log after the install.

Steve

Luridis 04-16-2014 05:16 AM

Well, if you're wondering how this worked out for me, if you're someone whom came looking for a system services to root only setup; I've now found that this is fairly easy to do with a script.

Quote:

cat > /usr/sbin/sendmail.sh << "EOF"

#!/bin/bash
# Begin /usr/sbin/sendmail.sh
#
# Spools mail from local daemons to local root mailbox.
# This works by reading the stdin from programs that are
# trying to send mail by executing "sendmail -i" and
# piping the MIME-message-data on the stdout.
# This script won't work for anything looking for a
# network port. aka localhost:25/587

while read sysmail; do
echo -e $sysmail >> /var/mail/root
done

echo "" >> /var/mail/root

# End /usr/sbin/sendmail.sh
EOF

chmod -v 4655 /usr/sbin/sendmail.sh
ln -sv /usr/sbin/sendmail.sh sendmail
You'll probably at least need to install mailx as well. But daemons can now pipe all their mail to root's mailbox. One thing I'd watch is making sure none of the daemons are setup to deliver logs as attachments or mail in html format. Plain text MIME is fine.

If you do setup mailx (some of the daemons use it), locking down execution to a daemon group might be something to do if you're vulnerability paranoid. That way, only daemons can send mail.


All times are GMT -5. The time now is 12:13 PM.