Signal mailman remote IP via X-Forwarded-For.
parent
7e0f2edced
commit
af052783b1
4
main.py
4
main.py
|
@ -25,7 +25,9 @@ def pull_feed_entries():
|
||||||
|
|
||||||
def mailman_subscribe(email, mailing_list):
|
def mailman_subscribe(email, mailing_list):
|
||||||
password = "".join(random.choice(string.letters) for _ in range(8))
|
password = "".join(random.choice(string.letters) for _ in range(8))
|
||||||
r = requests.post("https://lists.hackerspace.pl/subscribe/" + mailing_list, {"email": email, "fullname": "", "pw": password, "pw-conf": password, "email-button": "Zapisz", "digest": 0})
|
post = {"email": email, "fullname": "", "pw": password, "pw-conf": password, "email-button": "Zapisz", "digest": 0}
|
||||||
|
headers = {"X-Forwarded-For": request.remote_addr}
|
||||||
|
r = requests.post("https://lists.hackerspace.pl/subscribe/" + mailing_list, post, headers=headers)
|
||||||
if r.status_code != 200:
|
if r.status_code != 200:
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
Reference in New Issue