Question on implementing perl MIME::Parser using procmail/RHEL5.x(CentOS)
Hi folks,
I've been graciously provided with a script that should, when properly used, automatically strip out MIME attachments from emails and place them in a folder of my choosing. problem: I have no clue on how to implement this. This is a CentOS5.x server running sendmail/procmail and dovecot. Any suggestions or pointers to recommended reading will be greatly appreciated. Thanks, -Ray |
Generally speaking the Local Deliver Agent (commonly procmail) can drive scripts from its recipes to manipulate e-mail contents. But in absence of the posted script, shouldn't you ask the person who provided the script for instructions instead?
|
Quote:
The script is below...I should have thought to have posted it before. Code:
use MIME::Parser; Thanks for your reply and for your help! Regards, -Ray |
I could be wrong but it seems you only need to configure the $archive directory in the script, move the script to a directory that's in the globally accessable $PATH, add the "#!/path/to/perl" she-bang line and make it executable (octal 0755). Then your procmail recipe could look something like:
Code:
VERBOSE=on |
Hi unSpawn,
I added the required #!/usr/bin/perl, placed the script in /usr/bin, named it reports.pl. It is chmod'd to 0755. Added the recipe (after configuring the paths as needed). (btw, I'm doing this with webmin on CentOS 5.x) Then, sending an email with an attachment, I get this in the defined log file: Code:
# cat /var/log/procmail.log Code:
VERBOSE=on Thanks again for your help, -Ray |
To reply to my own post, I now have read more (thanks unSpawn for the pointers!) and understand that the mailbox to be targeted is where the .procmailrc file goes...
I'm still not getting the desired results, but I'm closer and that's a tremendous help. Thanks again...I will post results :) -R |
Quote:
Quote:
|
Quote:
|
All times are GMT -5. The time now is 12:07 AM. |