[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] Sendmail -> lpr (line printer), multiple sendmail commands?
****** message to minivend-users from Mike Heins <mike@minivend.com> ******
Quoting Ryan Hertz (rhertz@gyb.baits.com):
>
> Anyone have any ideas on this? I'm attempting to have MiniVend dump
> orders directly to a printer for our shipping department, my initial idea
> is to add:
>
> SendMailProgram /var/spool/lp/filters/simple | lpr -h -Ppr@printeripaddr
>
> However, I still need the e-mail sent to billing w/ the cc#s. How could I
> have MiniVend run the print job and email? I'm guessing that I leave
> SendMailProgram alone and PERL in the lpr command into
> /ord/report.html. So, I guess my question is how do I send [scratch
> order_text] to a system command in PERL from MiniVend?
You could use a very simple filter program:
#!/usr/bin/perl
open LPR, '| lpr -h -Ppr@printeripaddr'
or die "can't fork: $!\n";
open MAIL, '| /usr/sbin/sendmail -t'
or die "can't fork: $!\n";
while(<>) {
print LPR $_;
print MAIL $_;
}
my $status = 0;
close MAIL;
if($?) {
$status = 1;
warn "Mail error: $!\n";
}
close LPR;
if($?) {
$status = 1;
warn "Printer spool error: $!\n";
}
exit $status;
__END__
Now just use that script as your SendmailProgram.
--
Mike Heins http://www.minivend.com/ ___
Internet Robotics |_ _|____
If you think nobody cares if 131 Willow Lane, Floor 2 | || _ \
you're alive, try missing a couple Oxford, OH 45056 | || |_) |
of car payments. <mikeh@minivend.com> |___| _ <
-- Earl Wilson 513.523.7621 FAX 7501 |_| \_\
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list
- Follow-Ups:
- [mv] OH dear
- From: ".cory.trese." <digital@specialty-books.com>