Re: [Exim] strip the mail on forwarding.

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Vadim Vygonets
Date:  
À: exim-users
Sujet: Re: [Exim] strip the mail on forwarding.
Quoth Ilya on Fri, Jan 12, 2001:
> Hi. We have several users with wireless phone, which are able to recieve
> email. But this email must not be larger than certain number of characters.
> Is it possible to orginize forwarding so that the mail be cut off by exim?
> we want to deliver at least first couple of lines, so that users will know
> who is contacting them.


It doesn't seem possible to cut it inside Exim. You can pipe the
message to a simple script that will do it for you and then send
the message to the gateway.

The e-mail-to-SMS gateway of my provider cuts the messave
automatically, but I avoid sending really long messages to it
(because long messages usually consist mostly of binary
attachments). Here are the relevant lines from my .forward:

if delivered then finish endif
if personal
    alias another@address
    alias yet@??? then
#    vacation subject "Vadik is away"
    if "${if >{$message_size}{100K}{big}{small}}" is "small" then
        unseen deliver 972xxxxxxx@???
    endif
    finish
endif


All this is after mailing list processing. Still, if you reply
to this message and include my address in To: or Cc:, I will
receive two copies of the message. The "mailing list" copy will
be delivered to the mailing list folder, and the "presonal" copy
will go to the personal folder after spawning another copy which
will make my phone buzz (assuming the gateway is up, which is not
always so).

Anyway... Write a simple script which will receive the message
on stdin, pipe all the headers and a couple of lines from the
body to "|/usr/sbin/sendmail -oi -oem -f '<>' the@???", and
discard the rest. Call it from the Exim filter using the "unseen
pipe" clause, or from the Exim config file somehow.
Generalization is left as an exercise to the reader.

Vadik.

--
Real software engineers don't debug programs, they verify correctness.
This process doesn't necessarily involve execution of anything on a
computer, except perhaps a Correctness Verification Aid package.