-
Notifications
You must be signed in to change notification settings - Fork 0
/
sender
executable file
·87 lines (69 loc) · 2.17 KB
/
sender
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/bash
login='sender'
password='test'
url_ka_log='http://host/staffapi/index.php?/Core/Default/Login'
url_ka_send='http://host/staffapi/index.php?/Tickets/Push/Index'
url_ka_logout='http://host/staffapi/index.php?/Core/Default/Logout'
tmp_path='./.temp'
cookie_file='cookies-kayako'
to='kidom@rootfest.net'
subject='Subject ticket'
sign='
Regards,.
Sender
--------------------
Our Facebook page: facebook.com/unihost
Our Twitter page: twitter.com/unihost
-------------------------------------------
Abuse Department Unihost.com
email: abuses@unihost.com'
message='Message'$sign
sender='unihost.com - Sender'
department='4'
owner='3'
staffid='3'
sesid=`wget --post-data "username=$login&password=$password" --save-cookies $tmp_path/$cookie_file --keep-session-cookies $url_ka_log --no-check-certificate --content-disposition -qO - | gzip -d | sed -n 's/.*<sessionid><\!\[CDATA\[\(.*\)\]\]><\/sessionid>.*/\1/p'`
pay="<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<kayako_staffapi>
<create staffapiid=\"0\">
<subject>$subject</subject>
<fullname>$sender</fullname>
<email>$to</email>
<!-- Begin Ticket Properties -->
<departmentid>$department</departmentid>
<ticketstatusid>1</ticketstatusid>
<ticketpriorityid>1</ticketpriorityid>
<tickettypeid>1</tickettypeid>
<ownerstaffid>$owner</ownerstaffid>
<emailqueueid>0</emailqueueid>
<!-- Begin Creator Info -->
<creator>staff</creator>
<userid>0</userid>
<staffid>$staffid</staffid>
<!-- Begin Other Info -->
<type>default</type>
<phonenumber></phonenumber>
<sendautoresponder>0</sendautoresponder>
<flagtype>0</flagtype>
<!-- Tags -->
<tags></tags>
<tags></tags>
<!-- Recipients -->
<ccto></ccto>
<bccto></bccto>
<!-- Due Timestamps -->
<resolutiondue></resolutiondue>
<replydue></replydue>
<reply>
<contents>$message</contents>
</reply>
<watch>0</watch>
<note type=\"ticket\" notecolor=\"4\">
Почта клиента: $to
Сервер:.
Аккаунт:.
</note>
</create>
</kayako_staffapi>"
wget --post-data="payload=$pay" --load-cookies $tmp_path/$cookie_file $url_ka_send"&sessionid=$sesid" --content-disposition -qO - | > /dev/null
wget --load-cookies $tmp_path/$cookie_file $url_ka_logout --content-disposition -qO - | > /dev/null