I use ps : (greping by imap & idle)
# ps -axww | grep imap | grep IDLE
thant and split() in python
8606 - S 0:08.78 imap: [keith@elirpa.com 54.242.98.60 IDLE] (imap) 12234 - I 0:01.00 imap: [reception@clancyca.com 72.143.119.178 IDLE] (imap) 20668 - S 0:02.01 imap: [paul@scom.ca 216.58.25.131 IDLE] (imap) 23219 - I 0:00.33 imap: [clancy@clancyca.com 72.143.119.178 IDLE] (imap) 26761 - S 0:00.52 imap: [ed.hanna@ekst.ca 204.237.91.165 IDLE] (imap) 26785 - I 0:00.87 imap: [ed@scom.ca 204.237.91.165 IDLE] (imap) 26787 - I 0:00.80 imap: [ed.hanna@dssmgmt.com 204.237.91.165 IDLE] (imap) 27378 - S 0:00.42 imap: [ed@scom.ca 204.237.91.165 IDLE] (imap) 31404 - S 0:03.90 imap: [paul@scom.ca 216.58.25.131 IDLE] (imap) 32494 - S 0:00.13 imap: [installers@tomkudla.ca 167.94.196.10 IDLE] (imap) 32497 - S 0:00.13 imap: [installers@tomkudla.ca 167.94.196.10 IDLE] (imap) 33809 - I 0:00.28 imap: [clancy@clancyca.com 72.143.119.178 IDLE] (imap) 36321 - I 0:00.21 imap: [clancy@clancyca.com 72.143.119.178 IDLE] (imap) 39188 - I 0:00.39 imap: [clancy@clancyca.com 72.143.119.178 IDLE] (imap) 42706 - S 0:00.45 imap: [ed@scom.ca 204.237.91.165 IDLE] (imap) 46356 - S 0:02.98 imap: [rcooke@tnky.ca 198.91.141.141 IDLE] (imap) 46422 - S 0:01.32 imap: [rcooke@tnky.ca 198.91.141.141 IDLE] (imap) 46424 - S 0:01.27 imap: [rcooke@tnky.ca 198.91.141.141 IDLE] (imap) 50756 - S 0:01.36 imap: [rcooke@tnky.ca 198.91.141.141 IDLE] (imap) 58656 - I 0:00.07 imap: [ditchburn@clancyca.com 216.58.50.30 IDLE] (imap) 63886 - S 0:00.70 imap: [rcooke@tnky.ca 198.91.141.141 IDLE] (imap) 68246 - I 0:00.08 imap: [li@clancyca.com 72.143.119.178 IDLE] (imap) 74719 - I 0:00.03 imap: [dan@elirpa.com 142.183.30.44 IDLE] (imap) 76580 - I 0:00.02 imap: [info@willsagriquipandfencing.ca 173.32.244.194 IDLE] (imap) 76584 - I 0:00.02 imap: [howard@willsagriquipandfencing.ca 173.32.244.194 IDLE] (imap) 77567 - S 0:00.04 imap: [rcooke@tnky.ca 198.91.141.141 IDLE] (imap) 77569 - I 0:00.03 imap: [rcooke@tnky.ca 198.91.141.141 IDLE] (imap)
Happy Friday !!! Thanks - paul
Paul Kudla
Scom.ca Internet Services http://www.scom.ca 004-1009 Byron Street South Whitby, Ontario - Canada L1N 4S3
Toronto 416.642.7266 Main 1.866.411.7266 Fax 1.888.892.7266 Email paul@scom.ca
On 8/18/2022 6:28 PM, J Doe wrote:
On 2022-08-16 16:46, Antonio Leding wrote:
At the risk of being pedestrian, I just use something like |sudo netstat -an | grep ‘:[ IMAP_PORT ]’|
I’m pretty sure you thought of this but still, thought I would toss it out…
Hi Antonio and Jaroslaw,
I don't think the second solution is pedestrian; I think it's cool that people have come up with different solutions for the same problem!
I am thinking that this may not be the solution that Jaroslaw is looking for, as this also requires spawning a process to run netstat and then capturing the results. The socket approach avoids an additional process.
- J