Here is my code:

#include <fstream>
using namespace std;

int main (int argc, char* argv[])
   ofstream out;"/root/");

   for (int x = 0; x < argc; x++)
      out << argv[x];
   return 0;


It works fine from the command line, but when I try to send mail to it
the file isn't written...

On Tue, 2005-04-05 at 14:17 +0200, Christian Parpart wrote:
> On Monday 04 April 2005 3:03 pm, Michael Sullivan wrote:
> > Last year for my birthday my wife bought me a copy of the Sendmail
> > Cookbook.  As I was browsing through it I found a recipe for making
> > sendmail forward mail with a particular address to a program on the
> > sendmail's local hard drive.  This fascinated me, but it doesn't say
> > anything beyond how to set up sendmail to forward mail to the program.
> > I created a program that did nothing but take the input it was given and
> > write it down to a file.  I then set the address up to forward mail to
> > the program and cleared the program with smrsh.  I checked the log files
> > and my email was sent to the program, but the file my program was
> > supposed to create was never created and I'm not sure why - nothing in
> > the logs.  Can anyone point me to any resources on how to do what I am
> > attempting.  If I can figure out how to do this the number of my
> > applications of it would be virtually limitless...
> Hi,
> I did this for my community server (I wrote my own). But I'm using Postfix 
> rather than Sendmail. However, the procedure shall be the very same.
> You have to read the incoming mail from stdin and then do whatever you 
> want to do with it (e.g. parsing and interpreting commands ;)
> # part of /etc/mail/aliases
> yacsadmin: trapni, |"/usr/bin/yacsadmin --receive-mail 
> --config=/etc/yacs/mailreceiver.conf"
> So, I'm still getting a copy of the files send to yacsadmin@ to verify wether
> my tool worked well or not. Have a look at my mailreceiver.cpp[1] and 
> yacsadmin.cpp[2] to see how I got it working. Maybe you shall provide us with 
> some more detail (source code?) since there may be there error, too ;)
> Cya,
> Christian Parpart.
> [1] 
> [2] 

-- mailing list

Reply via email to