how do i use the SMTP returner

696 views
Skip to first unread message

pille

unread,
Jul 7, 2013, 7:49:48 AM7/7/13
to salt-...@googlegroups.com
hi,

i tried to configure the SMTP returner
in /etc/salt/minion.d/return_smtp.conf,
but the log shows:
The return failed for job 20130707112945197326 'return_smtp.returner'

regardless of what i configure.

anyone uses this returner and can post its config (without password ;)

cheers
pille

Emile `iMil' Heitor

unread,
Jul 7, 2013, 8:00:47 AM7/7/13
to salt-...@googlegroups.com

Hi,

> i tried to configure the SMTP returner
> in /etc/salt/minion.d/return_smtp.conf,

Configure the SMTP returner in pillars, for example:
$ cat pillar/conf.sls
smtp.from: salt+{{ grains['host'] }}@bar.com
smtp.to: f...@bar.com
smtp.host: smtp.bar.com
smtp.subject: Result for minion {{ grains['host'] }}

HTH

------------------------------------------------------------------
Emile `iMil' Heitor .�. <imil@{home.imil.net,NetBSD.org,gcu.info}>
_
| http://imil.net | ASCII ribbon campaign ( )
| http://www.NetBSD.org | - against HTML email X
| http://gcu.info | & vCards / \

pille

unread,
Jul 7, 2013, 8:29:57 AM7/7/13
to salt-...@googlegroups.com
> Configure the SMTP returner in pillars, for example:

thanks for the pillar hint. unfortunately this doesn't work, too.
while i can retrieve the correct data from pillar, i cannot observe a
connection to smtp port.

pille

Joseph Hall

unread,
Jul 7, 2013, 11:38:40 AM7/7/13
to salt-...@googlegroups.com
I have successfully used this configuration in the past:

smtp.from: 'perl...@gmail.com'
smtp.to: perl...@gmail.com; jph...@saltstack.com
smtp.host: smtp.gmail.com
smtp.username: 'perl...@gmail.com'
smtp.password: <redacted>
smtp.tls: True
smtp.subject: 'Salt'
smtp.fields: id,fun
> --
> You received this message because you are subscribed to the Google Groups "Salt-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
"In order to create, you have to have the willingness, the desire to
be challenged, to be learning." -- Ferran Adria (speaking at Harvard,
2011)

pille

unread,
Jul 7, 2013, 12:33:55 PM7/7/13
to salt-...@googlegroups.com
argh! this one is driving me crazy...

On 07/07/2013 05:38 PM, Joseph Hall wrote:
> I have successfully used this configuration in the past:

i literally took your config, placed it into my pillar and ran tcpdump
while calling:
salt 's*' test.ping --return return_smtp
again: failure in the logs and nothing mail-relevant in tcpdump

pillar.data returns your settings like expected.

i'm lost
pille

Joseph Hall

unread,
Jul 7, 2013, 12:57:14 PM7/7/13
to salt-...@googlegroups.com
It's a really, really basic module, so something else is probably in
play here (though I still wouldn't rule out something wrong with the
module itself).

Are you able to use any of the other returners? Can you manually
telnet from the minion to the SMTP port on the remote server?

pille

unread,
Jul 7, 2013, 1:07:27 PM7/7/13
to salt-...@googlegroups.com
> Are you able to use any of the other returners?

i tried the syslog-returner and it fails, too.
can someone verify this in 0.16.0 on ubuntu-10.04? (are extra packages
needed?)
then i would file a ticket.

> Can you manually
> telnet from the minion to the SMTP port on the remote server?

yes, i've tested that.
according to the tcpdump it fails before doing anything mail-related.

cheers
pille

Joseph Hall

unread,
Jul 7, 2013, 1:23:46 PM7/7/13
to salt-...@googlegroups.com

It uses smtplib, which I believe is a Python built-in.

I would go ahead and file an issue. I'd rather you file something that ends up being a false positive, than not file an issue that ends up being significant.

pille

unread,
Jul 7, 2013, 1:54:19 PM7/7/13
to salt-...@googlegroups.com
filed https://github.com/saltstack/salt/issues/6009.

got syslog-returner working, by using
--return syslog
instead of
--return return_syslog

unfortunately this doesn't work with smtp :(
better error-messages for non-existing stuff would be welcome ;)

pille
Reply all
Reply to author
Forward
0 new messages