procmail
[Top] [All Lists]

Re: Attachement not properly saved by my procmail

2006-11-08 05:29:58
Salut Didier,

a little bit late, but not seen a singel answer to your post...

Am 2006-10-15 02:26:59, schrieb Didier Dran:

HI !

I am working on FreeBSD pasteur.alize-sfl.com 4.4-STABLE FreeBSD 
4.4-STABLE #1: Sun Oct 21 14:48:03 CEST 2001 with  postfix as MTA.
Everyday I receive a mail with an attachement saved and treated by an 
traitemail.
Here the procmailrc file with an forward file followed:
|/usr/local/bin/procmail
###################################
#fichier de config du procmail du compte giestock acheminant le stock 
gie sur Nation
VERBOSE=yes
SHELL=/bin/sh
PATH=/bin:/usr/bin:/usr/local/bin
MAILDIR=/home/giestock/Mail
ORGMAIL=$MAILDIR/probleme
LOGMAIL=$MAILDIR/.procmailrc.log


:0 HBbc
* ^Subject:.*stock*
`Content-Type:.*name=.*\.dat` giestock.dat.$$
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    Whats this?  -  It produce an error here
    because it can not execute it.

:0 HBabc
* ^Subject:.*stock*
| /home/giestock/traitemail

:0 Hbc
* ^Subject:.*stock*
! ddran(_at_)sfl(_dot_)com
#################################
I have to send again everyday to the user GIESTOCK the mail and 
attachement in order to obtain  an attachement saved this way:
su-2.05$ more Mail/giestock.dat.23924

Why not do simpel:

:0
* ^Subject:.*stock*
{
#  :0
#  `Content-Type:.*name=.*\.dat` giestock.dat.$$

  :0c
  |/home/giestock/traitemail

  :0
  ! ddran(_at_)sfl(_dot_)com
}

Here is the way the attachement is saved:



--NEXT_PART_1_1152036003_230_3562
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable



--NEXT_PART_1_1152036003_230_3562
Content-Type: application/octet-stream; name="STOCKGIE"; type=Binary
                                            ^^^^^^^^^^^^^^^^
    While reading quickly the specs, this has nothing to do here.

Content-Disposition: attachment; filename="STOCKGIE"
                                     ^^^^^^^^^^^^^^^^^^^
    This is the correct way.  While greping my archive of 26 Gbytes
    of messages I have found only arround 180 messages using "name=".

Content-Transfer-Encoding: base64

MDcxNDI2N

    Why encoding?

If you have any idea of how writing the procmailfile, I am not sure of 
the first action line Iwrote:
`Content-Type:.*name=.*\.dat` giestock.dat.$$
thank you in advance for an helping hand
Dran Didier

I would integrate this stuff into "traitemail" using mimedecode
to unpack the message in several parts to a tempdir and then and
since the name is always "STOCKGIE" pick it up with

    mv ${TMPDIR}/STOCKGIE /home/giestock/data/$(date +%s).dat

and you have all data files sorted by the serial date.

Greetings
    Michelle Konzack
    Systemadministrator
    Tamay Dogan Network
    Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack   Apt. 917                  ICQ #328449886
                   50, rue de Soultz         MSM LinuxMichi
0033/6/61925193    67100 Strasbourg/France   IRC #Debian (irc.icq.com)


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>
  • Re: Attachement not properly saved by my procmail, Michelle Konzack <=