Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - TheLatestWire

#31
No worries Franco, no rush either.   :)  I have created a second alias that I'm adding networks to for now since I've reached the limit on the first.  In the end though, it would be nice to be able to have a single alias with all the entries in it rather than multiple aliases.  Just to keep things simple, one alias and one firewall rule would be preferred over multiple aliases and multiple rules for the same goal.
#32
It doesn't show a PHP error when it fails but I do see one in the Lobby/Dashboard where it says "A problem was detected", and says it can be fixed by increasing the max_input_vars variable.

[09-Jun-2016 13:36:10 America/Chicago] PHP Warning:  Unknown: Input variables exceeded 5000. To increase the limit change max_input_vars in php.ini. in Unknown on line 0

I changed max_input_vars from 5000 to 9000 in /usr/local/etc/rc.php_ini_setup and then ran /usr/local/etc/rc.restart_webgui and then verified the new 9000 setting showed in /usr/local/etc/php.ini and it did, but that didn't fix the problem.  I thought 9000 should be high enough to resolve it but maybe I'm wrong.
#33
That was my first thought too but I also tried it with Chrome, thinking it was a browser issue, but the same thing happened.  Hopefully Franco sees this as he was able to resolve it last time.  So much time has passed since that patch that I don't want to try to apply it now for fear of breaking it worse.
#34
Thanks Bill, looks to be the same issue.  I futz with the column settings and the widgets re-appeared.  It doesn't quite look like it used to in the two column view but that's fine with me and one column shows the info I was expecting to see.

Sorry I didn't see that thread but I guess I was just looking in the "General Discussion" forum.  I'll have to broaden my horizons to include the other forums as well.

Cheers,
Obecalpeffect.
#35
Is it just me, or is anyone else seeing an empty Lobby/Dashboard after the most recent updates?  I updated one system and the lobby is empty but glancing at another system without the most recent updates installed shows the normal lobby stuff like System Information, Gateways, Interface List, Service Status, etc...
#36
bump?
#37
Hi Bart,

Sorry to be a pain, but I noticed that the latest version of the script still isn't working with SMTP on my OpenBSD server.  SMTP on OpenBSD still complains "Message is not RFC 2822 compliant".

I was however able to get it working by replacing this line:
message += formatdate(localtime=True) + '\r\n'

With this line:
message += 'Date: = formatdate(localtime=True)'

*Please also note that it doesn't work when the line is appended with + '\r\n'

Thanks,
Obecalp.
#38
Hi - I previously encountered an issue that prevented me from adding new networks to an alias that was a very long list of CIDR networks (~2500).  Franco created a patch that fixed the issue, but now it seems to have returned.

To reproduce the issue, I click on "Firewall/Aliases/View" and then click to edit one of my aliases which is a long list of CIDR networks.  I scroll all the way to the bottom of the list and add the new CIDR network, then click "Save".  When it was working, it would then return me to the list of Aliases with a "Click to Apply" button, but now it just returns me to the same Alias that I added a new entry to with the "Save/Cancel" button at the bottom of the page.

Is it possible to edit/add to aliases from the shell?  Maybe I could do this as a temporary work around?

Any assistance would be greatly appreciated.
Thanks.

#39
Hmm, not sure if I'm dreaming this or not, but I think I fixed it with the addition of these three lines in the script:

from email.Utils import formatdate
and
dateheader = 'formatdate(localtime = 6)\r\n'
and
message += '\r\ndateheader\r\n

So the entire top section of the script now looks like this (and it actually worked!  :)   )

#!/usr/local/bin/python
# import libraries
import json
import requests
import smtplib
from email.Utils import formatdate
api_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
api_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
host       = 'localhost'
recipients = 'me@there.edu'
rcpt_name  = 'First Last'
dateheader = 'formatdate(localtime = 6)\r\n'
url      = 'https://' + host + '/api/core/firmware/status'
sender   = 'emailrelay@there.edu'
message  = 'From: emailrelay@there.edu\r\n'
message += 'To: me@there.edu>\r\n'
message += 'MIME-Version: 1.0\r\n'
message += 'Content-type: text/html\r\n'
message += 'Subject: Updates Available for OPNsense\r\n'
message += '\r\ndateheader\r\n'
# request and process data

#40
I wish I could help, but I couldn't program my way out of a wet paper bag.   :-\

That said though, I was playing with getting a properly formatted date string with python while trying to get the script working and I think this would suffice and possibly be RFC 2822 compliant.  I hope it's helpful.  I'll try to poke through the smtplib docs too and see if I can find a way to add the date header.  Hopefully it is the date header that is causing OpenBSD's SMTP daemon to complain about RFC 2822 compliancy and we're not chasing our tails here.

#!/usr/local/bin/python
# import libraries
from email.Utils import formatdate
print formatdate(localtime = 6)

#41
This might be helpful.  On the network where I'm able to use the script without the RFC 2822 compliant (it relays through a Linux Postfix system, not an OpenBSD SMTP server), I noticed this in my Amavis quarantine this morning even though the email from the script was delivered:

X-Amavis-Alert: BAD HEADER SECTION, Missing required header field: "Date"

Could a missing Date header field be what's upsetting the SMTP daemon on the OpenBSD SMTP server who refuses to accept the email from the script due to the RFC 2822 compliant?

Just a thought.

Thanks,
ObecalpEffect.
#42
I tried using 'text/plain' instead of 'text/html', replacing all \n entries with \r\n and also tried remarking out both of these lines:
#message += 'MIME-Version: 1.0\n'
#message += 'Content-type: text/html\n'

but the script still comes back with "smtplib.SMTPDataError: (550, '5.7.1 Delivery not authorized, message refused: Message is not RFC 2822 compliant')"
#43
Sorry for the stupid question, but what is IMF?  I'm just coming up with "International Monetary Fund" but I'm sure that's not what you mean.  ;)
#44
I'm able to send a test email using this python script from the OPNsense server via the same OpenBSD mail server that is returning the "not RFC 2822 compliant" message for the fw_update-1.1.py script.

#!/usr/bin/python
import smtplib
sender = 'myname@mydomain'
receivers = ['myname@mydomain]
message = """From: From OPNsense <myname@mydomain>
To: To Person <myname@mydomain>
Subject: SMTP e-mail test
This is a test e-mail message.
"""
try:
   smtpObj = smtplib.SMTP('192.168.2.2')
   smtpObj.sendmail(sender, receivers, message)
   print "Successfully sent email"
   except SMTPException:
   print "Error: unable to send email"


Thanks.
#45
I'm using this script on another deployment of OPNsense in an environment where I only have an OpenBSD server to use for the SMTP service of this script and I'm not able to send the script's email using that server.  I get this error:

Traceback (most recent call last):
  File "fw_update-1.1.py", line 58, in <module>
    s.sendmail(sender,recipients,message)
  File "/usr/local/lib/python2.7/smtplib.py", line 746, in sendmail
    raise SMTPDataError(code, resp)
smtplib.SMTPDataError: (550, '5.7.1 Delivery not authorized, message refused: Message is not RFC 2822 compliant')

Is anyone able to use an OpenBSD mail server to deliver this script without this error by chance?

This is what it looks like from the OpenBSD smtp server side:

<<< [MSG] <br>Click <a href="https://192.168.2.1/ui/core/firmware/">here</a> to fetch them.<br>
debug: 0x18f9f6123000: end of message, msgflags=0x8000
smtp: 0x18f9f6123000: >>> 550 5.7.1 Delivery not authorized, message refused: Message is not RFC 2822 compliant
smtp-in: Failed command on session 48cc59eadf55d2f9: "data" => 550 5.7.1 Delivery not authorized, message refused: Message is not RFC 2822 compliant
smtp: 0x18f9f6123000: STATE_BODY -> STATE_HELO
smtp: 0x18f9f6123000: <<< rset
smtp: 0x18f9f6123000: >>> 250 2.0.0: Reset state
smtp-in: Received disconnect from session 48cc59eadf55d2f9
debug: smtp: 0x18f9f6123000: deleting session: disconnecte

Thanks.