Re: Faxing

2006-01-18 Thread Robert Whittle
I managed to get perl to send faxes using the 'fax' front-end  
program, but never satisfactorily. I had to use root user to send  
faxes and I never managed to send any faxes that has graphics in the.  
In the end I installed PageSender, which has examples of sending  
faxes via AppleScript, and I called the AppleScript from perl. I know  
that sounds a  lot more round-about but it had a lot of advantages  
for me. I could send HTML files, correctly formated, and there is a  
record kept which you can view in the GUI of all faxes send, or not.


If you do get something working, I'd  be very interested to know how  
you got it done


Robert Whittle


On 18 Jan 2006, at 08:29, Dominic Dunlop wrote:


On 2006–01–17, at 20:29, Bill Stephenson wrote:
Is there a way to fax a document using the built-in Mac OSX (10.3)  
fax feature with perl?


Well, the command-line program underlying the facility is efax.  
There's also a simplified front-end program, fax. You could try  
calling either of those with system() or whatever. Alternatively,  
CUPS makes the fax modem visible as a printer once it's configured  
-- run  lpinfo -v  and you should see it listed. This means that  
you should be able simply to pipe the stuff you want to fax to lpr.  
The trick would be to work out what option you need to put on the  
command line in order to get the number dialled, and acceptable  
formats for the data. (Text is probably OK. Beyond that, I've no  
idea.)


Not that I've tried either possibility myself.


I want to write a script that faxes selected members of congress  
my humble opinions ;)


A laudable aim.
--
Dominic Dunlop





Re: Faxing

2006-01-18 Thread Adrian Hosey
On Wed, 18 Jan 2006, Robert Whittle wrote:

: I managed to get perl to send faxes using the 'fax' front-end program, but
: never satisfactorily. I had to use root user to send faxes and I never managed
: to send any faxes that has graphics in the. In the end I installed PageSender,
: which has examples of sending faxes via AppleScript, and I called the
: AppleScript from perl. I know that sounds a  lot more round-about but it had a
: lot of advantages for me.


Also, anything that supports AppleScript can be driven directly from Perl
using Mac::Glue.

-- 
...while the Japanese are unable to duplicate the American film [market] they
 can destroy it by this video cassette recorder. - Jack Valenti, 1982


Re: Faxing

2006-01-18 Thread Doug McNutt
At 13:29 -0600 1/17/06, Bill Stephenson wrote:
I want to write a script that faxes selected members of congress my humble 
opinions ;)

You can send e-mail from perl and that leads to two options:

1) Send the email to efax (sp) where it can be converted to FAX and sent  for a 
fee.

2) Don't vote for representatives who steadfastly refuse to publish an e-mail 
address. I know, they will need a clerk to read it but that's true for the FAX 
too. Joel Hefley; are you listening?
-- 

-- Love your country. But don't trust its government. --


return status code from sendmail in macosx

2006-01-18 Thread Riccardo Perotti

Hi all:

I have a typical mail cgi script written in perl and can't figure out  
why I don`t get an error when the message is not sent.


My script does the typical:

open (MAIL, |/usr/sbin/sendmail -t -i -F'$from_name' - 
f'$from_mail') or die can't open sendmail: $!;

- etc -
close MAIL or die can't close sendmail: $!;

The problem is that it does not die even though the message is not sent.

I've tried checking $? (child error) but nothing (it is '0').

I have read the sendmail and postfix man pages to no avail.

I've also tried Mail::Mailer, Mail::Send, MIME::Lite and other  
modules, but the problem is still the same: I don't get an error even  
though mail is not sent.


BTW: I know that mail is not sent because I'm checking the result in  
Console.app.


What is it that I'm missing? Is there another way of checking for  
sendmail's success from your script?


Thanks in advance,

Riccardo Perotti
--
[EMAIL PROTECTED]
www.riccardoperotti.com



Re: Faxing

2006-01-18 Thread Joseph Alotta

Hi Doug,

I like the idea of efax.  It seems good but costs $13/month.   That  
is a little high for me considering I send or receive about 5 faxes a  
year.  I wonder if there is another place that only charges when you  
do something?


On Jan 18, 2006, at 11:51 AM, Doug McNutt wrote:


At 13:29 -0600 1/17/06, Bill Stephenson wrote:
I want to write a script that faxes selected members of congress  
my humble opinions ;)


You can send e-mail from perl and that leads to two options:

1) Send the email to efax (sp) where it can be converted to FAX and  
sent  for a fee.


2) Don't vote for representatives who steadfastly refuse to publish  
an e-mail address. I know, they will need a clerk to read it but  
that's true for the FAX too. Joel Hefley; are you listening.


I was under the impression that all US representatives get an email  
address automatically assigned to them, whether they use it or not.






-- Love your country. But don't trust its government. --




Re: return status code from sendmail in macosx

2006-01-18 Thread Bruce Van Allen
On 1/18/06 Riccardo Perotti wrote:

Hi all:

I have a typical mail cgi script written in perl and can't figure out
why I don`t get an error when the message is not sent.
 ...
The problem is that it does not die even though the message is not
sent.

I've tried checking $? (child error) but nothing (it is '0').

I have read the sendmail and postfix man pages to no avail.
 ...
What is it that I'm missing? Is there another way of checking for
sendmail's success from your script?

I'm not sure what the problem is, but when my mail scripts don't work, I
find the undeliverable messages in ~/mbox. Might be some hints there.

HTH

- Bruce

__bruce__van_allen__santa_cruz__ca__


Re: return status code from sendmail in macosx

2006-01-18 Thread Riccardo Perotti


On Jan 18, 2006, at 4:49 PM, Brian McKee wrote:


On 18/01/06, Riccardo Perotti [EMAIL PROTECTED] wrote:

Hi all:

I have a typical mail cgi script written in perl and can't figure out
why I don`t get an error when the message is not sent.

My script does the typical:

open (MAIL, |/usr/sbin/sendmail -t -i -F'$from_name' -
f'$from_mail') or die can't open sendmail: $!;
- etc -
close MAIL or die can't close sendmail: $!;

The problem is that it does not die even though the message is not  
sent.


I've tried checking $? (child error) but nothing (it is '0').

I have read the sendmail and postfix man pages to no avail.


maybe helpful info in /var/log/mail.log ?



Thank you brian:
By checking /var/log/mail.log (from Console.app) I know that the mail  
failed to be sent, but my perl script doesn't catch this, which is my  
problem.


Riccardo
--
[EMAIL PROTECTED]
www.riccardoperotti.com