34 messages in net.sourceforge.lists.courier-users[courier-users] ctlfile (was: Re: Cou...
FromSent OnAttachments
Julian MehnleJan 18, 2005 12:03 pm 
ScottJan 18, 2005 6:57 pm 
Frederik DannemareJan 18, 2005 7:54 pm 
Julian MehnleJan 19, 2005 4:00 am 
Alexander LazicJan 19, 2005 5:01 am 
Julian MehnleJan 19, 2005 7:50 am 
Alexander LazicJan 19, 2005 2:07 pm 
Jay LeeJan 19, 2005 2:23 pm 
Gordon MessmerJan 19, 2005 3:18 pm 
Sam VarshavchikJan 19, 2005 3:35 pm 
Julian MehnleJan 19, 2005 3:42 pm 
Gordon MessmerJan 19, 2005 3:56 pm 
Sam VarshavchikJan 19, 2005 4:07 pm 
Mitch (WebCob)Jan 19, 2005 4:42 pm 
Mitch (WebCob)Jan 19, 2005 4:46 pm 
Sam VarshavchikJan 19, 2005 5:13 pm 
Gordon MessmerJan 19, 2005 6:11 pm 
Sam VarshavchikJan 19, 2005 6:17 pm 
Gordon MessmerJan 19, 2005 10:38 pm 
Alexander LazicJan 20, 2005 2:29 am 
Alessandro VeselyJan 20, 2005 4:56 am 
Mark BucciarelliJan 21, 2005 1:02 pm 
Julian MehnleJan 21, 2005 3:03 pm 
Julian MehnleJan 24, 2005 8:15 am 
Gordon MessmerJan 26, 2005 10:51 am 
Gordon MessmerJan 26, 2005 12:53 pm.patch
Sam VarshavchikJan 26, 2005 4:22 pm 
Gordon MessmerJan 26, 2005 10:46 pm 
Alessandro VeselyJan 28, 2005 1:49 am 
Gordon MessmerJan 28, 2005 10:37 am 
Bill LongJan 29, 2005 3:42 pm 
Sam VarshavchikJan 29, 2005 4:51 pm 
Bill LongJan 29, 2005 5:29 pm 
Bill LongJan 30, 2005 1:23 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:[courier-users] ctlfile (was: Re: Courier::Filter 0.16Actions...
From:Alessandro Vesely (ves@tana.it)
Date:Jan 28, 2005 1:49:41 am
List:net.sourceforge.lists.courier-users

Gordon Messmer wrote:

Sam Varshavchik wrote:

I think that ctlfile should be opened for append mode.

...capital idea. Am I wrong to assume that all of the calls to open() in the openctl() function should have the same flags?

I'm not sure what you mean. And I wonder what sense may have to truncate and append at the same time. (And O_TRUNC is not needed on systems where O_CREAT | O_EXCL make the open fail in case the file already exists.)

[...] - O_WRONLY | O_TRUNC | O_CREAT | O_EXCL, + O_WRONLY | O_TRUNC | O_CREAT | O_EXCL | O_APPEND, PERMISSION);

An lseek(fd, 0, SEEK_END) upon return from the filter should suffice.

To make the question clear to all, I include an example of a cltfile I used to get the first times my filter attempted to write to it. Althought the ctlfile is flushed, its read/write pointer is not adjusted.

| sa@tana.it | fdns; north (north.tana.it [194.243.254.162]) | e | t | M0003024A.403B5AF6.0000359B | rcou@north.tana.it | R | N | E1078236505 | | p1077660505 | these 36 bytes overwrite the head of filter's output | W1077646105 | | ... tail of filter's output goes here | ... | A1077632052 | ...

where the first letter on each line is the data type (as defined in comctlfile.h)

N = COMCTLFILE_DSN is written by AddRecipient() that issues a sync(). E = COMCTLFILE_EXPIRES is written by closectl() after filtering. p = COMCTLFILE_FAXEXPIRES ditto W = COMCTLFILE_WARNING ditto A = COMCTLFILE_NEXTATTEMPT is not in submit2.C