My first thought is that it's not an issue within Joomla, but smtp
server.
I mean, on most hosts php setting max_execution_time is 30s.
This means when script is running for more than that (3-5min), it's
stopped by PHP and you'll see white screen of death and/ or an error.
Try comparing email settings in Joomla configuration to these you use
for sending from bash. Maybe one of the settings makes it run extra
time on smtp server