1753465 Members
4716 Online
108794 Solutions
New Discussion юеВ

Batch Mailing

 
Aziz Zouagui
Frequent Advisor

Batch Mailing

Greetings,

I have a question regarding email generation.

Right now, a process generates a shell script that contains 1000 to 2000 emails to be sent, Timesheet Email Alerts, like this:

mailx -s "Alert Reminder" joe@abc.com < message
mailx -s "Alert Reminder" jim@abc.com < message
...
.
.

The email Admins don't like it, they want me to change it and send the entire batch in one time, instead of multiple mailx commands.

Now, is there really a performance gain doing it like above versus one batch ?

Also, what would be the best way to implement this in a single batch versus the above ? for privacy concerns, I don't want all the email addresses to appear in the "To:" box when someone gets his/her alert.

Thank you.
2 REPLIES 2
Sridhar Bhaskarla
Honored Contributor

Re: Batch Mailing

Hi Aziz,

Yes. There will be a performance gain. With every message sending, you are reading the file 'message' per mailx process.

However, once the file is read first time, it will be available in buffer cache for subsequent reads. But still there will be a slight overhead of system calls.

You can do it yourself. Have the script run with 'timex ./script'. Modify the script to add multiple recepients and run it again with timex and see the difference. You should see some incrase in "usr time" and quite a bit in "sys time".

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Steven E. Protter
Exalted Contributor

Re: Batch Mailing



while read -r recip
do

mailx -s "Alert Reminder" $recip < message
done < recipient.list.text

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com