best/easiest commandline email program for mass-email
alex at ourwoods.org
Tue Feb 2 22:55:31 UTC 2010
Thanks for your help, Hal and to everyone else, too.
This should make it easier for someone else to get a mass-mailer working.
Here's what I did:
sudo apt-get install mailx
I'm not sure if the next two steps are needed, but it does tell you what
to do next.
sudo dpkg-reconfigure sendmail
Select none for configuration
You see the message:
Postfix was not set up. Start with
cp /usr/share/postfix/main.cf.debian /etc/postfix/main.cf
If you need to make changes, edit
/etc/postfix/main.cf (and others) as needed. To view Postfix
values, see postconf(1).
After modifying main.cf, be sure to run '/etc/init.d/postfix reload'.
Modifiy main.cf below.
Now, set up SMTP AUTH
Quick synopsis of the above tutorial:
Create plaintext file named sasl_passwd in /etc/postfix with one line
per login with the domain name and a login-name:password pair.
Create database file from sasl_passwd with the following command:
Add the following variable definitions to main.cf:
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
address_verify_sender = username at domain.com
Substitute a real address for address_verify_sender.
Reload Postfix with the following command as root:
My test bash script follows:
# the mail program
# Errors are sent here
SENDER="myaddress at mydomain.com"
# put this in a loop
MAILTO=someone at somewhwere.com
# Do a loop for a bunch of emails from a file
# Un-comment here and below to make the loop work.
# while read MAILTO
# the following section is an alteration of Hal Burgiss's suggestion on
Ubuntu users list 1/27/2010
( echo "From: $SENDER"
echo "To: $MAILTO"
echo "Subject: $SUBJECT"
echo "Reply-To: $SENDER"
echo "MIME-Version: 1.0"
echo "Content-Type: text/html; charset=\"ISO-8859-1\""
# Add required blank line to separate header/body.
# Body goes now ...
) | $SENDMAIL -t -f $SENDER
# Pause here to keep from overloading the mail server and drawing attention
# substitute your email list name after the input redirector, <
#done < list_of_email_addresses
# Redirecting input from end of loop does not start a sub-shell in bash
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. - Albert Einstein (275)
More information about the ubuntu-users