[Gambas-user] strange behaviour from commandline - empty mail attachments

Bruce bbruen at ...2308...
Thu Aug 15 12:25:18 CEST 2013


On Thu, 2013-08-15 at 12:07 +0200, Rolf-Werner Eilert wrote:
> I could build a client which prints a pdf from commandline and sends it 
> to someone via e-mail, the Cairo class makes the pdfs.
> 
> My Gambas program is called by cron. It checks a mailbox and reads the 
> mails if any. These are contact forms. The data are then processed into 
> a pdf and the resulting pdf sent back to the person which sent the 
> contact form.
> 
> The strange thing is, as long as I start the program by hand, everything 
> runs as expected. But when it is started by cron, the pdfs which are 
> sent back reach the recipient empty, i. e. 0 Bytes.
> 
> Sending is achieved by an external Perl script named sendEmail, I shell 
> out to start it. (This is because the SMTP client in Gambas doesn't want 
> to send these mails via any of my providers, haven't found the reason yet.)
> 
> But it doesn't seem to be this script's mistake. I tested the same 
> pdf-file with a special version of the program which jumped directly 
> into mail despatch, and when I started it from within the IDE, 
> everything ran fine, but from cron it would send 0 byte pdfs.
> 
> This is slightly OT, but it might have to do with the way Gambas handles 
> Shells or file rights or something completely different... Does anyone 
> here have an idea?
> 
> Rolf

Hi Rolf,

The first thing I'd be looking at is your working directories, I presume
you are using temporary files somewhere. Don't forget that the cron
daemon is running in a completely different environment to your User
environment.

hth
Bruce





More information about the User mailing list