* [gentoo-user] Tell cron to send email using sender:passwd@host:587 syntax?
@ 2013-11-16 14:05 Tanstaafl
2013-11-16 14:13 ` Tanstaafl
` (2 more replies)
0 siblings, 3 replies; 17+ messages in thread
From: Tanstaafl @ 2013-11-16 14:05 UTC (permalink / raw
To: gentoo-user
Hi all...
I'm a little confused by something...
If I change the MAILURI in make.conf from the default, ie:
> #PORTAGE_ELOG_MAILURI="root /usr/sbin/sendmail"
> PORTAGE_ELOG_MAILURI="recipient@example.com sender:passwd@smtp.example.com:100587"
I'm guessing portage still uses /usr/sbin/sendmail, but using the above
defined credentials?
The reason I ask is, I have a new system I've been working on that will
eventually replace my old mail server. I'm getting close, but now I'm
tweaking a few system logging and reporting things, and while my system
successfully sends emerge logs with the above, cron job emails are not
successfully sent, and I get a message in the logs about my client being
rejected (not allowed to relay), which is as it should be.
I think all I need to do is figure out how to tell cron to send emails
the same way as portage using sender:passwd@smtp.example.com:587 (using
TLS), but alas, my google-fu is failing on this one... I can't find a
single mention anywhere of alternate examples of sending emails with
cron, much less using sender:passwd@host:587 syntax...
So... anyone? I can't imagine it isn't possible... ?
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] Tell cron to send email using sender:passwd@host:587 syntax?
2013-11-16 14:05 [gentoo-user] Tell cron to send email using sender:passwd@host:587 syntax? Tanstaafl
@ 2013-11-16 14:13 ` Tanstaafl
2013-11-16 14:56 ` Neil Bothwick
2013-11-16 19:29 ` [gentoo-user] Tell cron to send email using sender:passwd@host:587 syntax? Benjamin Lee
2 siblings, 0 replies; 17+ messages in thread
From: Tanstaafl @ 2013-11-16 14:13 UTC (permalink / raw
To: gentoo-user
On 2013-11-16 9:05 AM, Tanstaafl <tanstaafl@libertytrek.org> wrote:
> Hi all...
>
> I'm a little confused by something...
>
> If I change the MAILURI in make.conf from the default, ie:
>
>> #PORTAGE_ELOG_MAILURI="root /usr/sbin/sendmail"
>> PORTAGE_ELOG_MAILURI="recipient@example.com
>> sender:passwd@smtp.example.com:100587"
>
> I'm guessing portage still uses /usr/sbin/sendmail, but using the above
> defined credentials?
Well... now I'm more confused...
I just tested this by re-emerging something tiny and watching the
logs... and there was *nothing* in the logs evidencing an email being
sent (if it was using my postfix install, it would have been in the logs)...
But, the email was still successfully sent/received by my other server.
Wtf??? Does portage have it's own TLS capable MAIL binary/client?
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] Tell cron to send email using sender:passwd@host:587 syntax?
2013-11-16 14:05 [gentoo-user] Tell cron to send email using sender:passwd@host:587 syntax? Tanstaafl
2013-11-16 14:13 ` Tanstaafl
@ 2013-11-16 14:56 ` Neil Bothwick
2013-11-16 14:59 ` Tanstaafl
2013-11-16 19:29 ` [gentoo-user] Tell cron to send email using sender:passwd@host:587 syntax? Benjamin Lee
2 siblings, 1 reply; 17+ messages in thread
From: Neil Bothwick @ 2013-11-16 14:56 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 778 bytes --]
On Sat, 16 Nov 2013 09:05:52 -0500, Tanstaafl wrote:
> > #PORTAGE_ELOG_MAILURI="root /usr/sbin/sendmail"
> > PORTAGE_ELOG_MAILURI="recipient@example.com
> > sender:passwd@smtp.example.com:100587"
>
> I'm guessing portage still uses /usr/sbin/sendmail, but using the above
> defined credentials?
Not according to mail.conf.example
# mailserver: smtp server that should be used to deliver the mail (defaults to localhost)
# alternatively this can also be a the path to a sendmail binary if you don't want to use smtp
So it uses SMTP by default, Python has standard libraries that make this
simple, and only uses sendmail when you explicitly instruct it to do so.
--
Neil Bothwick
If nothing sticks to Teflon, how do they stick teflon on the pan?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] Tell cron to send email using sender:passwd@host:587 syntax?
2013-11-16 14:56 ` Neil Bothwick
@ 2013-11-16 14:59 ` Tanstaafl
2013-11-16 15:04 ` Neil Bothwick
0 siblings, 1 reply; 17+ messages in thread
From: Tanstaafl @ 2013-11-16 14:59 UTC (permalink / raw
To: gentoo-user
On 2013-11-16 9:56 AM, Neil Bothwick <neil@digimed.co.uk> wrote:
> So it uses SMTP by default, Python has standard libraries that make this
> simple, and only uses sendmail when you explicitly instruct it to do so.
Ok... so... the question remains - can I tell cron to send mail the same
way?
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] Tell cron to send email using sender:passwd@host:587 syntax?
2013-11-16 14:59 ` Tanstaafl
@ 2013-11-16 15:04 ` Neil Bothwick
2013-11-16 15:17 ` Tanstaafl
0 siblings, 1 reply; 17+ messages in thread
From: Neil Bothwick @ 2013-11-16 15:04 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 579 bytes --]
On Sat, 16 Nov 2013 09:59:09 -0500, Tanstaafl wrote:
> On 2013-11-16 9:56 AM, Neil Bothwick <neil@digimed.co.uk> wrote:
> > So it uses SMTP by default, Python has standard libraries that make
> > this simple, and only uses sendmail when you explicitly instruct it
> > to do so.
>
> Ok... so... the question remains - can I tell cron to send mail the
> same way?
You don't, cron sends mail via sendmail, to the recipient specified by
the MAILTO variable in the crontab file.
--
Neil Bothwick
Keep your words soft and sweet in case you have to eat them.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] Tell cron to send email using sender:passwd@host:587 syntax?
2013-11-16 15:04 ` Neil Bothwick
@ 2013-11-16 15:17 ` Tanstaafl
2013-11-16 17:32 ` Neil Bothwick
0 siblings, 1 reply; 17+ messages in thread
From: Tanstaafl @ 2013-11-16 15:17 UTC (permalink / raw
To: gentoo-user
On 2013-11-16 10:04 AM, Neil Bothwick <neil@digimed.co.uk> wrote:
> On Sat, 16 Nov 2013 09:59:09 -0500, Tanstaafl wrote:
>
>> On 2013-11-16 9:56 AM, Neil Bothwick <neil@digimed.co.uk> wrote:
>>> So it uses SMTP by default, Python has standard libraries that make
>>> this simple, and only uses sendmail when you explicitly instruct it
>>> to do so.
>>
>> Ok... so... the question remains - can I tell cron to send mail the
>> same way?
>
> You don't, cron sends mail via sendmail, to the recipient specified by
> the MAILTO variable in the crontab file.
Thanks Neil, but... you said 'You don't'... not 'You CAN'T'...
Can you elaborate on this? If this is not possible - why is it not
possible? In other words, if portage can do it, why can't cron?
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] Tell cron to send email using sender:passwd@host:587 syntax?
2013-11-16 15:17 ` Tanstaafl
@ 2013-11-16 17:32 ` Neil Bothwick
2013-11-16 17:42 ` Tanstaafl
0 siblings, 1 reply; 17+ messages in thread
From: Neil Bothwick @ 2013-11-16 17:32 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 878 bytes --]
On Sat, 16 Nov 2013 10:17:07 -0500, Tanstaafl wrote:
> >> Ok... so... the question remains - can I tell cron to send mail the
> >> same way?
> >
> > You don't, cron sends mail via sendmail, to the recipient specified by
> > the MAILTO variable in the crontab file.
>
> Thanks Neil, but... you said 'You don't'... not 'You CAN'T'...
>
> Can you elaborate on this? If this is not possible - why is it not
> possible? In other words, if portage can do it, why can't cron?
Well, it's possible, you just patch cron to add SMTP code so that it can
send mail itself, rather than using the unix standard approach of doing
its own job and passing other tasks onto programs designed for those jobs.
Cron runs cron jobs, sendmail sends mail.
--
Neil Bothwick
A real programmer never documents his code.
It was hard to make, it should be hard to read
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] Tell cron to send email using sender:passwd@host:587 syntax?
2013-11-16 17:32 ` Neil Bothwick
@ 2013-11-16 17:42 ` Tanstaafl
2013-11-16 21:24 ` Alan McKinnon
2013-11-18 13:45 ` [gentoo-user] Re: Tell cron to send email using sender:passwd <at> host:587 syntax? James
0 siblings, 2 replies; 17+ messages in thread
From: Tanstaafl @ 2013-11-16 17:42 UTC (permalink / raw
To: gentoo-user
On 2013-11-16 12:32 PM, Neil Bothwick <neil@digimed.co.uk> wrote:
> sendmail sends mail.
And apparently so does portage...
So, anyone care to venture a guess as to why the gentoo devs decided to
implement their own smtp server just so portage could send emails all by
itself, rather than requiring the installation of an MTA?
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] Tell cron to send email using sender:passwd@host:587 syntax?
2013-11-16 14:05 [gentoo-user] Tell cron to send email using sender:passwd@host:587 syntax? Tanstaafl
2013-11-16 14:13 ` Tanstaafl
2013-11-16 14:56 ` Neil Bothwick
@ 2013-11-16 19:29 ` Benjamin Lee
2013-11-16 20:03 ` Tanstaafl
2 siblings, 1 reply; 17+ messages in thread
From: Benjamin Lee @ 2013-11-16 19:29 UTC (permalink / raw
To: gentoo-user; +Cc: tanstaafl
[-- Attachment #1: Type: text/plain, Size: 1032 bytes --]
On Sat, 16 Nov 2013 09:05:52 -0500, Tanstaafl <tanstaafl@libertytrek.org> wrote:
[...]
> I think all I need to do is figure out how to tell cron to send emails
> the same way as portage using sender:passwd@smtp.example.com:587 (using
> TLS), but alas, my google-fu is failing on this one... I can't find a
> single mention anywhere of alternate examples of sending emails with
> cron, much less using sender:passwd@host:587 syntax...
>
> So... anyone? I can't imagine it isn't possible... ?
You're asking about cron, which is the wrong question.
Run a local MTA and have it relay everything through the remote SMTP
server. This is 3 lines in a Postfix configuration file [1] (only 1
line if you don't require authentication). Any MTA can do this, as it
is a very common setup.
Then all programs (not just cron) that use the sendmail binary or relay
to localhost:25 will work automatically.
[1] http://www.postfix.org/SOHO_README.html#client_sasl_enable
--
Benjamin Lee
http://www.b1c1l1.com/
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] Tell cron to send email using sender:passwd@host:587 syntax?
2013-11-16 19:29 ` [gentoo-user] Tell cron to send email using sender:passwd@host:587 syntax? Benjamin Lee
@ 2013-11-16 20:03 ` Tanstaafl
2013-11-16 20:25 ` Manuel McLure
` (2 more replies)
0 siblings, 3 replies; 17+ messages in thread
From: Tanstaafl @ 2013-11-16 20:03 UTC (permalink / raw
To: gentoo-user
On 2013-11-16 2:29 PM, Benjamin Lee <ben@b1c1l1.com> wrote:
> On Sat, 16 Nov 2013 09:05:52 -0500, Tanstaafl <tanstaafl@libertytrek.org> wrote:
> [...]
>> I think all I need to do is figure out how to tell cron to send emails
>> the same way as portage using sender:passwd@smtp.example.com:587 (using
>> TLS), but alas, my google-fu is failing on this one... I can't find a
>> single mention anywhere of alternate examples of sending emails with
>> cron, much less using sender:passwd@host:587 syntax...
>>
>> So... anyone? I can't imagine it isn't possible... ?
>
> You're asking about cron, which is the wrong question.
No...
I know all about running a local MTA.
My real question is, why can portage do this (send emails without a
local MTA installed)?
Why did the gentoo devs decide to build an smtp client into it capable
of doing TLS, instead of simply requiring an MTA to be able to email
emerge logs?
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] Tell cron to send email using sender:passwd@host:587 syntax?
2013-11-16 20:03 ` Tanstaafl
@ 2013-11-16 20:25 ` Manuel McLure
2013-11-17 11:42 ` Tanstaafl
2013-11-16 23:14 ` Neil Bothwick
2013-11-17 9:00 ` Peter Humphrey
2 siblings, 1 reply; 17+ messages in thread
From: Manuel McLure @ 2013-11-16 20:25 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 931 bytes --]
On Sat, Nov 16, 2013 at 12:03 PM, Tanstaafl <tanstaafl@libertytrek.org>wrote:
> No...
>
> I know all about running a local MTA.
>
> My real question is, why can portage do this (send emails without a local
> MTA installed)?
>
> Why did the gentoo devs decide to build an smtp client into it capable of
> doing TLS, instead of simply requiring an MTA to be able to email emerge
> logs?
>
>
They didn't. The smtp client is part of Python, not part of portage. If
you're developing in Python, you just call Python's mail API and let Python
take care of the mail, instead of calling the local MTA. Easier and faster
development.
Cron is written in C where you don't get mail functionality for free so
it's easier to use the local MTA.
--
Manuel A. McLure WW1FA <manuel@mclure.org> <http://www.mclure.org>
...for in Ulthar, according to an ancient and significant law,
no man may kill a cat. -- H.P. Lovecraft
[-- Attachment #2: Type: text/html, Size: 1732 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] Tell cron to send email using sender:passwd@host:587 syntax?
2013-11-16 17:42 ` Tanstaafl
@ 2013-11-16 21:24 ` Alan McKinnon
2013-11-18 13:45 ` [gentoo-user] Re: Tell cron to send email using sender:passwd <at> host:587 syntax? James
1 sibling, 0 replies; 17+ messages in thread
From: Alan McKinnon @ 2013-11-16 21:24 UTC (permalink / raw
To: gentoo-user
On 16/11/2013 19:42, Tanstaafl wrote:
> On 2013-11-16 12:32 PM, Neil Bothwick <neil@digimed.co.uk> wrote:
>> sendmail sends mail.
>
> And apparently so does portage...
>
> So, anyone care to venture a guess as to why the gentoo devs decided to
> implement their own smtp server just so portage could send emails all by
> itself, rather than requiring the installation of an MTA?
>
portage DOES NOT implement an MTA. From Neil's earlier mail:
"Python has standard libraries that make this
simple, and only uses sendmail when you explicitly instruct it to do so"
That's about as simple as anything can get: one import, set up a few
config variables, one function call and your mail gets sent. It's far
easier than adding sendmail as a dep.
Or look at it this way: You need python to run portage, therefore you
already have basic mail sending capabilities already built-in. So use 'em
--
Alan McKinnon
alan.mckinnon@gmail.com
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] Tell cron to send email using sender:passwd@host:587 syntax?
2013-11-16 20:03 ` Tanstaafl
2013-11-16 20:25 ` Manuel McLure
@ 2013-11-16 23:14 ` Neil Bothwick
2013-11-17 9:00 ` Peter Humphrey
2 siblings, 0 replies; 17+ messages in thread
From: Neil Bothwick @ 2013-11-16 23:14 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 486 bytes --]
On Sat, 16 Nov 2013 15:03:57 -0500, Tanstaafl wrote:
> My real question is, why can portage do this (send emails without a
> local MTA installed)?
I already answered that, it uses Python's smtlib (or something equivalent,
I haven't checked). That's a core Python library and since portage
depends on Python it can be sure the library is available, which isn't
necessarily true of an MTA.
--
Neil Bothwick
3 things happen as you age: 1) Your memory goes; 2) uh..um
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] Tell cron to send email using sender:passwd@host:587 syntax?
2013-11-16 20:03 ` Tanstaafl
2013-11-16 20:25 ` Manuel McLure
2013-11-16 23:14 ` Neil Bothwick
@ 2013-11-17 9:00 ` Peter Humphrey
2 siblings, 0 replies; 17+ messages in thread
From: Peter Humphrey @ 2013-11-17 9:00 UTC (permalink / raw
To: gentoo-user
On Saturday 16 Nov 2013 15:03:57 Tanstaafl wrote:
> My real question is, why can portage do this (send emails without a
> local MTA installed)?
Portage needs to depend on as few other packages as possible. If it required
an MTA on a new system, all sorts of dependency loops and other problems would
ensue in some cases.
--
Regards,
Peter
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] Tell cron to send email using sender:passwd@host:587 syntax?
2013-11-16 20:25 ` Manuel McLure
@ 2013-11-17 11:42 ` Tanstaafl
2013-11-17 11:45 ` Tanstaafl
0 siblings, 1 reply; 17+ messages in thread
From: Tanstaafl @ 2013-11-17 11:42 UTC (permalink / raw
To: gentoo-user
On 2013-11-16 3:25 PM, Manuel McLure <manuel@mclure.org> wrote:
>> Why did the gentoo devs decide to build an smtp client into it
>> capable of doing TLS, instead of simply requiring an MTA to be able
>> to email emerge logs?
> They didn't. The smtp client is part of Python, not part of portage. If
> you're developing in Python, you just call Python's mail API and let
> Python take care of the mail, instead of calling the local MTA. Easier
> and faster development.
>
> Cron is written in C where you don't get mail functionality for free so
> it's easier to use the local MTA.
Ah, ok, thanks... I missed the significance of Alans reference to python
earlier...
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [gentoo-user] Tell cron to send email using sender:passwd@host:587 syntax?
2013-11-17 11:42 ` Tanstaafl
@ 2013-11-17 11:45 ` Tanstaafl
0 siblings, 0 replies; 17+ messages in thread
From: Tanstaafl @ 2013-11-17 11:45 UTC (permalink / raw
To: gentoo-user
On 2013-11-17 6:42 AM, Tanstaafl <tanstaafl@libertytrek.org> wrote:
> I missed the significance of Alans reference to python earlier...
Sorry, that was Neil's reference...
^ permalink raw reply [flat|nested] 17+ messages in thread
* [gentoo-user] Re: Tell cron to send email using sender:passwd <at> host:587 syntax?
2013-11-16 17:42 ` Tanstaafl
2013-11-16 21:24 ` Alan McKinnon
@ 2013-11-18 13:45 ` James
1 sibling, 0 replies; 17+ messages in thread
From: James @ 2013-11-18 13:45 UTC (permalink / raw
To: gentoo-user
Tanstaafl <tanstaafl <at> libertytrek.org> writes:
> On 2013-11-16 12:32 PM, Neil Bothwick <neil <at> digimed.co.uk> wrote:
> > sendmail sends mail.
> And apparently so does portage...
> So, anyone care to venture a guess as to why the gentoo devs decided to
> implement their own smtp server just so portage could send emails all by
> itself, rather than requiring the installation of an MTA?
Not sure about this answer, but the simpler question is does any other
"enhanced" cron equivalents allow configuration that might suit you?
Here are but a few that *may*....:
vixie-cron, dcron, porticron......
just a thought,
hth,
James
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2013-11-18 13:46 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-16 14:05 [gentoo-user] Tell cron to send email using sender:passwd@host:587 syntax? Tanstaafl
2013-11-16 14:13 ` Tanstaafl
2013-11-16 14:56 ` Neil Bothwick
2013-11-16 14:59 ` Tanstaafl
2013-11-16 15:04 ` Neil Bothwick
2013-11-16 15:17 ` Tanstaafl
2013-11-16 17:32 ` Neil Bothwick
2013-11-16 17:42 ` Tanstaafl
2013-11-16 21:24 ` Alan McKinnon
2013-11-18 13:45 ` [gentoo-user] Re: Tell cron to send email using sender:passwd <at> host:587 syntax? James
2013-11-16 19:29 ` [gentoo-user] Tell cron to send email using sender:passwd@host:587 syntax? Benjamin Lee
2013-11-16 20:03 ` Tanstaafl
2013-11-16 20:25 ` Manuel McLure
2013-11-17 11:42 ` Tanstaafl
2013-11-17 11:45 ` Tanstaafl
2013-11-16 23:14 ` Neil Bothwick
2013-11-17 9:00 ` Peter Humphrey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox