OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • Zenarmor (Sensei) »
  • Zemarmor Scheduled Reports Email Not Working
« previous next »
  • Print
Pages: [1]

Author Topic: Zemarmor Scheduled Reports Email Not Working  (Read 2680 times)

Meg

  • Newbie
  • *
  • Posts: 30
  • Karma: 1
    • View Profile
Zemarmor Scheduled Reports Email Not Working
« on: February 04, 2024, 08:27:32 pm »
Hello: I have been trying to get zenarmor email working with several different smtp servers. With gmail and outlook I get SMTP AUTH extension not supported by server. When I set up using smtp.eastlink.ca I don't get any errors with , but no email sends. I am currently on zenarmor 1.16.2. I have seen many posts online about this dating back a couple of years. Does anybody have a solution to get reports email working without using zenconsole?

Do I need to have a paid account for scheduled reports email to work?
« Last Edit: February 06, 2024, 05:14:43 am by Meg »
Logged

sy

  • Hero Member
  • *****
  • Posts: 597
  • Karma: 44
    • View Profile
Re: Zemarmor Scheduled Reports Email Not Working
« Reply #1 on: February 11, 2024, 10:17:51 pm »
Hello,

Actually not. Gmail and Hotmail doesn't allow to third party apps to send email for free users. But you could be able to use your own server. Can you share /usr/local/opnsense/scripts/OPNsense/Zenarmor/report-gen/send.sh command output?





Logged

Meg

  • Newbie
  • *
  • Posts: 30
  • Karma: 1
    • View Profile
Re: Zemarmor Scheduled Reports Email Not Working
« Reply #2 on: February 12, 2024, 04:34:31 am »
Thanks for the reply. I ran /usr/local/opnsense/scripts/OPNsense/Zenarmor/report-gen/send.sh, and the output was [: ==: unexpected operator. What does that mean?
Logged

wstemb

  • Newbie
  • *
  • Posts: 32
  • Karma: 1
    • View Profile
Re: Zemarmor Scheduled Reports Email Not Working
« Reply #3 on: February 13, 2024, 11:20:13 am »
Found the same error using the local mail server and investigated it a little:

The script cannot be run just as is in the post, the command must receive arguments from the caller, your error is because of lack of arguments.

usage: send.py [-h] [-b PDF] [-S SERVER] [-R PROVIDER] [-P PORT] [-s SECURED] [-u USERNAME] [-p PASSWORD] [-f SENDER] [-t TO] [-v NOSSLVERIFY]

Bug no  1.: When you use it on plain  SMTP with No security (without userid and password), the switches --userid and --password are still in the command without arguments:

added echo $@ > filename in the script:

--provider smtp-server --pdf false --server a.b.c.d --port 25 --secured true --username --password --sender i@am.here --to you@are.there --nosslverify false

producing a send.py error message:   

end.py: error: argument -u/--username: expected one argument
or
send.py: error: argument -p/--password: expected one argument  - if you put userid and empty password

and the error in GUI: Error (200) There was an issue on our end. Sorry about that.


bug no 2:

If you stay with plain SMTP on port 25, and No security and put some  userid/password data to bypass the bug no.1,  the script send.sh passes valid data to send.py, which wrongly answers with:

{"successful": false, "message": "Smtp :No suitable authentication method found."}

Which authentication methods? -  I am using plain SMTP on port 25, No security! 

What works?


When in CLI I run the script send.sh with all switches, except --userid and --password, the result of the script (send.py called by send.sh) is:

{"successful": true, "message": "Mail has been send successfully!"}

and test mail is sent and received.

Conclusion:
the script send.py has to be rewritten with  better argument parsing:
a) permiting the empty --userid --and password;
b) dropping them as parameters if the Connection security is "No Security".  Now the script wrongly assumes that the existing password in arguments  means login, plain SMTP with No security do not need  login.

I needed the report to work, so I hard-coded a little the script send.py to make it work in the simplest scenario (No security), but I stilll have to check with STARTTLS. 

Where is the PDF check un the GUI?
« Last Edit: February 14, 2024, 10:24:05 am by wstemb »
Logged

Meg

  • Newbie
  • *
  • Posts: 30
  • Karma: 1
    • View Profile
Re: Zemarmor Scheduled Reports Email Not Working
« Reply #4 on: February 13, 2024, 06:45:29 pm »
So I imagine these bugs are something that needs to be fixed by the zenarmor team?
Logged

wstemb

  • Newbie
  • *
  • Posts: 32
  • Karma: 1
    • View Profile
Re: Zemarmor Scheduled Reports Email Not Working
« Reply #5 on: February 13, 2024, 08:25:42 pm »
Yes, the maintain and upgrade process has some rules. 

I changed the script a little (two lines), to make it work just for me in one strict scenario (No security). It is a brute force approach,  my copy will be probably overwritten soon by upgrading Zenarmor.
Logged

Meg

  • Newbie
  • *
  • Posts: 30
  • Karma: 1
    • View Profile
Re: Zemarmor Scheduled Reports Email Not Working
« Reply #6 on: February 13, 2024, 10:07:26 pm »
Have you submitted these bugs yet to have them fixed? It seems these bugs have been there for quit a few versions.
Logged

wstemb

  • Newbie
  • *
  • Posts: 32
  • Karma: 1
    • View Profile
Re: Zemarmor Scheduled Reports Email Not Working
« Reply #7 on: February 14, 2024, 08:35:40 am »
I sent a feedback/bug report following the instructions: https://www.zenarmor.com/docs/support/reporting-bug
Logged

wstemb

  • Newbie
  • *
  • Posts: 32
  • Karma: 1
    • View Profile
Re: Zemarmor Scheduled Reports Email Not Working
« Reply #8 on: February 14, 2024, 09:49:19 am »
DISCLAIMER: what I  write in next rows is not a solution, it is a brute force workaround for just one fixed scenario (SMTP server, No security) if you desperately need  the mail report.

OPNsense 23.7.12_5
Zenarmor 1.16.2

Edit send.py and comment around line 246:

#       if password:
#           smtp.login(username, password)

to avoid bug 2 from previous post.

Then you MUST choose (if/when posible and applicable):
Mail provider: SMTP Server
Mail server hostname: Hostname  or IP of a server without authentication
Connection Security: No Security

Mail server port will change to Port 25

You have to put some dummy data for username and password to avoid the bug 1 from previous post.
« Last Edit: February 14, 2024, 10:09:04 am by wstemb »
Logged

IHK

  • Full Member
  • ***
  • Posts: 108
  • Karma: 5
    • View Profile
Re: Zemarmor Scheduled Reports Email Not Working
« Reply #9 on: February 14, 2024, 04:41:26 pm »
Hi Wstemb,

Thank you for your valuable analysis and feedback. Your feedback has been forwarded to the dev team.
Thank you for your co-operation.
Logged

Meg

  • Newbie
  • *
  • Posts: 30
  • Karma: 1
    • View Profile
Re: Zemarmor Scheduled Reports Email Not Working
« Reply #10 on: May 23, 2024, 10:01:53 pm »
With help from the Zenarmor help desk and long discussion with Eastlink service provider I have discovered that Eastlink mail servers were blocking the emails as they told me that these emails have been reported as spam. Not just for me but many others. They could not whitelist this for me, so to get my reports I had to use a third party smpt forwarding service.
Logged

Tismofied

  • Jr. Member
  • **
  • Posts: 52
  • Karma: 1
  • https://www.waveform.com/tools/bufferbloat?test-id
    • View Profile
Re: Zemarmor Scheduled Reports Email Not Working
« Reply #11 on: November 12, 2024, 10:27:12 pm »
Quote from: IHK on February 14, 2024, 04:41:26 pm
Hi Wstemb,

Thank you for your valuable analysis and feedback. Your feedback has been forwarded to the dev team.
Thank you for your co-operation.

Nothing has been fixed since. Still getting error 200
Code: [Select]
Connection Error
There was an issue on our end. Sorry about that.

Zenarmor 1.18.2
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • Zenarmor (Sensei) »
  • Zemarmor Scheduled Reports Email Not Working
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2