[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: KMail and Message-ID: header field



Hendrik Sattler <ubq7@rz.uni-karlsruhe.de> writes:

> Am Mittwoch, 19. September 2001 09:42 schrieb Frank Mehnert:
> > On Tuesday 18 September 2001 21:17, Hendrik Sattler wrote:
> > > is there any known way to tell kmail that the smtp-server shall create
> > > the Message-ID: header field and _NOT_ kmail itself?
> >
> > Good question but I don't know. Because kmail (2.1.1 on potato) creates
> > buggy message id's (only hostname without domain - in my case "noys"
> > instead of "noys.inf.tu-dresden.de"), I've createt a small shell script
> > which appends the missing stuff:
> >
> > #!/bin/sh
> > /bin/sed "s/\(^Message-Id:.*\)noys/\1noys.inf.tu-dresden.de/g" \
> >
> >   | usr/sbin/sendmail $*
> >
> > This script is called sendmail_hack. I've changed the location of sendmail
> > in settings to point to that script.
> 
> nice idea. A script now does what I want (with a small grep). Still an 
> improper situation because that may also remove lines in the mail body, not 
> just the header :-/

You could easily fix that in the above sendmail_hack.  Something like
this ought to work:

  /bin/sed -e 's/\(^Message-Id:.*\)noys/\1noys.inf.tu-dresden.de/g' \
           -e '/^$/!b' \
           -e ':body
               {
               n
               bbody
               }' \
        | /usr/sbin/sendmail $*

This'll do whatever you want to the header and as soon as it hits the
empty line separating header and body spits out the rest unchanged in
the :body loop.

BTW, I thought that mail headers were case insensitive, so you may
want to take that into account when rewriting header fields.

> The change to FQHN can also be done by changing the content of /etc/hostname 
> to the FQHN (at least it did here).

-- 
Olaf Meeuwissen       Epson Kowa Corporation, Research and Development



Reply to: