[SOLVED] Trapping system auto-mails to /var/mail without an MTA?
Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
Distribution: LFS 9.0 Custom, Merged Usr, Linux 4.19.x
Posts: 616
Original Poster
Rep:
Quote:
Originally Posted by stefan1959
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.
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?
Distribution: LFS 9.0 Custom, Merged Usr, Linux 4.19.x
Posts: 616
Original Poster
Rep:
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.
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
Last edited by stefan1959; 04-15-2014 at 12:18 AM.
Distribution: LFS 9.0 Custom, Merged Usr, Linux 4.19.x
Posts: 616
Original Poster
Rep:
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
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.
Last edited by Luridis; 04-16-2014 at 05:36 AM.
Reason: Mailx note...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.