LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   QMAIL/MAILDROP/PROCMAIL: obtaining the filename used to deliver the new mails (https://www.linuxquestions.org/questions/linux-software-2/qmail-maildrop-procmail-obtaining-the-filename-used-to-deliver-the-new-mails-365525/)

madhurtanwani 09-21-2005 05:01 AM

QMAIL/MAILDROP/PROCMAIL: obtaining the filename used to deliver the new mails
 
Hi,

I intend to use qmail(the MTA) along with maildrop/procmail(the MDA) to achieve delivery of incoming mails to "Maildir" format.

I've got a perfect install of qmail and maildrop and they work fine. However, in making the package suitable to my project requirements, I'm facing some problems. They are enlisted below with my efforts on resolving them :

1.> I am trying to figure out a way by which i would come to know the name by which qmail-local delivered a new mail.
Normally, it first writes the mail to a tmp directory and then moves it to the "new" directory in the maildir of the user. What i expect is to somehow find out the name of the file with which qmail-local module created the new mail.
I've found two plausible solutions - use FAM(File Alteration Monitor) to check if new files have been created in the "new" directory OR modify the qmail's qmail-local.c or maildrop's maildir/deliverquota.c to get the filename. The FAM approach seems heavy on the system and _may_ not be scalable to large number of user mail directories.

2.> On lines parallel to 1, the module of qmail which provided pop3 access to the users (qmail-pop3d) reads mails from the "new" directory and then moves the mail to a "cur" directory (after possibly changing the file name). I again expect to obtain the name of the file that was moved (the new name is more important).
It would also be fine if we could be able to _stop_ qmail-pop3d from moving the files from new to cur.
Again, one mechanism here is to modify qmail's qmail-pop3.c file to either _stop_ it from moving the file OR to get the new name of the file.

However, as you might have observed, these methods require changing the code of a stable and safe system. I was looking for methods/addons(patches?) for the modules which could perform this work. I'm trying to find out more about this.

In case, any one of you had a similar experience or could direct me to someone, it would e great!! Any pointer to information would be greatly appreciated!!

Anticipating a resolving reply,
Thanks,

mcleodnine 09-22-2005 09:54 AM

That, uhhh, an interesting question.

Have you had a look at the Maildir page yet?

madhurtanwani 09-23-2005 12:54 AM

Thanks, but no thanks - for the link.

If you check out the link, it only explains HOW the unique filenames are generated in a standard maildir implementation, as probably suggested by Dan.
However, if you've understood my question correctly, what i'm looking for is the unique filename itself, that was created by the mail delivery agent when it delivers the mail.

I've found a solution hint and intend to try out "safecat" as the delivery agent which returns the filename with which it stored the new mail.

I'll update this thread with anything else that i have so that other people may atleast have the solution (one i get it) ahead.

Thanks,


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