Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
cancel
Showing results for 
Search instead for 
Did you mean: 

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
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