Ok think I'm getting somewhere, basic crude test program:
Code:
#include <iostream>
#include <fstream>
#include <string.h>
#include <stdio.h>
using namespace std;
int main()
{
string email="";
char a=' ';
while(true)
{
a = getchar();
if(a==EOF)break;
email+=a;
}
fstream fout("/localdata/mail/vmailbox/rohan.loc/test/cur/ThisIsTotallyNotValidFormat.txt",ios::out);
fout<<email;
fout.close();
return 0;
}
Master.cf line:
Code:
customtspt unix - n n - - pipe
flags=DRhu user=vmail:vmail argv=/localdata/apps/customtspt/customtspt
And changed virtual_transport to customtspt. I'll probably come up with a better name than that but just testing for now.
At this point any mail sent to any valid email address gets put in the
test@rohan.loc inbox, and I can open it. I even tested an attachement. So I'm off to a good start, at least I got the very basic conceptual stuff working.
Now to make sure it goes to the right mailbox, what is the best way to determine the email it's addressed to, do I actually parse out and find the From field, or is there some kind of variable that gets passed or something?
Obviously I'll have to use the proper Maildir format too, but from the looks of it you can actually get away with pretty much anything, but I'll still follow the proper standard. I found a doc that explains it well here:
http://cr.yp.to/proto/maildir.html