PDA

View Full Version : Has this ever happened to anyone?



mdklatt
5/19/2006, 05:53 PM
I have a C++ class that sends e-mail using an invocation of the system's mutt client. I use popen()/pclose() to stream data to mutt, as you do. Everything works fine interactively, but as part of a CGI application my MIME attachments don't work correctly. They register as attachments to the e-mail client, but the attachments are empty. I figured that STDIN might be getting corrupted since I'm mixing popen()/pclose() for mutt along with std::cin to retrieve POST data in the CGI application. So, I made a simple test program that uses std::cin along with my e-mail class but everything works fine. So STDIN doesn't appear to be the problem at all, and now I'm back to square one, dammit. And good ****ing luck running gdb on a CGI application. Man, I hate when that happens.

Ike
5/19/2006, 05:59 PM
nerd alert.

and I can't help you since I never use mutt. pine perhaps, but not mutt.

mdklatt
5/19/2006, 06:02 PM
and I can't help you since I never use mutt. pine perhaps, but not mutt.

I'll call your bluff. How would pine react to popen()/pclose() in conjunction with std::cin in a CGI application? :D

OUinFLA
5/19/2006, 06:06 PM
geeks to the right of me
nerds to the left
stuck in the middle....

Flagstaffsooner
5/19/2006, 06:06 PM
No more MIME attachments!

http://www.nwkansas.com/home/evan/thumbs/mime.jpg

stoops the eternal pimp
5/19/2006, 06:15 PM
I remember that happening to me when I was in 2nd grade

Ike
5/19/2006, 06:17 PM
to be honest, I'm not sure how I would do that with popen. I only use popen in python. You might try looking into a mime++ or similar library that allows your class to create the entire email external to the client, and then just fire it off with a generic smtp program, or by reading it in with the client.

thats most likely what I'd try anyway. popened programs are somewhat difficult to manipulate interactively....at least thats been my experience.

Vaevictis
5/19/2006, 06:25 PM
Have you tried using strace or ltrace?

BeetDigger
5/19/2006, 06:48 PM
Computer geek/nerd smack - heh.

Sooner24
5/19/2006, 07:19 PM
I have a C++ class that sends e-mail using an invocation of the system's mutt client. I use popen()/pclose() to stream data to mutt, as you do. Everything works fine interactively, but as part of a CGI application my MIME attachments don't work correctly. They register as attachments to the e-mail client, but the attachments are empty. I figured that STDIN might be getting corrupted since I'm mixing popen()/pclose() for mutt along with std::cin to retrieve POST data in the CGI application. So, I made a simple test program that uses std::cin along with my e-mail class but everything works fine. So STDIN doesn't appear to be the problem at all, and now I'm back to square one, dammit. And good ****ing luck running gdb on a CGI application. Man, I hate when that happens.


I think your problem might be old dilithium crystals. If I were you I would take the warp core offline, go to the transporter and try to send some anti-matter into the nearest wormhole. If that doesn't work just blast the whole thing with a couple of photon torpedoes.

Norm In Norman
5/19/2006, 10:01 PM
Personally, I'd write a class to send the email. It's not like the protocol is difficult or anything. Then when it doesn't work you know it's your own fault.

MamaMia
5/19/2006, 10:07 PM
http://www.jeopardyinfo.com/AlexStanding.JPGI'll take Italian recipes for $500.00, Alex. :D

Sooner24
5/19/2006, 10:12 PM
Is that Clint Howard under you on the star Norm? :D

http://www.clinthoward.com/assets/images/aboutme_clint.jpg

SoonerInKCMO
5/19/2006, 10:53 PM
Ditch the C++ and use Perl instead.

Penguin
5/19/2006, 11:12 PM
Just use Fortran. Problem solved. NEXT!

OKC Sooner
5/19/2006, 11:44 PM
http://www.benllys.com/wooden_dog_201.jpg

pine mutt

yermom
5/20/2006, 02:44 AM
Is that Clint Howard under you on the star Norm? :D

http://www.clinthoward.com/assets/images/aboutme_clint.jpg

i think it's Dwight Schrute

Sooner24
5/20/2006, 06:53 AM
i think it's Dwight Schrute


That's who I thought it was. I knew it wasn't Clint because he is so much better looking. :eddie:

VeeJay
5/20/2006, 08:50 AM
Go into MCSE, dump the invertible syntax, follow through with the binary outsource, then reboot. Reformat the external peripeherals on startup, surf porn and voila!

mdklatt
5/20/2006, 09:58 AM
Ditch the C++ and use Perl instead.

Pfft.

mdklatt
5/20/2006, 10:01 AM
Just use Fortran. Problem solved. NEXT!

I probably will port the e-mail and CGI class libraries over to Fortran 95 for fun one of these days. :O

mdklatt
5/20/2006, 10:05 AM
I won't keep everybody on pins and needles any longer: Problem solved. As is often the case with programming, the actual problem had nothing to do with the initial diagnosis. So my CGI application writes a text file and then e-mails it as an attachment. I wasn't explicitly closing the text file before trying to e-mail it. I don't need to tell you guys what that means. :O

Sooner24
5/20/2006, 10:35 AM
I won't keep everybody on pins and needles any longer: Problem solved. As is often the case with programming, the actual problem had nothing to do with the initial diagnosis. So my CGI application writes a text file and then e-mails it as an attachment. I wasn't explicitly closing the text file before trying to e-mail it. I don't need to tell you guys what that means. :O


So you ended up not having to use the photon torpedos after all. :O

mdklatt
5/20/2006, 10:39 AM
So you ended up not having to use the photon torpedos after all. :O

Thankfully no. Those things are 'spensive.

SoonerInKCMO
5/20/2006, 02:10 PM
I won't keep everybody on pins and needles any longer: Problem solved. As is often the case with programming, the actual problem had nothing to do with the initial diagnosis. So my CGI application writes a text file and then e-mails it as an attachment. I wasn't explicitly closing the text file before trying to e-mail it. I don't need to tell you guys what that means. :O

If'n you'd been using Perl with the 'use warnings' option enabled it would've told you that right away.

Jus' sayin'. :)