LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-09-2003, 03:15 PM   #1
jgaraas
LQ Newbie
 
Registered: May 2003
Posts: 27

Rep: Reputation: 15
"Timed" mailing list


System:
Sendmail 8.12
Redhat 8


Is there a way that I can set up a mailing list that will send out emails on a timed interval automatically.

For example I need to send the same email once every three months. Is there a way to do this or am I just out of luck?

Thanks for the help.
 
Old 05-09-2003, 03:19 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Just send it from a script run by cron.
 
Old 05-09-2003, 03:23 PM   #3
jgaraas
LQ Newbie
 
Registered: May 2003
Posts: 27

Original Poster
Rep: Reputation: 15
Do you have an example of a script?

If not dont worry about it, I'll do some research on it.
 
Old 05-09-2003, 03:25 PM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
I have a few examples - nothing that is exactly what you want but give me 5 minutes and I'll see what I can whip up.
 
Old 05-09-2003, 03:39 PM   #5
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Create a text file with your message and another with the addresses of your recipients (each one should be followed by a newline).

Then change the four variables at the top of the script and run it.

I've just written this and so I haven't really tested it but it should work.

Code:
#!/usr/bin/perl

$messagefile = "/path/to/messagefile";
$addressfile = "/path/to/addressfile";
$youraddress = "someone\@somewhere.com";
$subject = "The monthly mailing list message.";

open(DATA, "$messagefile") || die ("Could not open message file");
@message = <DATA>;
close(DATA);
open(DATA, "$addressfile") || die ("Could not open address file");
@addresses = <DATA>;
close(DATA);


foreach $address (@addresses){
open(MAIL, "|/usr/lib/sendmail -t") || die ("Could not open sendmail");
print MAIL "To: $address";
print MAIL "From: $youraddress\n";
print MAIL "Subject: $subject\n\n";
print MAIL @message;
close(MAIL);
}

$num = @addresses;
print "Message sent to $num people\n";

exit;
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error message "do_ypcall: clnt_call: RPC: Timed out" mks_jangra Linux - Networking 4 10-24-2006 06:29 AM
"Could not init font path element""Unix /: 7100 removing from list/ zameer_india Linux - Networking 7 07-03-2006 06:11 AM
User "list" running process "python" TroelsSmit Linux - Newbie 2 02-22-2005 04:55 AM
"YOU" says "could not write server list to disk" dushkinup Linux - Distributions 4 07-26-2004 12:01 PM
traceroute timeout, "operation timed out when attempting to contact" in Mozilla brianabroad Linux - Networking 1 11-08-2003 09:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration