LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-28-2014, 06:36 AM   #1
NightStalkerX6
LQ Newbie
 
Registered: Feb 2003
Posts: 6

Rep: Reputation: 0
Postfix / Procmail issue


I thought this would be simple, but I've been at it for hours and don't understand. I wanted procmail to pipe new emails to uudeview and automatically decode jpg attachments to a folder.

It ALMOST works, except it will only decode the second-to-last email, after a new one comes in. Example: I send myself a test image, nothing, the second i send another image, the FIRST one decodes, and the new one doesn't, until i send another one, and so forth.

Any idea what could be causing this? On a side note, though less crucial, It seems to decode ALL previous emails again and again, because the timestamps keep becoming the same. The ultimate goal is the newest jpg emailed will update on an apache webserver.

~/.procmailrc
Code:
PATH=/bin:/usr/bin:/usr/local/bin
MAILDIR=/var/mail
DEFAULT=/var/mail/me
SHELL=/bin/sh

:0
* ^To:.*me@mydomain.com
* ^From:.*my@gmail.com
| uudeview +e .jpg -p /home/me/attach -i /var/mail/me
 
Old 03-28-2014, 03:24 PM   #2
NightStalkerX6
LQ Newbie
 
Registered: Feb 2003
Posts: 6

Original Poster
Rep: Reputation: 0
It seems like it's something with the action pipe, if I'm just forwarding to another email with:
Code:
:0
* ^To:.*me@mydomain.com
* ^From:.*my@gmail.com
junkmail
It will send it to junkmail everytime, but the action pipe takes 2 emails to process the last one.
 
Old 03-28-2014, 08:33 PM   #3
NightStalkerX6
LQ Newbie
 
Registered: Feb 2003
Posts: 6

Original Poster
Rep: Reputation: 0
Still couldn't figure it out. Here's the work around I used in case anybody is curious:

-I have procmail putting everything from a specific email into "attach" just like the previous post with "junkmail"
-I have a cronjob that runs the following bash script every minute, looking to see if "attach" exists, if so continues the script:

Code:
#!/bin/bash

if [ -e "/var/mail/attach" ]
then
uudeview +e .jpg -p /home/me/attach -i /var/mail/attach
wait ${!}
mv /home/me/attach/*.jpg /var/www/attach/attach.jpg
wait ${!}
chmod 777 /var/www/attach/attach.jpg
wait ${!}
rm /var/mail/attach
fi
Not the prettiest solution in the world, but it works like I need it to!
 
  


Reply

Tags
attachments, postfix, procmail



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PROCMAIL+POSTFIX - Vacation Mail issue arjuns8471 Linux - Newbie 4 02-26-2009 11:12 PM
procmail Autoresponder for Postfix javed_dogar Linux - Server 8 09-25-2008 11:44 PM
Need help POSTFIX,PROCMAIL tkmuthuvel Linux - General 9 04-18-2006 11:31 PM
need Procmail or postfix information tkmuthuvel Linux - Networking 1 04-11-2006 11:35 AM
Using Procmail with Postfix jomy Linux - Networking 1 06-05-2005 09:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration