LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-26-2014, 04:35 PM   #1
anon112
Member
 
Registered: May 2008
Distribution: Arch, FreeBSD
Posts: 116

Rep: Reputation: 17
Sending automatically generated emails


I have had no luck recently with postfix (see here ). So, I am now looking for a simple SMTP program that will automatically send emails after certain events. This should be a program that can be called from another program when a certain event is detected (I used to use mailx with postfix).

I've tried mutt and ssmtp on archlinux, however they don't seem to be able to log into my gmail to send anything (currently I'm trying to send email from my gmail account to myself since I my postfix mail server won't work). Additionally, any help I find on mutt tries to set me up with an IMAP server and that is NOT what I want -- there's some cases where the filesystem is read-only and may cause errors.

So, does anybody know of a very simple smtp client that will work with gmail, allow automatic emails to be sent from programs, and doesn't try to set me up with IMAP?
 
Old 11-26-2014, 05:10 PM   #2
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,333

Rep: Reputation: 5379Reputation: 5379Reputation: 5379Reputation: 5379Reputation: 5379Reputation: 5379Reputation: 5379Reputation: 5379Reputation: 5379Reputation: 5379Reputation: 5379
msmtp or ssmtp

These need to be built with encryption support before they can relay through gmail. The Arch Linux builds should have that taken care of, and there's an ssmtp->gmail guide right on the Arch Wiki.

https://wiki.archlinux.org/index.php/SSMTP

If you're having trouble setting ssmtp up with gmail, and ssmtp has been built with ssl support, then the problem is most likely a problem with your configuration of ssmtp, not with ssmtp itself.

Last edited by dugan; 11-26-2014 at 05:14 PM.
 
Old 11-26-2014, 05:29 PM   #3
anon112
Member
 
Registered: May 2008
Distribution: Arch, FreeBSD
Posts: 116

Original Poster
Rep: Reputation: 17
The config files for those are plain text, so I would have to store my password in a plain text document? I don't see any way around that with ssmtp or msmtp...


EDIT: also, for anyone trying to do this, note that you need to enable less secure apps in the security settings of your account for gmail.

Last edited by anon112; 11-26-2014 at 06:12 PM. Reason: additional info for people trying to use ssmtp
 
Old 11-26-2014, 09:03 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,580
Blog Entries: 28

Rep: Reputation: 6219Reputation: 6219Reputation: 6219Reputation: 6219Reputation: 6219Reputation: 6219Reputation: 6219Reputation: 6219Reputation: 6219Reputation: 6219Reputation: 6219
After you configure msmtp (for example), set the permissions so that only owner can access the file.

Code:
chmod 600 [filename]
Update:

That is, chmod the relevant .*rc file.

Sorry for the lack of clarity.

Last edited by frankbell; 11-26-2014 at 09:36 PM.
 
Old 11-27-2014, 09:21 AM   #5
anon112
Member
 
Registered: May 2008
Distribution: Arch, FreeBSD
Posts: 116

Original Poster
Rep: Reputation: 17
Quote:
set the permissions so that only owner can access the file
That might not work out so well on my system. In my case, there's a possibility that someone will use a live CD on the system. Wouldn't the "root" user on a live CD still be able to read the file? Is there no way to set up an encrypted password manager?
 
  


Reply

Tags
arch, automatic, email, smtp


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Postfix not sending all emails generated from mailx command nancydrew72 Linux - Newbie 3 10-21-2014 12:37 PM
Automatically Generated Wallpapers w1k0 Programming 5 11-26-2013 02:25 PM
Xauth data not being generated automatically coiner Linux - Software 3 09-05-2012 08:07 AM
How do I read emails generated by the system? Akhran Linux - Newbie 2 10-22-2005 11:31 PM
Please, Remove the automatically generated line in the Signatures john_walsh54 LQ Suggestions & Feedback 16 06-05-2005 12:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:10 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