LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-23-2008, 11:09 PM   #1
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
Cron and Mail


I've been experimenting with cron and internal email. Nothing seems to work unless I start sendmail.

I suspect that cron cannot send mail unless a MTA is active. I'm guessing that cron uses whatever daemon occupies port 25. Is this correct?

Sendmail seems like heavy overhead for a single workstation not connected to a LAN. I've discovered that sendmail expects a fully qualified domain name, otherwise the program takes a very long time to start and fills my logs with cantankerous error messages to that effect. A FQDN is senseless with a single workstation. Lastly, I really do not want to spend any time learning anything about sendmail. I have more important items on my to do list.

Is there a more efficient solution that avoids running sendmail? All I want to do is allow cron to successfully send emails. Nothing more.

Thanks.
 
Old 05-24-2008, 06:33 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by Woodsman View Post
I've discovered that sendmail expects a fully qualified domain name (..) A FQDN is senseless with a single workstation.
Just make it the default "localhost.localdomain" entry?


Quote:
Originally Posted by Woodsman View Post
Lastly, I really do not want to spend any time learning anything about sendmail.
Promoting the legendary "I do not need help, I can read" attitude that users of a certain distribution are renowned for, I see?
 
Old 05-24-2008, 04:33 PM   #3
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Original Poster
Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
Quote:
Just make it the default "localhost.localdomain" entry?
Yes, that is what I did last night to avoid the delays in starting.

Quote:
Promoting the legendary "I do not need help, I can read" attitude that users of a certain distribution are renowned for, I see?
Perhaps I'm misreading your reply, but I haven't a clue to what you are referring, nor what distribution. I ask plenty of questions here at LQ, which tends to negate any accusation about not needing help. I also try to reciprocate by maintaining an informational web site significantly focused on solving Slackware issues (read my sig).

I was only offering a statement that I have other things I want to focus rather than spend time learning sendmail. Learning sendmail is not high on my list. I was only looking for a MTA replacement to avoid using sendmail. As I stated in my original post, I only want to be able to receive mail from cron events. Seems like sendmail is significant overkill for such a nominal need.
 
Old 05-25-2008, 09:15 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by Woodsman View Post
Learning sendmail is not high on my list. (..) Seems like sendmail is significant overkill for such a nominal need.
I think that is debatable both in terms of performance and skills necessary to configure Sendmail to run. After all only having to fix the localhost line did it, right? :-]


Quote:
Originally Posted by Woodsman View Post
Perhaps I'm misreading your reply
Yes, you did. Anyway. I'll describe my take on an alternative since I am not familiar with nullmailers (though probably a better alternative). This example should catch e-mail, hand off to the MDA and store in a simple mailbox uses Bash and Procmail, plus Netcat or (X)inetd. The listener will only listen on localhost and deliver to a user called "mailcatch":

Procmail recipe:
Code:
# /home/mailcatch/procmail.conf
# description: Rudimentary mail catcher.
PATH=/usr/local/bin:/usr/bin:/bin
VERBOSE=on
LOGABSTRACT=all
LOGFILE=/home/mailcatch/procmail.log
DEFAULT=/home/mailcatch/mbox

:0
*
$DEFAULT
Xinetd configuration file:
Code:
# /etc/xinetd.d/smtp
# default: on
# description: Rudimentary mail catcher.
service smtp
{
        disable = no
        socket_type     = stream
        protocol        = tcp
        port            = 25
        wait            = no
        user            = root
        server          = /usr/bin/procmail
        server_args     =  -t -f - -o -Y -m /home/mailcatch/procmail.conf
        log_on_failure  += USERID
        only_from       = 127.0.0.1/32
        max_load        = 1
}
Netcat alternative:
Code:
#!/bin/bash
#/etc/rc.d/rc.mailcatcher or something
# description: Rudimentary mail catcher.
mailcatch() { # Restarting listener
 /usr/bin/nc -n -4 -l 127.0.0.1 25 2>&1 \
 |/bin/grep -v "^Conn.*accepted$" \
 |/usr/bin/procmail -t -f - -o -Y -m /home/mailcatch/procmail.conf
}
case "$1" in
 start) mailcatch || mailcatch;;
 stop) /usr/bin/pkill -9 -f '/usr/bin/nc -n -4 -l 127.0.0.1 25' >/dev/null 2>&1;;
 restart) $0 stop; $0 start;;
esac
exit 0
To test copy a single message to a temporary file and remove any delivery or post-delivery flags the MTA, MDA or MUA added. Stop any MTA from running, then 'cat -v message | nc localhost 25', then check the $LOGFILE. I only tested with nc and mailbox format messages so YMMV(VM) as usual.


HTH
 
Old 05-25-2008, 12:01 PM   #5
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Original Poster
Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
Thanks for the info.

As mentioned, I modified my hosts file to add localdomain and sendmail is running fine. Perhaps the overhead is not as much as I imagine and all of this is spilled milk. All is fine in Mudville.

My apologies for misunderstanding your previous response. I'm guessing you were being humorous or tongue-in-cheek, but I did not pause to consider that.
 
Old 05-25-2008, 04:21 PM   #6
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 231Reputation: 231Reputation: 231
And when did Slackware start using xinetd?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
A mail from cron ... gabsik Linux - Networking 3 04-17-2006 03:41 AM
Cron mail sending using outside SMTP mail server Utah Linux - Software 6 08-24-2005 07:44 PM
No More Cron Mail, Cron Error? Xhost Linux - General 3 07-26-2004 04:28 PM
need only cron job mail on my mail id manojthakkar Linux - Newbie 0 12-20-2003 05:41 AM
Cron: E-Mail me only when necessary elconde Linux - General 3 05-31-2002 09:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration