Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ansible-tools-zmsupport
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
David Gatica
ansible-tools-zmsupport
Commits
370cb4ba
Commit
370cb4ba
authored
Jan 08, 2018
by
David Gatica
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
first commit
parents
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
142 additions
and
0 deletions
+142
-0
createScriptToMarkHowNotSpam.sh
files/createScriptToMarkHowNotSpam.sh
+17
-0
createScriptToMarkHowSpam.sh
files/createScriptToMarkHowSpam.sh
+17
-0
executeScriptOnTheMailboxes.sh
files/executeScriptOnTheMailboxes.sh
+9
-0
inventory
inventory
+3
-0
playbook.yml
tasks/playbook.yml
+96
-0
No files found.
files/createScriptToMarkHowNotSpam.sh
0 → 100644
View file @
370cb4ba
#!/bin/bash
FILE
=
$1
rm
-rf
*
.txt
while
IFS
=
':'
read
AUX zimbraID msgId
;
do
if
[
-f
$zimbraID
.txt
]
then
echo
"ya esta creado
$zimbraID
.txt"
echo
"mms
$msgId
0 /Inbox"
>>
/tmp/resultsSearch/dataParsed/
$zimbraID
.txt
else
touch
/tmp/resultsSearch/filesProv/
$zimbraID
.txt
echo
"mms
$msgId
0 /Inbox"
>>
/tmp/resultsSearch/dataParsed/
$zimbraID
.txt
fi
done
<
$FILE
\ No newline at end of file
files/createScriptToMarkHowSpam.sh
0 → 100644
View file @
370cb4ba
#!/bin/bash
FILE
=
$1
rm
-rf
*
.txt
while
IFS
=
':'
read
AUX zimbraID msgId
;
do
if
[
-f
$zimbraID
.txt
]
then
echo
"ya esta creado
$zimbraID
.txt"
echo
"mms
$msgId
1 /Junk"
>>
/tmp/resultsSearch/dataParsed/
$zimbraID
.txt
else
touch
/tmp/resultsSearch/filesProv/
$zimbraID
.txt
echo
"mms
$msgId
1 /Junk"
>>
/tmp/resultsSearch/dataParsed/
$zimbraID
.txt
fi
done
<
$FILE
\ No newline at end of file
files/executeScriptOnTheMailboxes.sh
0 → 100644
View file @
370cb4ba
#!/bin/bash
files
=
/tmp/resultsSearch/dataParsed/
*
.txt
for
file
in
$files
do
# save the id account
idAccount
=
`
echo
$file
|
sed
-e
's/\/tmp\/resultsSearch\/dataParsed\// /g'
|sed
-e
's/.txt//g'
`
~/bin/zmmailbox
-z
-m
$idAccount
-f
$file
done
inventory
0 → 100644
View file @
370cb4ba
[mailboxHosts]
mailbox-05.zboxapp.com
tasks/playbook.yml
0 → 100644
View file @
370cb4ba
-
hosts
:
mailboxHosts
become
:
yes
become_user
:
zimbra
tasks
:
-
name
:
create file with all domain's accounts
shell
:
rm -rf /tmp '{{domain}}'.txt
shell
:
~/bin/zmprov -l gaa '{{domain}}' > /tmp/'{{domain}}'.txt
tags
:
-
search
-
name
:
create folder for the search's results
shell
:
rm -rf /tmp/resultsSearch
file
:
path=/tmp/resultsSearch state=directory
tags
:
-
search
-
name
:
create folder for save files .txt that whill contain only zimbraID and msgIds by each mailbox
file
:
path=/tmp/resultsSearch/dataParsed state=directory
tags
:
-
search
-
name
:
create script that searches all messages under a criteria on all accounts
shell
:
rm -rf /tmp/zmmboxsearchAll.prov
shell
:
cat /tmp/'{{domain}}'.txt | awk '{print "~/bin/zmmboxsearch -m "$0" -q \"'{{query}}'\" -l 9999999 -p 9999999 > /tmp/resultsSearch/"$0".txt "}' > /tmp/zmmboxsearchAll.prov
tag
:
-
searchDefault
-
name
:
create script that searches all messages under a criteria on all accounts to mark how not spam
shell
:
cat /tmp/'{{domain}}'.txt | awk '{print "~/bin/zmmboxsearch -m "$0" -q \"'{{query}}' in:Junk\" -l 9999999 -p 9999999 > /tmp/resultsSearch/"$0".txt "}' > /tmp/zmmboxsearchAll.prov
tags
:
-
searchOnJunk
-
name
:
change permission to execute script
shell
:
chmod 755 /tmp/zmmboxsearchAll.prov
tags
:
-
search
-
name
:
execute script for search Data
shell
:
/tmp/zmmboxsearchAll.prov
tags
:
-
search
-
name
:
filter only zimbraId and messageId
shell
:
cat /tmp/resultsSearch/*.txt | grep -v "No results found" | grep ^ID | sed -e 's/ //g' > /tmp/resultsSearch/onlyZimbraIDAndMessageId.txt
tags
:
-
search
-
name
:
copy script createScriptToMarkHowNotSpam.sh at server
copy
:
dest=/tmp/resultsSearch/dataParsed src=../files/createScriptToMarkHowNotSpam.sh
tags
:
-
searchOnJunk
-
name
:
copy script createScriptToMarkHowSpam.sh at server
copy
:
dest=/tmp/resultsSearch/dataParsed src=../files/markMessagesHowSpam.sh
tags
:
-
searchDefault
-
name
:
change permission to execute script
shell
:
chmod 755 /tmp/resultsSearch/dataParsed/createScriptToMarkHowNotSpam.sh
tags
:
-
searchOnJunk
-
name
:
change permission to execute script
shell
:
chmod 755 /tmp/resultsSearch/dataParsed/createScriptToMarkHowSpam.sh
tags
:
-
searchDefault
-
name
:
execute script for create files with the commands zmmailbox to mark how not Spam
shell
:
/tmp/resultsSearch/dataParsed/markMessagesHowNotSpam.sh /tmp/resultsSearch/onlyZimbraIDAndMessageId.txt
tags
:
-
searchOnJunk
-
name
:
execute script for create files with the commands zmmailbox to mark how Spam
shell
:
/tmp/resultsSearch/dataParsed/markMessagesHowSpam.sh /tmp/resultsSearch/onlyZimbraIDAndMessageId.txt
tags
:
-
searchDefault
-
name
:
copy script executeScriptOnTheMailboxes.sh at server
copy
:
dest=/tmp/resultsSearch/dataParsed src=../files/executeScriptOnTheMailboxes.sh
tags
:
search
-
name
:
change permission to execute script
shell
:
chmod 755 /tmp/resultsSearch/dataParsed/executeScriptOnTheMailboxes.sh
tags
:
-
search
-
name
:
execute script that execute all commands zmmailbox generated
shell
:
/tmp/resultsSearch/dataParsed/executeScriptOnTheMailboxes.sh
tags
:
-
search
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment