As recommended by Andy, you can use protocol logging instead. I did some research and found a script from GitHub which can be used to get unique Sender IP Addresses from SMTP logs. The script was intended for Exchange 2010, but can be easily modified for other versions.
Check Exchange SMTP Logs To Get Unique Sender IP Addresses
I changed the LogFilePath to "C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\FrontEnd\ProtocolLog\SmtpReceive*.log" and ran the script in my Exchange 2016 lab, the output file can be generated successfully with unique IP addresses. But I'd suggest testing with a small number of files first as it may take some time to processing the log files. (In my case there are about 600 log files and it took me almost 2 hours.)
If the response is helpful, please click "Accept Answer" and upvote it.