LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-15-2004, 03:31 AM   #1
rabbate
LQ Newbie
 
Registered: Feb 2004
Posts: 18

Rep: Reputation: 0
editing qmail-smtpd.c to my needs


Hi. I am relatively new to C++, and I am trying to edit the "qmail-smtpd.c" code modifed to log all incoming mail (sender and recipient) either by executing a system command or logging to a log file itself.

I have tried to do this, but no avail.


I found a place here:

stralloc mailfrom = {0};
stralloc rcptto = {0};

void smtp_mail(arg) char *arg;
{
if (!addrparse(arg)) { err_syntax(); return; }
flagbarf = bmfcheck();
seenmail = 1;
if (!stralloc_copys(&rcptto,"")) die_nomem();
if (!stralloc_copys(&mailfrom,addr.s)) die_nomem();
if (!stralloc_0(&mailfrom)) die_nomem();

/* my hack to execute system to grab sender, and recipient */
system("/bin/echo 'mailfrom -> rcptto' > /tmp/sent.log");

out("250 ok\r\n");
}


but I am unable to print the actual variables mailfrom and rcptto. How do you grab the variables and print them either to file or to Unix system command?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with /var/qmail/supervise/qmail-smtpd/run coolamit78 Linux - Networking 4 02-02-2012 10:50 AM
Open Webmail / Mailfront / smtpfront-qmail / qmail-smtpd Apollo77 Linux - Software 2 01-20-2009 03:33 AM
Can't start qmail-smtpd Madrinator Linux - Networking 6 01-06-2006 11:06 AM
Configuring qmail-smtpd tveiga Linux - Software 1 01-16-2004 03:17 PM
qmail help: where is the run script for qmail-smtpd? IceNineJon Linux - Software 2 12-03-2002 07:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration