[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: E-mail to RSTS
to keep server load down, it would be better if we could just have sendmail
route mail to a c program that loads it to the sim. I really don't want to run
a job every x minutes, hours, etc that may only get used 1once and awhile. The
other option, if you really want to read the que is all the pop crap and you
could end up with 5 programs in the que. With the routing to c program, it is
real time so it is there when you log on ready for you. The c program can even
respond to the person telling them it has been completed and saved under xxx
file name. Let the C program set the file name by using date and time. This
will help identify the file and also stop overrighting. Then have a detached
job under rsts that runs and cleans that directory ever x number of days. If a
file was received by the c program on July 16, 1999 at 10:30 am we could name
is 07161030.EML or something.
The aliases entry would look something like this:
delta1170: "|/usr/local/majordomo/wrapper delta1170"
I can also route the mail to a file anywhere on the system that you want also.
The program would be delta1170 that would receive the mail. I am doing this now
with a perl script I wrote. See it below:
#!/usr/bin/perl
# used for Anonymous Mail redirector THIS IS THE DEMO VERSION!!
#
# set our path explicitly
$sendto = "anoninfo\@mcws.net";
$sender = "anonymous\@mcws.net";
$company = "Painted Rock Collections";
$mailprog = '/usr/lib/sendmail';
$ENV{'PATH'} = "/bin:/usr/bin:/usr/ucb";
# Read and execute the .cf file
$cf = $ENV{"MAJORDOMO_CF"} || "/etc/majordomo.cf";
if ($ARGV[0] eq "-C") {
$cf = $ARGV[1];
shift(@ARGV);
shift(@ARGV);
}
if (! -r $cf) {
die("$cf not readable; stopped");
}
require "$cf";
chdir($homedir) || die("Can't chdir(\"$homedir\"): $!");
unshift(@INC, $homedir);
require "majordomo.pl";
require "shlock.pl";
&ParseMailHeader(STDIN, *hdrs);
$reply_to = &RetMailAddr(*hdrs);
$reply_to = join(", ", &ParseAddrs($reply_to));
die("new-list: $reply_to is not a valid return address.\n")
if (! &valid_addr($reply_to));
# Format Date Routine
@days = ('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday')
;
@months = ('January','February','March','April','May','June','July',
'August','September','October','November','December');
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
if ($hour < 10) { $hour = "0$hour"; }
if ($min < 10) { $min = "0$min"; }
if ($sec < 10) { $sec = "0$sec"; }
$date = "$days[$wday], $months[$mon] $mday, 19$year at $hour\:$min\:$sec";
open (MAIL, "|$mailprog $sendto,$reply_to") || die "Can't open $mailprog!\n";
print MAIL <<"EOM";
From: Anonymous\@mcws.net
Subject: $company Anonymous Feedback
Anonymous Employee Feedback submitted on $date
** NOTICE: THIS MESSAGE HAS BEEN ROUTED TO YOU ONLY BECAUSE YOU REQUESTED A DEMO
OF THIS PROCESS. HAD THIS BEEN THE REAL THING, THE SENDER WOULD NOT
RECEIVE A COPY OF THE LETTER THEY SENT. THIS IS ONLY TO ALLOW YOU TO
SEE WHAT THE EMAIL LOOKS LIKE TO THE PEOPLE YOUR ANONYMOUS EMAIL IS
ROUTED TO.
--------------------------------------------------------------------------------
EOM
;foreach ("Subject"){
($hdr = $_) =~ tr/A-Z/a-z/;
if (defined($hdrs{$hdr})) {
print MAIL $_, ": ", $hdrs{$hdr}, "\n";
}
}
print MAIL "\n";
while (<STDIN>) {
print MAIL $_;
}
print MAIL <<"EOM";
--------------------------------------------------------------------------------
Lack of traceability will be assured through contractual agreement to that effec
t
between our companies, by the lack of electronic or otherwise archiving of traff
ic
through our service and through a signed legal contract which warrants against d
isclosure
of any information regarding the source of said correspondences.
copyright 1997, Micro Concepts of Chesterfield.
Web Services Division - http://www.mcws.net
EOM
;
close(MAIL);
exit 0;
Gary L. Luckenbaugh wrote:
> I checked it out, and it looks like we can avoid using sendmail to send and
> receive mail programmatically. You can send mail very easily by just using
> the following C call:
>
> write data into "input-file";
> system("mail address < input-file");
>
> Receiving mail is almost as easy. It lands in /var/spool/mail/delta. So
> all I need to do is periodically read and empty this file. Actually, a
> BASIC-PLUS program running detached could periodically wake up and read this
> file via the PP: and PR: interface we've talked about. Alan Flippen has
> offered to work on the BASIC-PLUS side, while I fiddle with the C code.
>
> So it looks like we can forgo sendmail, unless Jim has any words of wisdom
> on how to configure it.
>
> Regards, Gary