Add Mailcow emails count script
This commit is contained in:
		
							parent
							
								
									54957fcbed
								
							
						
					
					
						commit
						8e5faf48f2
					
				
							
								
								
									
										14
									
								
								count_emails.py
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										14
									
								
								count_emails.py
									
									
									
									
									
										Executable file
									
								
							| @ -0,0 +1,14 @@ | |||||||
|  | #!/usr/bin/python3 | ||||||
|  | 
 | ||||||
|  | import api_requests as api | ||||||
|  | 
 | ||||||
|  | ENDPOINT = 'get/mailbox/all' | ||||||
|  | emails_count = 0 | ||||||
|  | 
 | ||||||
|  | try: | ||||||
|  |     for user in api.mailcow(ENDPOINT): | ||||||
|  |         emails_count += user["messages"] | ||||||
|  | except TypeError: | ||||||
|  |     print("Mailcow : What is your IP address ?") | ||||||
|  | 
 | ||||||
|  | print("Emails count : " + str(emails_count)) | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user