[GH-ISSUE #28] Include Proxmox Mail Gateway (PMG) Support #12

Closed
opened 2026-02-27 15:45:57 +03:00 by kerem · 10 comments
Owner

Originally created by @ananiasfilho on GitHub (Jun 15, 2020).
Original GitHub issue: https://github.com/proxmoxer/proxmoxer/issues/28

Originally assigned to: @jhollowe on GitHub.

Hello, is possible to include a parameter to define if you will use PVE or PMG?

To proxmoxer lib work with proxmox mail gateway i just changed line bellow:
https://github.com/proxmoxer/proxmoxer/blob/develop/proxmoxer/backends/https.py#L83
return cookiejar_from_dict({"PVE"AuthCookie: self.pve_auth_ticket})
TO
return cookiejar_from_dict({"PMG"AuthCookie: self.pve_auth_ticket})

and call my pmg api using same resources/requests as:

Example: All users statistics - /api2/json/statistics/sender
Reference: https://pmg.proxmox.com/pmg-docs/api-viewer/index.html#/statistics/sender

#!/usr/bin/python3
from proxmoxer import ProxmoxAPI
import json
proxmox = ProxmoxAPI('pmg.mydomain.com', user='root@pam',
                     password='my_password', verify_ssl=False)

a = proxmox.statistics.sender.get()
c = json_formatted_str = json.dumps(a, indent=2)
print(c)

So we can define host, user,password and service.
Services are: PVE, PMG and in future PBS - Proxmox Backup Server.

Originally created by @ananiasfilho on GitHub (Jun 15, 2020). Original GitHub issue: https://github.com/proxmoxer/proxmoxer/issues/28 Originally assigned to: @jhollowe on GitHub. Hello, is possible to include a parameter to define if you will use PVE or PMG? To proxmoxer lib work with proxmox mail gateway i just changed line bellow: https://github.com/proxmoxer/proxmoxer/blob/develop/proxmoxer/backends/https.py#L83 return cookiejar_from_dict({"_**PVE**_"AuthCookie: self.pve_auth_ticket}) TO return cookiejar_from_dict({"**_PMG_**"AuthCookie: self.pve_auth_ticket}) and call my pmg api using same resources/requests as: Example: All users statistics - /api2/json/statistics/sender Reference: https://pmg.proxmox.com/pmg-docs/api-viewer/index.html#/statistics/sender ``` #!/usr/bin/python3 from proxmoxer import ProxmoxAPI import json proxmox = ProxmoxAPI('pmg.mydomain.com', user='root@pam', password='my_password', verify_ssl=False) a = proxmox.statistics.sender.get() c = json_formatted_str = json.dumps(a, indent=2) print(c) ``` So we can define host, user,password and service. Services are: PVE, PMG and in future PBS - Proxmox Backup Server.
Author
Owner

@nemmeviu commented on GitHub (Jun 15, 2020):

+1

<!-- gh-comment-id:644379458 --> @nemmeviu commented on GitHub (Jun 15, 2020): +1
Author
Owner

@Disapper commented on GitHub (Jun 15, 2020):

+1

<!-- gh-comment-id:644380754 --> @Disapper commented on GitHub (Jun 15, 2020): +1
Author
Owner

@samirbatista commented on GitHub (Jun 15, 2020):

+1

<!-- gh-comment-id:644411059 --> @samirbatista commented on GitHub (Jun 15, 2020): +1
Author
Owner

@jhollowe commented on GitHub (Jun 20, 2020):

Yeah, this seems like it shouldn't be that hard. I will need to spin up a PMG instance to test, so it might be on the back burner for a bit, but this will get added soon(tm)

<!-- gh-comment-id:647020268 --> @jhollowe commented on GitHub (Jun 20, 2020): Yeah, this seems like it shouldn't be that hard. I will need to spin up a PMG instance to test, so it might be on the back burner for a bit, but this will get added soon(tm)
Author
Owner

@ananiasfilho commented on GitHub (Jun 20, 2020):

Great!
We are running these changes on Productions servers (12 servers) and created Zabbix and Grafana templates. Its running more than 3 weeks on high load servers. Since its follow same arch of pve api, we have not see differences. Also, just deploy PMG container on your PVE and test. If you have any question, i will be available to help you!
Thank you!

<!-- gh-comment-id:647054325 --> @ananiasfilho commented on GitHub (Jun 20, 2020): Great! We are running these changes on Productions servers (12 servers) and created Zabbix and Grafana templates. Its running more than 3 weeks on high load servers. Since its follow same arch of pve api, we have not see differences. Also, just deploy PMG container on your PVE and test. If you have any question, i will be available to help you! Thank you!
Author
Owner

@garbled1 commented on GitHub (Oct 25, 2020):

It looks like this code is now merged, per the readme, but the package in pypi doesn't have the new code. Could you do a new release please? I want to make a package that depends on this.

<!-- gh-comment-id:716181988 --> @garbled1 commented on GitHub (Oct 25, 2020): It looks like this code is now merged, per the readme, but the package in pypi doesn't have the new code. Could you do a new release please? I want to make a package that depends on this.
Author
Owner

@jhollowe commented on GitHub (Oct 28, 2020):

I'd like to do some more work with this and close a few other loose ends before releasing a new version.
I'll try to find some time in the next week or so to release a 1.2.0b1 beta release so you can start playing around with it before the full release. This functionality shouldn't change, just some tidying up of the code.

<!-- gh-comment-id:717672137 --> @jhollowe commented on GitHub (Oct 28, 2020): I'd like to do some more work with this and close a few other loose ends before releasing a new version. I'll try to find some time in the next week or so to release a 1.2.0b1 beta release so you can start playing around with it before the full release. This functionality shouldn't change, just some tidying up of the code.
Author
Owner

@jhollowe commented on GitHub (Nov 7, 2020):

version 1.2.0b1 is in pypi. Since it is a prerelease, you will have to manually specify that version for pip to grab it instead of the standard release.

<!-- gh-comment-id:723494226 --> @jhollowe commented on GitHub (Nov 7, 2020): version 1.2.0b1 is in pypi. Since it is a prerelease, you will have to manually specify that version for pip to grab it instead of the standard release.
Author
Owner

@jhollowe commented on GitHub (May 20, 2021):

@ananiasfilho (and others) Can you try running the code in #43 and report back if it works as expected?

You can clone the PR branch, and in its directory run pip install . to use the branch as the installed version of proxmoxer. You can then import proxmoxer as normal and test its functionality with PBS.

<!-- gh-comment-id:844695397 --> @jhollowe commented on GitHub (May 20, 2021): @ananiasfilho (and others) Can you try running the code in #43 and report back if it works as expected? You can clone [the PR branch](https://github.com/jhollowe/proxmoxer/tree/service-generalize), and in its directory run `pip install .` to use the branch as the installed version of proxmoxer. You can then import proxmoxer as normal and test its functionality with PBS.
Author
Owner

@ananiasfilho commented on GitHub (May 20, 2021):

@jhollowe Sure! Lets ask Proxmox BS Brazil Group (Telegram) to test it too. I will back with news when finish tests. Thank you so much!

<!-- gh-comment-id:845078934 --> @ananiasfilho commented on GitHub (May 20, 2021): @jhollowe Sure! Lets ask Proxmox BS Brazil Group (Telegram) to test it too. I will back with news when finish tests. Thank you so much!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/proxmoxer#12
No description provided.