Re: [DNG] Configuring cron and exim4 to send e-mail after running cronjob

2020-11-15 Thread Rick Moen
Quoting Florian Zieboll via Dng (dng@lists.dyne.org):

> 'msmtp' is a lightweight and simple option for sending messages to
> remote smtp servers from shell scripts. with a variable (e.g.
> "$mailcmd") it can be used as drop in replacement for mailx.

Generically, things like msmtp tend to be called 'nullmailers', after an
early example of the type.  I try to track the known options, here:
http://linuxmafia.com/faq/Mail/nullmailers.html

-- 
Cheers,   "The plural of regex is regrets."
Rick Moen  -- old coder gag, seen on Reddit
r...@linuxmafia.com
McQ! (4x80)
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Configuring cron and exim4 to send e-mail after running cronjob

2020-11-15 Thread Marc Shapiro via Dng

On 11/15/20 5:00 AM, Marjorie Roome via Dng wrote:

On Sat, 2020-11-14 at 16:03 -0800, Marc Shapiro via Dng wrote:

I use Thunderbird for e-mail, so I have never bothered with
configuring an MTA.

I have a few lines in root's crontab to do periodic backups and I
would
like to receive an e-mail when the job is completed.  I have added a
MAILTO line to my crontab with my gmail address.  The job runs, the
backup is created, but I do not receive any e-mail from cron.  I am
assuming that I need to run dpkg-reconfigure on exim4-config, but I
don't want to mess up my e-mail that is going through Thunderbird.

Can anyone tell me how to configure exim4-config to do this, or
provide a link that will rpovide this information?


If this is a cron job running on your local machine then rather than
having to fully comnfigure your MTA to send acceptable emails to gmail
(i.e. static ip, spf, dkim, etcetera) it would be simpler to enable
local delivery to your local email account. You can then just read this
by setting up an account in Thunderbird (it's a mbox file so use the
spool option) and it will remain segregated from your gmail.


I came to this conclusion, too, but, so far, have been unable to get 
local delivery working, either.  I have tried running 'maIl marc' then 
filled in subject and body, then ended with CTL-D.  Is CTL-D the correct 
way to end the message and send the e-mail?  Is there something else 
that I need to do to actually send the message?   It may be that the 
various things that I have tried have borked local delivery.  What 
should I have installed and how should it be configured to deliver mail 
to my local user?


Clearly, I am doing something wrong, I just don't know what.


Marc


Rather than redirect the cron mail output I just let root user jobs go
to the default root account and alias that to my local email account
(using /etc/aliases and the newalliases command).

This will then also pick up any other root jobs that generate emails
(in my case unattended-upgrades of security updates, and failed
logins).


___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Configuring cron and exim4 to send e-mail after running cronjob

2020-11-15 Thread Ian Zimmerman
On 2020-11-15 09:02, kdibble wrote:

> msmtp works well for these type of things.
> 
> Beware though as the package includes an apparmor profile which can
> cause problems if you don't use the defaults.

_And_ unless you turn off apparmor. Sorry if this is obvious.

But I concur with the recemmendation of msmtp. A full MTA like exim is
definitely overkill in this situation.

-- 
Ian
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Configuring cron and exim4 to send e-mail after running cronjob

2020-11-15 Thread kdibble
 On Sun, 15 Nov 2020 01:45:20 -0800 Florian Zieboll via Dng 
 wrote 


Am 15. November 2020 01:03:05 MEZ schrieb Marc Shapiro via Dng 
:

> I use Thunderbird for e-mail, so I have never bothered with configuring 
> an MTA.
> 
> I have a few lines in root's crontab to do periodic backups and I would 
> like to receive an e-mail when the job is completed. 


'msmtp' is a lightweight and simple option for sending messages to remote smtp 
servers from shell scripts. with a variable (e.g. "$mailcmd") it can be used as 
drop in replacement for mailx.

libre grüße,
florian



-- 

[message sent otg]

___
Dng mailing list
mailto:Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng




msmtp works well for these type of things.  

Beware though as the package includes an apparmor profile which can cause 
problems

if you don't use the defaults.



Don't ask me how I know this.



Ken___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Configuring cron and exim4 to send e-mail after running cronjob

2020-11-15 Thread Marjorie Roome via Dng
On Sat, 2020-11-14 at 16:03 -0800, Marc Shapiro via Dng wrote:
> I use Thunderbird for e-mail, so I have never bothered with
> configuring an MTA.
> 
> I have a few lines in root's crontab to do periodic backups and I
> would 
> like to receive an e-mail when the job is completed.  I have added a 
> MAILTO line to my crontab with my gmail address.  The job runs, the 
> backup is created, but I do not receive any e-mail from cron.  I am 
> assuming that I need to run dpkg-reconfigure on exim4-config, but I 
> don't want to mess up my e-mail that is going through Thunderbird.
> 
> Can anyone tell me how to configure exim4-config to do this, or
> provide a link that will rpovide this information?
> 
If this is a cron job running on your local machine then rather than
having to fully comnfigure your MTA to send acceptable emails to gmail
(i.e. static ip, spf, dkim, etcetera) it would be simpler to enable
local delivery to your local email account. You can then just read this
by setting up an account in Thunderbird (it's a mbox file so use the
spool option) and it will remain segregated from your gmail. 

