Hi , I use this trick to move attachment from email with procmail and metamail .
It works fine ... If some one want to check ...
I mod. the master.cf file into:
smtp inet n - n - - smtpd
-o content_filter=filter
and before amavis conf I add:
filter unix - n n - - pipe
flags=Rq user=filter argv=/usr/bin/procmail -Y -m /etc/procmailrcs/master.rc ${sender} ${recipient}
I save and exit.
I have installed both procmail and metamail from apt-get install ( I use ubuntu 8.0.4).
I had create a file inside a directory /etc/procmailrcs/master.rc :
SHELL=/bin/sh
MAILDIR=/usr/local/virtual/
DATE = `date +%Y`
METAMAIL_TMPDIR=/home/fax/
KEYIGNHEADS=Content-Type:Content-Transfer-Encoding:Content-Transfer-Encoding:Content-Disposition:Content-Id
DROPPRIVS=YES
LINEBUF=32768
#SENDMAILFLAGS="-oi"
DROPPRIVS=yes
LOGFILE=/var/log/procmail.log
VERBOSE=yes
FROM="<$1>"
SHIFT=1
:0cbhHB:
* ^from.*@fax.fax
* ^TO.fax@mycompany.com
| /usr/bin/metamail -q -w -x -r
:0
! -f $FROM "$@"
I put this file in read only--:
-r-------- 1 root root 451 2009-04-23 16:48 master.rc
I add user filter to /etc/passwd :
filter:*:952:952:filter:/dev/null:/dev/null
I had linked: /opt/zimbra...../sendmail to /usr/sbin/sendmail for sendmail from filter to zimbra .
And when I recive a fax from
fax@fax.fax to my user
fax@mycompany.com ,
the fax is moved to my /home/fax shared in samba.
If some one have a questions or comment.... Tank you