www.zeroshell.org Forum Index www.zeroshell.org
Linux Distribution for server and embedded devices
 
 SearchSearch  RegisterRegister  UsergroupsUsergroups 
 ProfileProfile  Log inLog in  Log in to check your private messagesPrivate Message 

Cannot get the (monitoring) message spooler to send emails

 
Post new topic   Reply to topic    www.zeroshell.org Forum Index -> Signal a BUG
View previous topic :: View next topic  
Author Message
PatrickB



Joined: 03 Nov 2012
Posts: 46

PostPosted: Sat Sep 30, 2017 4:09 pm    Post subject: Cannot get the (monitoring) message spooler to send emails Reply with quote

Hello.

To make simple, the alert messages exist, they are listed in the log and said to be queued, but no email is sent unless the spooler is restarted (or the device rebooted).

The email config is correct: the test feature sends one, and the whole queue is sent at restart.

Waiting for >1 day or changing the "message max age" seems to have no effect. There is no evidence of a sending error anywhere.
It just looks like periodic sending of queued messages is not scheduled at all.

Context: Alix 2D13, ZS v.3.7.1, simple local mail server on another device of my LAN, no SSL, available all time, SMS alerts disabled, only email enabled.

Did someone else experience that ? Any idea of where to dig ?

Thanks, Best regards.
Back to top
View user's profile Send private message
iulyb



Joined: 02 Jun 2016
Posts: 92

PostPosted: Sun Oct 15, 2017 3:51 pm    Post subject: Reply with quote

Hi
This is kind of old.. but any way.
I had the same hardware before and worked out of the box with gmail
smtp : smtp.gmail.com
security: starttls
port: 587

What to look for:
Code:
root@zs scripts> grep -r smtp ./
./sendmail:smtp-cli --subject="$SUBJECT" --from="$SMTPSENDER" --to="$RECIPIENT" --server="$SMTPSERVER" --port="$SMTPPORT" $SECURITYSTRING $AUTHSTRING --body-plain=$BODY
./alerts_start:  echo smtp.gmail.com > $CONFIG/EMAIL/SMTPServer
root@zs scripts> smtp-cli --version
smtp-cli version 3.6
root@zs scripts> man smtp-cli
No manual entry for smtp-cli


Seem that you need to google for smtp-cli.

On the other hand I would suspect some firewall or route issue.
Try to telnet from your zs to local server.
https://www.port25.com/how-to-check-an-smtp-connection-with-a-manual-telnet-session-2/
Back to top
View user's profile Send private message
PatrickB



Joined: 03 Nov 2012
Posts: 46

PostPosted: Sun Oct 15, 2017 5:16 pm    Post subject: The smtp works, the problem is with the spooler Reply with quote

Thanks but...

As I explained, the sending of spooled messages works fine when restarting the spooler (at reboot notably).

The problem is that the same spooled messages are never sent before.

Actually there is nothing related in the crontab. I had a look at crontabgen and commented the removal of /tmp/crontab: there is code to generate the events what means spool them, OK this part works...

Then I'm looking for clues about how the spooler is made and how to make it flush periodically.

Thanks, Best regards.
Back to top
View user's profile Send private message
iulyb



Joined: 02 Jun 2016
Posts: 92

PostPosted: Mon Oct 16, 2017 12:13 am    Post subject: Re: The smtp works, the problem is with the spooler Reply with quote

You said on reboot. Everything restarts on reboot and order is important. You can get them sent because there is not a firewall that comes later.

kerbinet script runs in a continuous loop sa no need for crontab. All relevant script are done in that way. I am not sure but this is what I noticed.

Also try to isolate.. so first send an email using telnet if ok then using smtp-cli
Also you didn't specify if you server is internal or external so try to telnet and smtp-cli on both..
If everything works then there is something else in scripts. Scripts are on /root/kerbynet/scripts
Back to top
View user's profile Send private message
PatrickB



Joined: 03 Nov 2012
Posts: 46

PostPosted: Mon Oct 16, 2017 7:02 pm    Post subject: spooler issue... Reply with quote

I can get the messages currently spooled all sent without rebooting, for instance by changing the parameter "max age" of the monitoring and saving. Doing so must restart the spooler service specifically.

The SMTP used is running full-time on another machine on the LAN, using no SSL, and actually, as I said, it works fine when the spooler wants so flush its queue. Also with the test message feature.

Since all is on LAN side there is no firewall restriction between the ZS and the SMTP. Be sure that I did test all of that. Else it would never work.

The issue is the spooler queueing definitively until it is restarted, this is why I'd like to find how the spooler works and what makes it flush its queue.

If I understand you well, the spooler would be made of a infinite sleep-and-do loop in a script ? Why not... In this case it means that the criterion to enter the message sending clause is never met.

OK I will try to locate such a script within the others.

Thanks, Best regards.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    www.zeroshell.org Forum Index -> Signal a BUG All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group