diff options
Diffstat (limited to 'bugzilla/usr/bin/bugzilla_fetch.py')
-rwxr-xr-x | bugzilla/usr/bin/bugzilla_fetch.py | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/bugzilla/usr/bin/bugzilla_fetch.py b/bugzilla/usr/bin/bugzilla_fetch.py deleted file mode 100755 index b4a9805..0000000 --- a/bugzilla/usr/bin/bugzilla_fetch.py +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | #!/usr/bin/env python | ||
2 | |||
3 | import boto3 | ||
4 | import subprocess | ||
5 | |||
6 | |||
7 | client = boto3.client("s3") | ||
8 | bucket = "mcrute-bugs-emails" | ||
9 | email_bin = "/var/www/html/bugzilla/email_in.pl" | ||
10 | items = client.list_objects_v2(Bucket=bucket) | ||
11 | |||
12 | |||
13 | for item in items["Contents"]: | ||
14 | key = item["Key"] | ||
15 | |||
16 | if key == "AMAZON_SES_SETUP_NOTIFICATION": | ||
17 | continue | ||
18 | |||
19 | body = client.get_object(Bucket=bucket, Key=key)["Body"] | ||
20 | |||
21 | cmd = subprocess.Popen([email_bin], stdin=subprocess.PIPE) | ||
22 | cmd.communicate(body.read()) | ||
23 | |||
24 | client.delete_object(Bucket=bucket, Key=key) | ||