LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 06-18-2019, 10:11 PM   #1
browny_amiga
Member
 
Registered: Dec 2001
Location: /mnt/UNV/Mlkway/Earth/USA/California/Silicon Valley
Distribution: Kubuntu, Debian Wheezy/Jessie Stable, Windoze 7
Posts: 614

Rep: Reputation: 36
Mutt mail: how to retry sending automatically?


Hi,

I'm using a startup shutdown daemon that I wrote myself via systemd. I use mutt to send mail directly to gmail via smtp. Now the startup mail always works, the shutdown does not.
This has several reasons, the mail send probably gets executed too late, OR there is a power outage, at which point the network is down.

Now what I want is that when mutt can't deliver mail, it saves the message somewhere (in the outgoing mail folder) and retries sending the mail later. I want to see the time stamp of the original shutdown.
Does mutt have any functionality like this or do I have to handle failure all by myself, via the script?
 
Old 06-19-2019, 02:59 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,780
Blog Entries: 15

Rep: Reputation: 1630Reputation: 1630Reputation: 1630Reputation: 1630Reputation: 1630Reputation: 1630Reputation: 1630Reputation: 1630Reputation: 1630Reputation: 1630Reputation: 1630
How are you configuring mutt to send directly to gmail?

By default mutt would talk to the MTA (e.g. sendmail or postfix) on the system and that MTA would make the connection to the recipient's mail server. If you do it that way, by default it retries the send if it fails at increasing intervals and doesn't give up unless it is still queued after 5 days.
 
Old 06-19-2019, 04:04 PM   #3
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.6
Posts: 3,264

Rep: Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106
What MensaWater said is absolutely correct, IF you're running postfix, sendmail, or other MTA on your server. It's the MTA that will queue the mail and retry, not mutt.

If, however, you've configured mutt to just hand off to gmail, and that handoff doesn't happen for the reasons you suggested, I wouldn't expect the email to be retained and resent. The mutt manual may help.
 
Old 06-19-2019, 05:06 PM   #4
browny_amiga
Member
 
Registered: Dec 2001
Location: /mnt/UNV/Mlkway/Earth/USA/California/Silicon Valley
Distribution: Kubuntu, Debian Wheezy/Jessie Stable, Windoze 7
Posts: 614

Original Poster
Rep: Reputation: 36
I don't know anything about sending up mail, but sendmail I only did once and I would not do that again for a million bucks, what a dinosaur, the config is horrible antiquated.
Postfix I might be able to manage, but wouldn't it be total overkill if I only used it for that and wouldn't I run into a blockage by the gmail smtp websever for illegally relaying mail? I remember having this issue before and smtps usually expect you to send direct and not relay.

It might be easier to rebuild the resend mechanism myself, before I build a whole post office just to send one letter every few weeks (obviously the server is not rebooting often)

Last edited by browny_amiga; 06-19-2019 at 05:07 PM.
 
Old 06-19-2019, 06:29 PM   #5
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.6
Posts: 3,264

Rep: Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106
Quote:
Originally Posted by browny_amiga View Post
I don't know anything about sending up mail, but sendmail I only did once and I would not do that again for a million bucks, what a dinosaur, the config is horrible antiquated.
Postfix I might be able to manage, but wouldn't it be total overkill if I only used it for that and wouldn't I run into a blockage by the gmail smtp websever for illegally relaying mail? I remember having this issue before and smtps usually expect you to send direct and not relay.

It might be easier to rebuild the resend mechanism myself, before I build a whole post office just to send one letter every few weeks (obviously the server is not rebooting often)
Good points. Although if you had your own MTA, you'd be sending email To: gmail, not with gmail. Still, configuring any MTA is not a trivial task.

How urgent is the need to receive the shutdown email? How often does it not work?

Consider having the startup email include the date/time of the previous shutdown by parsing log files.
Just a thought.

Last edited by scasey; 06-19-2019 at 06:32 PM.
 
Old 06-20-2019, 08:42 PM   #6
browny_amiga
Member
 
Registered: Dec 2001
Location: /mnt/UNV/Mlkway/Earth/USA/California/Silicon Valley
Distribution: Kubuntu, Debian Wheezy/Jessie Stable, Windoze 7
Posts: 614

Original Poster
Rep: Reputation: 36
Let's say it like this: When I really need to know about a shutdown (not scheduled, power related, I have a UPS), I never hear about it, as mutt probably tries and fails. I might just have to build a whole system that can buffer messages in case they cannot be sent and retry later on with a cron job or something.
 
Old 06-21-2019, 07:50 AM   #7
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,780
Blog Entries: 15

Rep: Reputation: 1630Reputation: 1630Reputation: 1630Reputation: 1630Reputation: 1630Reputation: 1630Reputation: 1630Reputation: 1630Reputation: 1630Reputation: 1630Reputation: 1630
Quote:
Originally Posted by browny_amiga View Post
I might just have to build a whole system
And that would be easier than setting up the MTA that your distro provides?
 
1 members found this post helpful.
Old 06-21-2019, 08:26 PM   #8
browny_amiga
Member
 
Registered: Dec 2001
Location: /mnt/UNV/Mlkway/Earth/USA/California/Silicon Valley
Distribution: Kubuntu, Debian Wheezy/Jessie Stable, Windoze 7
Posts: 614

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by MensaWater View Post
And that would be easier than setting up the MTA that your distro provides?
Yes, in my view it is. Especially since I don't need an MTA on that system and really really hate Sendmail. I'm not a fan of ancient crappy UNIX technologies, I'm a modern Linux admin. Might also have something to do that I have so far never setup a SMTP mail server, so learning all that is definitely more effort for me.
With mutt, all I have to do is see if the message send has been successsful and buffer the message if it fails and then retry.

You could say I have some PTSD from having been forced by a teacher to use Sendmail and having me fail because of it after putting in a lot of work and doing very well on all other areas. ;-)

Last edited by browny_amiga; 06-21-2019 at 08:28 PM.
 
Old 06-21-2019, 08:42 PM   #9
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.6
Posts: 3,264

Rep: Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106Reputation: 1106
Quote:
Originally Posted by browny_amiga View Post
Yes, in my view it is. Especially since I don't need an MTA on that system and really really hate Sendmail. I'm not a fan of ancient crappy UNIX technologies, I'm a modern Linux admin. Might also have something to do that I have so far never setup a SMTP mail server, so learning all that is definitely more effort for me.
With mutt, all I have to do is see if the message send has been successsful and buffer the message if it fails and then retry.

You could say I have some PTSD from having been forced by a teacher to use Sendmail and having me fail because of it after putting in a lot of work and doing very well on all other areas. ;-)
Agree that sendmail is a PITA...thatís why I learned qmail back in the day...talk about ancient (but certainly not crappy!)
So, I donít know anything else, but in your place Iíd look at postfix before I tried to detect that something didnít work an let the MTA handle it. Postfix is ďmodernĒ ó I donít think it even existed when I was seeking alternatives to sendmail.

But itís your server...
 
Old 06-21-2019, 09:00 PM   #10
browny_amiga
Member
 
Registered: Dec 2001
Location: /mnt/UNV/Mlkway/Earth/USA/California/Silicon Valley
Distribution: Kubuntu, Debian Wheezy/Jessie Stable, Windoze 7
Posts: 614

Original Poster
Rep: Reputation: 36
Hmm, you are right, I will investigate postfix, before I reinvent the wheel, so I possibly could use it as a relay for mutt. I wonder though, what domain I would be from, I would be running a SMTP server and I would need a domain for it. I have heard that gmail is blocking many unknown SMTP hosts that people run themselves, as it is often a thing that spammers do.
When I use mutt, I basically use my gmail account for it and provide login credentials for it, that way gmail knows I'm for real.
 
  


Reply


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
[SOLVED] [Mutt] Can I process a current mail in a shell command from Mutt? Michael Uplawski Linux - Software 5 06-21-2016 02:56 AM
[SOLVED] Connection Refused error while sending mail using mutt and msmtp Iyyappan Linux - Server 2 06-30-2012 04:49 AM
msmtp/mutt trouble sending mail (server message: 451 4.4.1) Phieth6o Linux - Software 1 12-23-2009 02:23 PM
Mutt question: "How can I configure mutt for not automarking as read??" xowl Linux - Software 0 09-25-2007 09:09 AM
Mutt under FilePro not sending mail! JMCHAP1 Linux - Software 0 10-11-2006 08:59 AM

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

All times are GMT -5. The time now is 12:55 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration