Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
ncpython
/
srvcnf2
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 02293d69
authored
Jan 17, 2018
by
netz.coop
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v0.1.7 Posttools Monitoring
1 parent
fc9b01f2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
16 deletions
CHANGELOG
web/mailsrv/mailcnf_posttools.py
web/static/style.css
web/templates/content_mailcnf_posttools.html
CHANGELOG
View file @
02293d6
2018-01-17 v0.1.7 Posttools Monitoring
2018-01-16 v0.1.6 Posttools Fix
2018-01-16 v0.1.6 Posttools Fix
2018-01-16 v0.1.5 Posttools
2018-01-16 v0.1.5 Posttools
2018-01-16 v0.1.4 startscript kill
2018-01-16 v0.1.4 startscript kill
...
...
web/mailsrv/mailcnf_posttools.py
View file @
02293d6
...
@@ -41,12 +41,17 @@ class mailcnf_posttools(ncauth_base):
...
@@ -41,12 +41,17 @@ class mailcnf_posttools(ncauth_base):
if
action
==
'postersuper1'
:
if
action
==
'postersuper1'
:
msg
=
self
.
postsuperdel
(
id
,
mailname
)
msg
=
self
.
postsuperdel
(
id
,
mailname
)
msglvl
=
"alert-info"
msglvl
=
"alert-info"
if
action
==
'postersupersend1'
:
msg
=
self
.
postersupersend1
(
id
,
mailname
)
msglvl
=
"alert-info"
loader
=
tornado
.
template
.
Loader
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"../templates"
))
loader
=
tornado
.
template
.
Loader
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"../templates"
))
navigation
=
loader
.
load
(
"navigation.html"
)
.
generate
(
nav
=
nav
)
navigation
=
loader
.
load
(
"navigation.html"
)
.
generate
(
nav
=
nav
)
subnavigation
=
loader
.
load
(
"subnav_"
+
module
+
"_"
+
mainfnc
+
".html"
)
.
generate
(
subnav
=
subnav
)
subnavigation
=
loader
.
load
(
"subnav_"
+
module
+
"_"
+
mainfnc
+
".html"
)
.
generate
(
subnav
=
subnav
)
mailstuff
=
self
.
mailcheck
()
mailstuff
=
self
.
mailcheck
()
mailstufflist
=
self
.
mailchecktuple
()
mailstufflist
=
self
.
mailchecktuple
()
maincontent
=
loader
.
load
(
"content_"
+
module
+
"_"
+
mainfnc
+
".html"
)
.
generate
(
mailstuff
=
mailstuff
,
mailstufflist
=
mailstufflist
)
number
=
10
checklogin
=
self
.
checklogin
(
number
)
maincontent
=
loader
.
load
(
"content_"
+
module
+
"_"
+
mainfnc
+
".html"
)
.
generate
(
mailstuff
=
mailstuff
,
mailstufflist
=
mailstufflist
,
checklogin
=
checklogin
)
self
.
render
(
'base.html'
,
navigation
=
navigation
,
subnavigation
=
subnavigation
,
maincontent
=
maincontent
,
msg
=
msg
,
msglvl
=
msglvl
)
self
.
render
(
'base.html'
,
navigation
=
navigation
,
subnavigation
=
subnavigation
,
maincontent
=
maincontent
,
msg
=
msg
,
msglvl
=
msglvl
)
...
@@ -84,9 +89,30 @@ class mailcnf_posttools(ncauth_base):
...
@@ -84,9 +89,30 @@ class mailcnf_posttools(ncauth_base):
return
dict
return
dict
def
postsuperdel
(
self
,
id
,
mailname
=
''
):
def
postsuperdel
(
self
,
id
,
mailname
=
''
):
self
.
write
(
"postsuper -d "
+
str
(
id
)
+
" "
)
#
self.write("postsuper -d "+str(id)+" " )
old_dir
=
os
.
getcwd
()
old_dir
=
os
.
getcwd
()
os
.
chdir
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
""
)
)
os
.
chdir
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
""
)
)
os
.
chdir
(
'..'
)
os
.
chdir
(
'..'
)
p1
=
str
(
Popen
(
"/usr/sbin/postsuper -d "
+
str
(
id
)
,
stdout
=
PIPE
,
shell
=
True
)
.
communicate
()[
0
])
p1
=
str
(
Popen
(
"/usr/sbin/postsuper -d "
+
str
(
id
)
,
stdout
=
PIPE
,
shell
=
True
)
.
communicate
()[
0
])
return
"Nachricht "
+
str
(
id
)
+
" von "
+
str
(
mailname
)
+
" gelöscht"
return
"Nachricht "
+
str
(
id
)
+
" von "
+
str
(
mailname
)
+
" gelöscht"
\ No newline at end of file
def
postersupersend1
(
self
,
id
,
mailname
=
''
):
#self.write("postsuper -d "+str(id)+" " )
old_dir
=
os
.
getcwd
()
os
.
chdir
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
""
)
)
os
.
chdir
(
'..'
)
p1
=
str
(
Popen
(
"/usr/sbin/postqueue -i "
+
str
(
id
)
,
stdout
=
PIPE
,
shell
=
True
)
.
communicate
()[
0
])
return
"Nachricht "
+
str
(
id
)
+
" von "
+
str
(
mailname
)
+
" wird erneut versucht zu senden"
def
checklogin
(
self
,
number
):
#self.write("postsuper -d "+str(id)+" " )
old_dir
=
os
.
getcwd
()
os
.
chdir
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
""
)
)
os
.
chdir
(
'..'
)
p1
=
str
(
Popen
(
"grep sasl_username /var/log/mail.log |awk {'print $NF'}|sort| uniq -c|sort -n| awk '$1 > "
+
str
(
number
)
+
" { print $1
\"
\"
$2 }' "
,
stdout
=
PIPE
,
shell
=
True
)
.
communicate
()[
0
])
thatLine
=
p1
.
replace
(
'
\\
n'
,
'<br>'
)
thatLine
=
thatLine
.
replace
(
'b
\'
'
,
'<br>'
)
thatLine
=
thatLine
.
replace
(
'
\'
'
,
''
)
return
thatLine
\ No newline at end of file
web/static/style.css
100755 → 100644
View file @
02293d6
...
@@ -224,9 +224,25 @@ margin:6px;
...
@@ -224,9 +224,25 @@ margin:6px;
padding-left
:
15px
;
padding-left
:
15px
;
width
:
100%
;
width
:
100%
;
}
}
/*input[value="Edit"]{
color:red;
.mailbutton1
,
.mailbutton2
}*/
{
*/
width
:
45%
;
margin
:
5px
;
}
.mailbutton1
{
float
:
left
;
}
.mailbutton2
{
float
:
right
;
}
.mailbuttoncontainer
{
height
:
25px
;
}
\ No newline at end of file
web/templates/content_mailcnf_posttools.html
View file @
02293d6
...
@@ -8,10 +8,12 @@
...
@@ -8,10 +8,12 @@
<br>
<br>
<br>
<br>
<div
class=
"alert-info"
style=
"alert"
>
Aktionen postsuper -d $ID
</div>
<div
class=
"alert-info"
style=
"alert"
>
Aktionen postsuper -d $ID
/ postqueue -i $ID
</div>
<br>
<br>
{% for entry in mailstufflist %}
{% for entry in mailstufflist %}
<div>
<div
class=
"mailbuttoncontainer"
>
<div
class=
"mailbutton1"
>
<form
action=
"/mailcnf/posttools"
method=
"POST"
>
<form
action=
"/mailcnf/posttools"
method=
"POST"
>
<input
type=
"hidden"
size=
"70"
name=
"fnc"
value=
"mailcnf"
>
<input
type=
"hidden"
size=
"70"
name=
"fnc"
value=
"mailcnf"
>
<input
type=
"hidden"
value=
"posttools"
size=
"70"
name=
"mainfnc"
class=
"'"
>
<input
type=
"hidden"
value=
"posttools"
size=
"70"
name=
"mainfnc"
class=
"'"
>
...
@@ -19,13 +21,32 @@
...
@@ -19,13 +21,32 @@
<input
type=
"hidden"
value=
"postersuper1"
size=
"70"
name=
"action"
class=
"'"
>
<input
type=
"hidden"
value=
"postersuper1"
size=
"70"
name=
"action"
class=
"'"
>
<input
type=
"hidden"
value=
"{% raw entry[0] %}"
size=
"70"
name=
"id"
class=
"'"
>
<input
type=
"hidden"
value=
"{% raw entry[0] %}"
size=
"70"
name=
"id"
class=
"'"
>
<input
type=
"hidden"
value=
"{% raw entry[1] %}"
size=
"70"
name=
"mailname"
class=
"'"
>
<input
type=
"hidden"
value=
"{% raw entry[1] %}"
size=
"70"
name=
"mailname"
class=
"'"
>
<button
type=
"submit"
class=
"btn btn-info btn-block btn-xs"
>
Lösche {% raw entry[0] %} {% raw entry[1] %}
</button>
<button
type=
"submit"
class=
"btn btn-danger btn-block btn-xs"
>
Lösche {% raw entry[0] %} {% raw entry[1] %}
</button>
</form>
</div><div
class=
"mailbutton2"
>
<form
action=
"/mailcnf/posttools"
method=
"POST"
>
<input
type=
"hidden"
size=
"70"
name=
"fnc"
value=
"mailcnf"
>
<input
type=
"hidden"
value=
"posttools"
size=
"70"
name=
"mainfnc"
class=
"'"
>
<input
type=
"hidden"
value=
"about"
size=
"70"
name=
"module"
class=
"'"
>
<input
type=
"hidden"
value=
"postersupersend1"
size=
"70"
name=
"action"
class=
"'"
>
<input
type=
"hidden"
value=
"{% raw entry[0] %}"
size=
"70"
name=
"id"
class=
"'"
>
<input
type=
"hidden"
value=
"{% raw entry[1] %}"
size=
"70"
name=
"mailname"
class=
"'"
>
<button
type=
"submit"
class=
"btn btn-info btn-block btn-xs"
>
Versuche zu senden {% raw entry[0] %} {% raw entry[1] %}
</button>
</form>
</form>
</div>
</div>
<br>
</div>
<br>
{% end %}
{% end %}
<br><br>
<br><br>
<div
class=
"alert-info"
style=
"alert"
>
häufigste Anmeldungen
</div>
<br>
<div>
{% raw checklogin %}
</div>
<br><br>
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment