LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 03-27-2017, 09:06 PM   #1
JHNC
LQ Newbie
 
Registered: Mar 2017
Posts: 2

Rep: Reputation: 0
Ubuntu 14.04 - Set up smtp notification for cron job


I have zero experience in setting up SMTP. I want to set up SMTP on Ubuntu Desktop 14.04 LTS so I will get an email to confirm a certain cron job has run
Code:
sudo fstrim -v /
I see many references to using Postfix as SMTP:
https://help.ubuntu.com/lts/serverguide/postfix.html

From the guide, I see that Postfix is quite involved in set up, especially for such a simple task as emailing a cron job. And I am assuming that setting up Postfix in Ubuntu Server is similar to doing so in Ubuntu Desktop, but I stand to be corrected.

Can someone refer advise the simplest way to do this. Thanks!
 
Old 03-29-2017, 06:31 AM   #2
AB49K
LQ Newbie
 
Registered: Mar 2017
Location: Australia
Distribution: CentOS, OpenSuse, Ubuntu, Debian.
Posts: 26

Rep: Reputation: Disabled
Hi JHNC.
Is there any reason you can't follow the guide at DO: https://www.digitalocean.com/communi...n-ubuntu-14-04

It's pretty good.

Just a bit of a note, it may be a decent idea - instead of setting up a postfix server use an email client like mutt to send an email using a different email server (like a gmail account or an ISP account)

http://www.tecmint.com/send-mail-fro...-mutt-command/
That way that's one less service you have to configure and maintain
 
Old 03-31-2017, 05:09 AM   #3
JHNC
LQ Newbie
 
Registered: Mar 2017
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by AB49K View Post
Hi JHNC.
Is there any reason you can't follow the guide at DO: https://www.digitalocean.com/communi...n-ubuntu-14-04

It's pretty good.

Just a bit of a note, it may be a decent idea - instead of setting up a postfix server use an email client like mutt to send an email using a different email server (like a gmail account or an ISP account)

http://www.tecmint.com/send-mail-fro...-mutt-command/
That way that's one less service you have to configure and maintain
OK. Mr. Newbie here. I am hoping to not have to install more software to accomplish this. I am thinking there may be a way that is already burned into the OS that can do this, at least on Ubuntu Server. As both desk top and server are quite similar, minus the GUI, anyway. But, perhaps not. I will review Mutt and see if that would be an easier alternative. Thank you for the suggestion!
 
Old 03-31-2017, 09:38 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by AB49K View Post
Just a bit of a note, it may be a decent idea - instead of setting up a postfix server use an email client like mutt to send an email using a different email server (like a gmail account or an ISP account)
this is your best option.
you don't want to install a full mail server just for notification mails.
it's also a commonly chosen option in situations like these.
 
Old 05-29-2017, 12:01 PM   #5
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,771
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
Quote:
Originally Posted by AB49K View Post
...
instead of setting up a postfix server use an email client like mutt to send an email using a different email server (like a gmail account or an ISP account)

http://www.tecmint.com/send-mail-fro...-mutt-command/
That way that's one less service you have to configure and maintain
This works well to send email interactively. However, I have not discovered how to do this from within a script without end-user interaction.
I don't find any way to use mutt and accomplish the following:
Code:
prompt$  mail {options} -c cc-addr -r from-addr -s subject  to-addr ...
Thanks in advance,
~~~ 0;-Dan
 
Old 05-29-2017, 04:25 PM   #6
Dave Lerner
Member
 
Registered: May 2005
Location: Florida, USA
Distribution: Pop_OS, Xubuntu
Posts: 152

Rep: Reputation: 44
I've used exim4 for this in the past. It's relatively easy to set up.

Quote:
Exim (v4) is a mail transport agent. exim4 is the metapackage depending on the essential components for a basic exim4 installation.
If you can't get it working, I have some notes on my exim4 setup.

Last edited by Dave Lerner; 06-01-2017 at 10:10 PM. Reason: Trivial cosmetic fix.
 
1 members found this post helpful.
Old 05-30-2017, 12:52 PM   #7
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,771
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
Quote:
Originally Posted by Dave Lerner View Post
I've used exim4 for this in the past. It's relatively easy to set up.
If you can't get it working, I have some notes on my exim4 setup.
Thanks for the tip and the willingness to guide my stumbling.
ASIDE -- With all of the mobile device notifications and such that are possible, I wish that command-line or similar workstation notifications out to mobile devices would be more main stream.

Watch for my results later this week.

Cheers,
~~~ 0;-Dan
 
  


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
set cron to run job every 30hours sandy_linux Linux - Newbie 5 09-02-2011 08:38 AM
How to set up a Cron Job to run every other week or every three months etc. kckabobus Linux - Newbie 3 04-03-2008 01:36 PM
How do I set my profile in CRON job? lolson33 Linux - General 2 12-06-2005 04:18 PM
defining an external smtp server for mailing results of chkroot cron job xfurious_mindx Linux - General 0 03-15-2004 09:23 AM
how to set cron job to run every 5 mins? gsbarry Linux - General 7 05-28-2003 12:30 PM

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

All times are GMT -5. The time now is 10:36 AM.

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