Rather than redirect the cron mail output I just let root user jobs go
to the default root account and alias that to my local email account
(using /etc/aliases and the newalliases command).

This will then also pick up any other root jobs that generate emails
(in my case unattended-upgrades of security updates, and failed
logins).

-- 
Marjorie



___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Configuring cron and exim4 to send e-mail after running cronjob

2020-11-15 Thread Florian Zieboll via Dng
Am 15. November 2020 01:03:05 MEZ schrieb Marc Shapiro via Dng 
:

> I use Thunderbird for e-mail, so I have never bothered with configuring 
> an MTA.
> 
> I have a few lines in root's crontab to do periodic backups and I would 
> like to receive an e-mail when the job is completed. 


'msmtp' is a lightweight and simple option for sending messages to remote smtp 
servers from shell scripts. with a variable (e.g. "$mailcmd") it can be used as 
drop in replacement for mailx.

libre grüße,
florian



-- 

[message sent otg]

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Configuring cron and exim4 to send e-mail after running cronjob

2020-11-14 Thread Gregory Nowak
On Sat, Nov 14, 2020 at 04:38:46PM -0800, Marc Shapiro via Dng wrote:
> I tried running "dpkg-reconfigure exim4-config".  I selected "Mail sent by
> smarthost; no local mail" and then took all of the defaults.  I then tried
> to send a test e-mail using the command shown in the link you sent.  I get
> the response "Thunderbird 78.4.3" which is the version of Thunderbird that I
> am running, but no e-mail gets through to my account.

The linked to article doesn't seem to mention adding credentials for
the smarthost. You add them in:

/etc/exim4/passwd.client

See if that helps.

Greg


-- 
web site: http://www.gregn.net
gpg public key: http://www.gregn.net/pubkey.asc
skype: gregn1
(authorization required, add me to your contacts list first)
If we haven't been in touch before, e-mail me before adding me to your contacts.

--
Free domains: http://www.eu.org/ or mail dns-mana...@eu.org
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Configuring cron and exim4 to send e-mail after running cronjob

2020-11-14 Thread Marc Shapiro via Dng


On 11/14/20 4:12 PM, d...@d404.nl wrote:

On 15-11-2020 01:03, Marc Shapiro via Dng wrote:

I use Thunderbird for e-mail, so I have never bothered with
configuring an MTA.

I have a few lines in root's crontab to do periodic backups and I
would like to receive an e-mail when the job is completed.  I have
added a MAILTO line to my crontab with my gmail address.  The job
runs, the backup is created, but I do not receive any e-mail from
cron.  I am assuming that I need to run dpkg-reconfigure on
exim4-config, but I don't want to mess up my e-mail that is going
through Thunderbird.

Can anyone tell me how to configure exim4-config to do this, or
provide a link that will rpovide this information?


Marc


___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Are you sure that your exim4 mta has not been simply denied access by
Google because it has no static ip, spf, dkim etcetera? An alternative
would be to use your isp smtp-server by configuring it as a smarthost
like in this example
https://www.4armed.com/blog/install-and-configure-exim-4-smtp-relay-via-smarthost-on-ubuntu/

Grtz

Nick

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


I tried running "dpkg-reconfigure exim4-config".  I selected "Mail sent 
by smarthost; no local mail" and then took all of the defaults.  I then 
tried to send a test e-mail using the command shown in the link you 
sent.  I get the response "Thunderbird 78.4.3" which is the version of 
Thunderbird that I am running, but no e-mail gets through to my account.



Marc


___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Configuring cron and exim4 to send e-mail after running cronjob

2020-11-14 Thread d...@d404.nl
On 15-11-2020 01:03, Marc Shapiro via Dng wrote:
> I use Thunderbird for e-mail, so I have never bothered with
> configuring an MTA.
>
> I have a few lines in root's crontab to do periodic backups and I
> would like to receive an e-mail when the job is completed.  I have
> added a MAILTO line to my crontab with my gmail address.  The job
> runs, the backup is created, but I do not receive any e-mail from
> cron.  I am assuming that I need to run dpkg-reconfigure on
> exim4-config, but I don't want to mess up my e-mail that is going
> through Thunderbird.
>
> Can anyone tell me how to configure exim4-config to do this, or
> provide a link that will rpovide this information?
>
>
> Marc
>
>
> ___
> Dng mailing list
> Dng@lists.dyne.org
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Are you sure that your exim4 mta has not been simply denied access by
Google because it has no static ip, spf, dkim etcetera? An alternative
would be to use your isp smtp-server by configuring it as a smarthost
like in this example
https://www.4armed.com/blog/install-and-configure-exim-4-smtp-relay-via-smarthost-on-ubuntu/

Grtz

Nick

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


[DNG] Configuring cron and exim4 to send e-mail after running cronjob

2020-11-14 Thread Marc Shapiro via Dng
I use Thunderbird for e-mail, so I have never bothered with configuring 
an MTA.


I have a few lines in root's crontab to do periodic backups and I would 
like to receive an e-mail when the job is completed.  I have added a 
MAILTO line to my crontab with my gmail address.  The job runs, the 
backup is created, but I do not receive any e-mail from cron.  I am 
assuming that I need to run dpkg-reconfigure on exim4-config, but I 
don't want to mess up my e-mail that is going through Thunderbird.


Can anyone tell me how to configure exim4-config to do this, or provide 
a link that will rpovide this information?



Marc


___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng