🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
13 messages
13 total messages Started by Lolodirezo Wed, 04 Feb 2004 11:45
mail2news question
#67875
Author: Lolodirezo
Date: Wed, 04 Feb 2004 11:45
10 lines
1297 bytes
Hello,
i use mail2news.pl and it works but i would like if there is a
solution to keep a mail copy( actually headers rewrite ).
there is another problem, if the mailer is outlook express for
exemple, the mail is in html format, how is it possible to convert
html to text.

Thanks for your help.

Best regards.
Re: mail2news question
#67874
Author: Jeffrey M. Vinocur
Date: Wed, 04 Feb 2004 11:49
20 lines
1714 bytes
In article <92f11979.0402040345.125543fc@posting.google.com>,
Lolodirezo <laurent.bazin@free.fr> wrote:
>
>i use mail2news.pl and it works but i would like if there is a
>solution to keep a mail copy( actually headers rewrite ).

I don't understand what you're asking here.


>there is another problem, if the mailer is outlook express for
>exemple, the mail is in html format, how is it possible to convert
>html to text.

I don't know offhand of any tools for doing this.  I expect
there's an appropriate Perl module, for example, but no idea
which it would be.

-- 
Jeffrey M. Vinocur
jeff@litech.org
Re: mail2news question
#67877
Author: Lolodirezo
Date: Wed, 04 Feb 2004 16:15
10 lines
1291 bytes
Thank you for your answer.

Excuse me for my poor english.

In my first question, i want to say mail2news.pl convert the mail
headers in nntp format, so the incoming mail disappears and become a
news.


best regards.
Re: mail2news question
#67881
Author: Dr.Ruud
Date: Thu, 05 Feb 2004 03:47
12 lines
1518 bytes
Toen ik Lolodirezo kietelde, kwam er dit uit:

> if the mailer is outlook express for
> exemple, the mail is in html format, how is it possible to convert
> html to text.

   | lynx -dump -forc_html -stdin

-- 
Affijn, Ruud

Re: mail2news question
#67882
Author: Lolodirezo
Date: Thu, 05 Feb 2004 10:25
35 lines
2468 bytes
"Dr.Ruud" <'t.leven.is.fijn@life.i$.great> wrote in message news:<bvshvc.128.1@news.isolution.nl>...
> Toen ik Lolodirezo kietelde, kwam er dit uit:
> 
> > if the mailer is outlook express for
> > exemple, the mail is in html format, how is it possible to convert
> > html to text.
>  
>    | lynx -dump -forc_html -stdin

hello,
thanks to help me.
cat file.html|lynx -dump -force_html -stdin is working but my problem
is with a mail, i just want to extract the text from the mail (purge
the html and the lines like ---=, Content-Type: ), to make the message
readable my newsgroups.

Here is a source mail sample from outlook express.

------=_NextPart_000_00B9_01C3EA5F.8B0A5A10
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
the text
------=_NextPart_000_00B9_01C3EA5F.8B0A5A10
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html;
charset=3Diso-8859-1"=>
<META content=3D"MSHTML 6.00.2800.1226" name=3DGENERATOR>
<STYLE></STYLE></HEAD>
<BODY bgColor=3D#ffffff><DIV align=3Dcenter><FONT face=3DArial
size=3D2>c<EM>d</EM><FONT=20color=3D#ff0000><EM>qf</EM>the
text</FONT></FONT></DIV></BODY></HTML>
------=_NextPart_000_00B9_01C3EA5F.8B0A5A10--
Re: mail2news question
#67883
Author: Dr.Ruud
Date: Thu, 05 Feb 2004 15:51
23 lines
2140 bytes
Toen ik Lolodirezo kietelde, kwam er dit uit:
> Dr.Ruud:
>> Lolodirezo:

>>> how is it possible to convert html to text.

>>    | lynx -dump -forc_html -stdin

> cat file.html|lynx -dump -force_html -stdin is working but my problem
> is with a mail, i just want to extract the text from the mail (purge
> the html and the lines like ---=, Content-Type: ), to make the message
> readable my newsgroups.

I would use procmail and disarm the message before delivery.
In the OE-case you can just throw away the html-part, and
convert the QP-part to ASCII or ISO-8859-1(5).

google: procmail luynx dump

-- 
Affijn, Ruud

Re: mail2news question
#68052
Author: Lolodirezo
Date: Tue, 10 Feb 2004 21:55
52 lines
2581 bytes
hello,
Thanks a lot for your very goods informations.
google: procmail lynx dump give me a marvellous article about
/etc/procmailrc.
my mail2news works when the mail sent with ximin evolution  in html
mode but with mozilla mailer oo outlook express
i got an error (extract from /var/log/procmail.log):

munpack: reading from standard input
Can't send article to the server:
        441 437 EMP rejected (ph/l)
(Article not posted.)
procmail: Program failure (1) of " munpack -t -C $DIR && \
lynx -dump -force_html $DIR/part1 | \
/mail2news.pl mygroup "$SUBJ" "$FROM" && \
rm -r $DIR/*"

my /etc/procmailrc:
SUBJ=`formail -c -xSubject:`
FROM=`formail -c -xFrom:`

DIR=/var/.../myemail/.procmail
:0w
* ^TOmyemail@mydomain.fr
{
:0wb
* ^Content-Type: text/html.*
| lynx -dump -foce_html -stdin | \
/mail2news.pl mygroup "$SUBJ" "$FROM"

:0w
* ^Content-Type: multipart/alternative.*
| munpack -t -C $DIR && \
lynx -dump -force_html $DIR/part2 | \
/mail2news.pl mygroup "$SUBJ" "$FROM" && \
rm -r $DIR/*

:0w
* ^Content-Type: multipart.*
| munpack -t -C $DIR && \
lynx -dump -force_html $DIR/part1 | \
/mail2news.pl mygroup "$SUBJ" "$FROM" && \
rm -r $DIR/*
}

i modified mail2news because after filters (munpack and lynx), i lost
the subject and the from (so i save the values in /etc/procmailrc to
restore then in mail2news.pl)

have you got an idea ?

Thanks again (;0)
Re: mail2news question
#68059
Author: Dr.Ruud
Date: Wed, 11 Feb 2004 03:26
132 lines
4773 bytes
Toen ik Lolodirezo kietelde, kwam er dit uit:

> Thanks a lot for your very goods informations.
> google: procmail lynx dump give me a marvellous article about
> /etc/procmailrc.

Be careful with /etc/procmailrc, it runs as root.
Normally you would use a .procmailrc (dot-promailrc)
in the user's home. See als DROPPRIVS in man procmailrc.

Did you find this?
http://www.xray.mpe.mpg.de/mailing-lists/procmail/2002-06/msg00291.html


> my mail2news works when the mail sent with ximin evolution  in html
> mode but with mozilla mailer oo outlook express
> i got an error (extract from /var/log/procmail.log):
>
> munpack: reading from standard input
> Can't send article to the server:
>         441 437 EMP rejected (ph/l)
> (Article not posted.)
> procmail: Program failure (1) of " munpack -t -C $DIR && \
> lynx -dump -force_html $DIR/part1 | \
> /mail2news.pl mygroup "$SUBJ" "$FROM" && \
> rm -r $DIR/*"
>
> my /etc/procmailrc:
> SUBJ=`formail -c -xSubject:`

or (more efficiently)
  :0
  * ^Subject:[  ]\/[^  ].*
  { SUBJ = $MATCH" }
(where both [  ] and [^  ] contain a literal space and tab)

> FROM=`formail -c -xFrom:`

For how to get a clean From:address, see
  http://www.professional.org/procmail/sandbox.html


> DIR=/var/.../myemail/.procmail
> :0w
> * ^TOmyemail@mydomain.fr

The ^TO_ macro is better for full addresses.
See man procmailrc for the difference.


> {
>   :0wb
>   * ^Content-Type: text/html.*
>   | lynx -dump -foce_html -stdin | \
>     /mail2news.pl mygroup "$SUBJ" "$FROM"

fo[r]ce_html ?

Add LOGging:

NL="
"
TAB="    "  # a literal tabcharacter (ASCII-9) between ""

   :0
   * ^Content-Type: text/html
   {
     LOG =
"$$${TAB}S:${SUBJ}${NL}${TAB}F:${FROM}${NL}${TAB}C:text/html${NL}"
     :0wb
     | lynx -dump -force_html -stdin | \
       /mail2news.pl mygroup "$SUBJ" "$FROM"
   }


>   :0w
>   * ^Content-Type: multipart/alternative.*
>   | munpack -t -C $DIR && \
>     lynx -dump -force_html $DIR/part2 | \
>     /mail2news.pl mygroup "$SUBJ" "$FROM" && \
>     rm -r $DIR/*
>
>   :0w
>   * ^Content-Type: multipart.*
>   | munpack -t -C $DIR && \
>     lynx -dump -force_html $DIR/part1 | \
>     /mail2news.pl mygroup "$SUBJ" "$FROM" && \
>     rm -r $DIR/*
> }

There is no need for a .* at the end of any condition line,
unless the \/ match-operator is used.
Make sure that there are no spaces after any continuation-backslash.


> i modified mail2news because after filters (munpack and lynx), i lost
> the subject and the from (so i save the values in /etc/procmailrc to
> restore then in mail2news.pl)
>
> have you got an idea ?

Not yet. Maybe the 'rm -r' fails, did you try 'rm -f'?

Check the logs of the newsserver about the
  441 437 EMP rejected (ph/l)

The first recipe doesn't use $DIR, is that the one
that evolution uses?

I assume that your directory /var/.../myemail/.procmail
exists. (see also MAILDIR in man procmailrc)

Try Sean's sandbox-approach first.

Put the 'rm -f $DIR/*' in TRAP.

Add some LOG="$$ blabla$NL" lines to your recipes,
where NL is defined as:

NL="
"

Use $$ (the PID) as part of temporary filenames,
but better try to get rid of any temp-files at all
(which needs a munpack-version that can put a specified
part on stdout). (or use lockfiles, several procmails
can and will run concurrently)

-- 
Affijn, Ruud

Re: mail2news question
#68188
Author: Lolodirezo
Date: Fri, 20 Feb 2004 13:35
13 lines
1617 bytes
> > munpack: reading from standard input
> > Can't send article to the server:
> >         441 437 EMP rejected (ph/l)
> > (Article not posted.)

OK all is good, thank you very much for your help.
i change /etc/news/cleanfeed.conf
'aggressive' => 0,
'do_phl' => 0,

a last question, in the case i receive a mail with a attachment, what to do ?

best regards.
Re: mail2news question
#68197
Author: Dr.Ruud
Date: Fri, 20 Feb 2004 21:57
21 lines
1897 bytes
Toen ik Lolodirezo kietelde, kwam er dit uit:

>>> munpack: reading from standard input
>>> Can't send article to the server:
>>>         441 437 EMP rejected (ph/l)
>>> (Article not posted.)

> OK all is good, thank you very much for your help.

OK.

> [...]
> a last question, in the case i receive a mail with a attachment,
> what to do ?

Eliza: what would you like to do with it?

-- 
Affijn, Ruud

Re: mail2news question
#68201
Author: Lolodirezo
Date: Sat, 21 Feb 2004 07:29
5 lines
1598 bytes
actually, when i receive  a mail with a attachment, this mail is not
transmit to the news server, i find it in the incoming mailbox.
i would like to see the mail in the newsgroup with the attachment (an
external link to my httpd server)
sample: http://myserver/theattachment
Re: mail2news question
#68204
Author: Jeffrey M. Vinocur
Date: Sat, 21 Feb 2004 11:25
16 lines
1929 bytes
In article <92f11979.0402202329.468fb26d@posting.google.com>,
Lolodirezo <laurent.bazin@free.fr> wrote:
>actually, when i receive  a mail with a attachment, this mail is not
>transmit to the news server, i find it in the incoming mailbox.
>i would like to see the mail in the newsgroup with the attachment (an
>external link to my httpd server)
>sample: http://myserver/theattachment

I don't know of any news server utility that does that.  You may
be able to locate one from the mail server community (or the Perl
community?), or you may need to roll your own.


-- 
Jeffrey M. Vinocur
jeff@litech.org
Re: mail2news question
#68230
Author: Dr.Ruud
Date: Sun, 22 Feb 2004 02:46
24 lines
2308 bytes
Toen ik Lolodirezo kietelde, kwam er dit uit:

> actually, when i receive  a mail with a attachment, this mail is not
> transmit to the news server, i find it in the incoming mailbox.
> i would like to see the mail in the newsgroup with the attachment (an
> external link to my httpd server)
> sample: http://myserver/theattachment

What I understand is, that if the mail message has attachments,
you want to store the attachments as readable files on your
webserver, and add URLs to the message so that the newsclient-
user can later choose to click on them.

It is something that is actually done often by postmasters,
search the procmail-archive mentioned on http://www.procmail.org
for examples.

You want to use this:
http://www.xs4all.nl/~rjscheer/stripmultiparts/

-- 
Affijn, Ruud

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads