3 messages in net.sourceforge.lists.courier-usersRe: [courier-users] Maildrop or couri...
FromSent OnAttachments
maillistNov 15, 2000 4:40 pm 
maillistNov 15, 2000 9:15 pm 
maillistNov 15, 2000 10:47 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [courier-users] Maildrop or courierdeliever Extention ProblemActions...
From:maillist (jame@china.com)
Date:Nov 15, 2000 10:47:37 pm
List:net.sourceforge.lists.courier-users

Since you say that I can read the contents of the message from standard input. for the main_part of /usr/local/bin/delivery_notice is the following:

fd_set read_set; struct timeval tv; int i; char buff[256]; FILE *fp;

tv.tv_sec = 1; tv.tv_usec = 0; fp = fopen("/home/duanmu/test/mail_temp", "w+"); while(1) { FD_ZERO(&read_set); FD_SET(STDIN_FILENO, &read_set); select(STDIN_FILENO+1, &read_set, NULL, NULL, &tv); memset(buff, 0, 256);

if(FD_ISSET(STDIN_FILENO, &read_set)) { read(STDIN_FILENO, (void *)buff, 255); fputs((char *)buff, fp); continue; } else { break; } } fclose(fp);

---------------- Here the standard input means the STDIN_FILENO defined in <stdio.h>, right?

James.D

----- Original Message ----- From: maillist <jame@china.com> To: <cour@lists.sourceforge.net> Sent: Thursday, November 16, 2000 1:15 PM Subject: Re: [courier-users] Maildrop or courierdeliever Extention Problem

How to read the standard input to get the message contents? The only thing I can do is: forward the message to a specific directory, read it
and pickup the necessary information.

Thank you!

----- Original Message ----- From: Sam Varshavchik <mrs@courier-mta.com> To: <cour@lists.sourceforge.net> Sent: Thursday, November 16, 2000 10:05 AM Subject: Re: [courier-users] Maildrop or courierdeliever Extention Problem

On Thu, 16 Nov 2000, maillist wrote:

Now I got a problem, _guest what_

The Truth is: I want to send the email arrival notification when email arrives inside. Since the maildrop is the primary delievery agent, I wanna add some codes at the end of the maildrop to forward part of the message information to a TCP, UDP whatever ports for other programs use. So the user can get the instant message arrival notification.

Now the problem is: I really can not locate the right place to add the codes(getting email information, selecting right place in maildrop or courierlocal, courierdeliever), please give me some clue on how to do it, OK?

What you should do is to add some code to the end of a maildrop recipe, or the .courier file to run your program that sends the message information. No need to modify anything. For example:

$ cat $HOME/.courier ./Maildir | /usr/local/bin/delivery_notice

Your program will be executed after Courier delivers each message, and you can get the sender information from the environment, or even read the contents of the message from standard input.