Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 648 of 807  Not logged in ELOG logo
ID Date Icon Author Author Email Category OS ELOG Versiondown Subject
  928   Thu Feb 10 09:03:02 2005 Entry Michael Husbynmichaelh@online.noQuestionLinux2.5.6-1MIME encoding of mail?
Hello,

This software is very good :) I like it, but I have some trouble with some
emails that I send from the system.

It seems that Outlook 2000 does not handle norwegian characters in the
Subject field when sending mails. We have Exchange and I don't know what
SMTP server that fetches mail from. We are sending mail out via sendmail on
RedHat ES V3 server.

Example (what it should be)

Subject: Testing ורז

Becomes
Subject: IKT sak =?UNKNOWN?B?KDYwKTo=?= Testing =?UNKNOWN?B?5fjm?=

config:
Use Email Subject = IKT sak ($message id): $Tittel

Ofcource this is only happens in Outlook. Sending to gmail reports it OK.
I've also seen that mutt sometimes replaces the  ורז with ? at my Linux
system at home.

Ofcource all this could be due to misconfigured clients. Outlook receives
mails with ורז fine when send from allmost all other systems.

I've suspect that this could be some old 7 bit / 8 bit problem or that the
mail is not properly encoded in MIME format?

If i send mail without any ורז characters in subject the subject is
displayed the way it should be.

Not a big problem though, not sure that it has been reportet before.
Searched for mime and found nothing useful.


Have a nice day!


Best regards
Michael
  936   Sat Feb 12 18:00:48 2005 Reply Stefan Rittstefan.ritt@psi.chQuestionLinux2.5.6-1Re: MIME encoding of mail?
What you can try is to debug the communication between elogd and the SMTP
server. Just turn on logging via

Logfile = log.txt
Logging level = 3

After sending email, you see the conversation in log.txt. Maybe this gives you
some hints.
  1091   Fri Apr 15 21:14:05 2005 Reply Stefan Rittstefan.ritt@psi.chQuestionLinux2.5.6-1Re: MIME encoding of mail?
> Subject: Testing ורז
> 
> Becomes
> Subject: IKT sak =?UNKNOWN?B?KDYwKTo=?= Testing =?UNKNOWN?B?5fjm?=
> 
> config:
> Use Email Subject = IKT sak ($message id): $Tittel

You could put the encoding there manually:

Use Email Subject = =?ISO-8859-1?Q?IKT sak ($message id): $Tittel?=

would this work?
  902   Sun Feb 6 04:12:52 2005 Entry John Habermannjohn.habermann@wilderness.org.auBug reportLinux2.5.6+r154$user_email variable causes problems in Use Email From setting
I am running into problems when I try and use the

Use Email From = $user_email 

setting in my individual logbook configs. I had to set this field as I set a 

Use Email From = real_email_address 

in my global config so that the email would be sent out by the
CommunigatePro mail server.

When I made those changes though the mail was not sent and I got the
following errors in the elog log:

06-Feb-2005 13:48:34 [john@137.219.117.245] {Elog} NEW entry #0
06-Feb-2005 13:48:34 [john@137.219.117.245] {Elog} Email from
john.habermann@wilderness.org.au to john.habermann@wilderness.org.au,
SMTP host localhost:
06-Feb-2005 13:48:34 [john@137.219.117.245] {Elog} 220
tanami.wilderness.org.au ESMTP CommuniGate Pro 4.2.8 is glad to see you!
06-Feb-2005 13:48:34 [john@137.219.117.245] {Elog}
06-Feb-2005 13:48:34 [john@137.219.117.245] {Elog} HELO tanami.wilderness.org.au
06-Feb-2005 13:48:34 [john@137.219.117.245] {Elog} 250
tanami.wilderness.org.au your name is not tanami.wilderness.org.au
06-Feb-2005 13:48:34 [john@137.219.117.245] {Elog} MAIL FROM:
john.habermann@wilderness.org.au
06-Feb-2005 13:48:34 [john@137.219.117.245] {Elog} 555 syntax error in MAIL
FROM parameters
06-Feb-2005 13:48:34 [john@137.219.117.245] {Elog} RCPT TO:
<john.habermann@wilderness.org.au>
06-Feb-2005 13:48:34 [john@137.219.117.245] {Elog} 501 Unknown command
06-Feb-2005 13:48:34 [john@137.219.117.245] {Elog} DATA
06-Feb-2005 13:48:34 [john@137.219.117.245] {Elog} 501 Unknown command
06-Feb-2005 13:48:34 [john@137.219.117.245] {Elog} To:
john.habermann@wilderness.org.au
06-Feb-2005 13:48:34 [john@137.219.117.245] {Elog} From:
john.habermann@wilderness.org.au
Subject: [twslog: Elog] will it work on tanami from konqueror
06-Feb-2005 13:48:34 [john@137.219.117.245] {Elog} X-Mailer: Elog, Version
2.5.6-1
06-Feb-2005 13:48:34 [john@137.219.117.245] {Elog} X-Elog-URL:
http://tanami.wilderness.org.au:8080/Elog/36
06-Feb-2005 13:48:34 [john@137.219.117.245] {Elog} X-Elog-submit-type: web|elog
06-Feb-2005 13:48:34 [john@137.219.117.245] {Elog} Date: Sun, 06 Feb 2005
13:48:34 +1100
06-Feb-2005 13:48:34 [john@137.219.117.245] {Elog} Content-Type: TEXT/PLAIN;
charset=US-ASCII

06-Feb-2005 13:48:34 [john@137.219.117.245] {Elog} .
06-Feb-2005 13:48:34 [john@137.219.117.245] {Elog} 501 Unknown command
06-Feb-2005 13:48:34 [john@137.219.117.245] {Elog} QUIT
06-Feb-2005 13:48:34 [john@137.219.117.245] {Elog} 501 Unknown command

It looks like Communigate Pro doesn't like what is being put in the From as
it complains about the syntax. 

I tried the same elog.conf file on my laptop which uses a qmail server as
its SMTP and the mail was sent ok but I got mailto appearing in the from
header. I saw that elog:333 reported a similar problem but this was listed
as fixed. This is the headers from a message sent by the qmail server:

X-Gmail-Received: 04395b7bf4189dd6e4c23606ee6adbd5fdcb0e53
Delivered-To: john.haberman@gmail.com
Received: by 10.54.43.19 with SMTP id q19cs16478wrq;
        Sat, 5 Feb 2005 18:44:47 -0800 (PST)
Received: by 10.54.43.11 with SMTP id q11mr64342wrq;
        Sat, 05 Feb 2005 18:44:47 -0800 (PST)
Return-Path: <john.habermann@wilderness.org.au>
Received: from mx-1.netregistry.net (mx-1.netregistry.net [203.202.16.27])
        by mx.gmail.com with ESMTP id 33si43805wra.2005.02.05.18.44.45;
        Sat, 05 Feb 2005 18:44:47 -0800 (PST)
Received-SPF: neutral (gmail.com: 203.202.16.27 is neither permitted nor
denied by best guess record for domain of
john.habermann@wilderness.org.au)
Received: from mail.ngogeeks.com ([216.17.101.59])
	by mx-1.netregistry.net with esmtp (Exim 4.20 #2 (Debian))
	id 1CxcPj-0003zY-Io
	for <john.habermann@wilderness.org.au>; Sun, 06 Feb 2005 13:44:43 +1100
Received: (qmail 5486 invoked by uid 1021); 6 Feb 2005 00:45:04 +0000
Received: from john.habermann@wilderness.org.au by ngogeeks.com by
uid 1012 with qmail-scanner-1.22-st-qms 
 (clamdscan: 0.75. spamassassin: 2.20.  Clear:RC:1(10.3.0.2):. 
 Processed in 0.363281 secs); 06 Feb 2005 00:45:04 -0000
X-Antivirus-MYDOMAIN-Mail-From: john.habermann@wilderness.org.au via
ngogeeks.com
X-Antivirus-MYDOMAIN: 1.22-st-qms (Clear:RC:1(10.3.0.2):. Processed in
0.363281 secs Process 5482)
Received: from unknown (HELO localhost) (10.3.0.2)
  by mail.ngogeeks.com with SMTP; 6 Feb 2005 00:45:03 +0000
To:
john.habermann@wilderness.org.au
From: john.habermann@wilderness.org.au
Subject: [twslog: Email] test of new elog version
X-Mailer: Elog, Version 2.5.6-1
X-Elog-URL: http://localhost:8080/Email/79
X-Elog-submit-type: web|elog
Date: Sun, 06 Feb 2005 13:43:31 +1000
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Antivirus-MYDOMAIN-1.22-st-qms: added fake MIME-Version header
MIME-Version: 1.0
X-Antivirus-MYDOMAIN-Message-ID: <11076507048355482@ngogeeks.com>
Message-Id: <E1CxcPj-0003zY-Io@mx-1.netregistry.net>
X-Spam-Score: 0.3 (/)
X-Scanner: exiscan for exim4 (http://duncanthrax.net/exiscan/)
*1CxcPj-0003zY-Io*13Qgra0rAPA*

A new entry has been submitted on localhost

Logbook             : Email
Author              : John Habermann
Subject             : test of new elog version
Type                : Other
Todo                : 

Logbook URL         : http://localhost:8080/Email/79

=================================

Testing 
  903   Sun Feb 6 12:44:03 2005 Reply Stefan Rittstefan.ritt@psi.chBug reportLinux2.5.6+r154Re: $user_email variable causes problems in Use Email From setting
> header. I saw that elog:333 reported a similar problem but this was listed
> as fixed.

Yes, this was fixed in revision 1.550 of elogd.c. You apparently have revision 1.54x
which does not yet contain the patch. You need to donwload the newest version from
CVS and compile it by hand (or wait for the next major release).
  925   Tue Feb 8 17:40:54 2005 Idea Emiliano GabrielliAlberT@SuperAlberT.itBug fixAll2.5.6 cvs[patch]: fixed wrong extention check
current version uses strstr() to check if the file has the expected ascii
text extension ... this is buggy becouse this way a file named
".txt_hidden_file" or "foo.config.dat" are both seen as .txt files.

the following patch fixes the problem, plz apply to cvs:



#######################################################################
--- elogd_orig.c        2005-02-03 16:46:10.000000000 +0100
+++ elogd_extchk_fix.c  2005-02-08 17:32:21.000000000 +0100
@@ -1160,6 +1160,28 @@

 #define my_toupper(_c)    ( ((_c)>='a' && (_c)<='z') ? ((_c)-'a'+'A') : (_c) )

+static BOOL chkext(const char *str, const char *ext)
+{
+   int extl, strl;
+   char c1, c2;
+
+   if (ext == NULL || str == NULL)
+      return FALSE;
+
+   extl = strlen(ext);
+   strl = strlen(str);
+   if (extl >= strl)
+      return FALSE;
+   str = str+strl-extl;
+   while (*str) {
+      c1 = *str++;
+      c2 = *ext++;
+      if (my_toupper(c1) != my_toupper(c2))
+         return FALSE;
+   }
+   return TRUE;
+}
+
 BOOL strieq(const char *str1, const char *str2)
 {
    char c1, c2;
@@ -1168,6 +1190,8 @@
       return TRUE;
    if (str1 == NULL || str2 == NULL)
       return FALSE;
+   if (strlen(str1)!=strlen(str2))
+      return FALSE;

    while (*str1) {
       c1 = *str1++;
@@ -13698,8 +13722,8 @@
                       ("<tr><td colspan=%d class=\"attachment\">%s %d: <a
href=\"%s\">%s</a>\n",
                        colspan, loc("Attachment"), index + 1, ref,
attachment[index] + 14);

-                  if ((strstr(str, ".TXT") || strstr(str, ".ASC") ||
strstr(str, ".CFG")
-                       || strstr(str, ".CONF")
+                  if ((chkext(str, ".TXT") || chkext(str, ".ASC") ||
chkext(str, ".CFG")
+                       || chkext(str, ".CONF")
                        || strchr(str, '.') == NULL) && show_attachments) {
                      /* display attachment */
                      rsprintf("</td></tr><tr><td colspan=%d
class=\"messagelist\"><pre>", colspan);
@@ -14779,7 +14803,7 @@
    regex_t re_buf[MAX_N_ATTR + 1];
    regmatch_t pmatch[10];

-   /* redirect if enpty parameters */
+   /* redirect if empty parameters */
    if (strstr(_cmdline, "=&")) {
       while ((pt1 = strstr(_cmdline, "=&")) != NULL) {
          pt2 = pt1;
#######################################################################
  926   Tue Feb 8 19:04:25 2005 Blink Emiliano GabrielliAlberT@SuperAlberT.itCommentLinux2.5.6 cvs[patch] Re: images attached shown as inline
> > uhm ok .. can I expect to get a release with this feature in the near future ?
> 
> I checked how I would do that and did not find a good solution. If I put a
> 
> <img width=300 ...> 
> 
> for example, this scales down a big picture to only 300 pixels width. But if you submit a small
> picture, like just an icon, it blows it up to 300 pixels as well, which does not look nice.
> Unfortunatle I don't know of any option like "maxwidth=x" which only scales pictures down if they
> are larger than x. Do you know?

the following patch should do the job:


#################################################################################
--- elogd_orig.c        2005-02-03 16:46:10.000000000 +0100
+++ elogd_imgscale.c    2005-02-08 18:58:14.000000000 +0100
@@ -13690,9 +13690,14 @@
                       ("<tr><td colspan=%d class=\"attachment\">%s %d: <a href=\"%s\">%s</a>\n",
                        colspan, loc("Attachment"), index + 1, ref, attachment[index] + 14);
                   if (show_attachments)
-                     rsprintf
-                         ("</td></tr><tr><td colspan=%d class=\"messagelist\"><img
src=\"%s\"></td></tr>",
-                          colspan, ref);
+                     if (!getcfg(lbs->name, "Attached image width", str, sizeof(str))) {
+                        rsprintf("</td></tr><tr><td colspan=%d class=\"messagelist\"><img
src=\"%s\"></td></tr>",
+                                 colspan, ref);
+                    } else {
+                        rsprintf("</td></tr><tr><td colspan=%d class=\"messagelist\">"
+                                 "<div style=\"width: %s\"><img src=\"%s\" style=\"width:
100%\"></div></td></tr>",
+                                 colspan, str, ref);
+                    }
                } else {
                   rsprintf
                       ("<tr><td colspan=%d class=\"attachment\">%s %d: <a href=\"%s\">%s</a>\n",
@@ -18090,7 +18095,10 @@
                   if (is_image(att)) {
                      rsprintf("<tr><td class=\"messageframe\">\n");
                      rsprintf("<a name=\"att%d\"></a>\n", index + 1);
-                     rsprintf("<img src=\"%s\"></td></tr>", ref);
+                     if (!getcfg(lbs->name, "Attached image width entry", str, sizeof(str)))
+                        rsprintf("<img src=\"%s\"></td></tr>", ref);
+                    else
+                        rsprintf("<div style=\"width: %s\"><img src=\"%s\" style=\"width:
100%\"></div></td></tr>", str, ref);
                      rsprintf("</td></tr>\n\n");
                   } else {
                      if (is_ascii(file_name)) {
##########################################################################################

two new elog.conf parameters are defined:
Attached image width          ; width of full view image attached
Attached image width entry    ; width of attached image in the entry list view

plz apply :-)
  934   Sat Feb 12 17:45:39 2005 Reply Stefan Rittstefan.ritt@psi.chBug fixAll2.5.6 cvsRe: [patch]: fixed wrong extention check
> current version uses strstr() to check if the file has the expected ascii
> text extension ... this is buggy becouse this way a file named
> ".txt_hidden_file" or "foo.config.dat" are both seen as .txt files.

I added your routine chkext() to the code, but actually use it differently. I
display now ASCII files not by their extension, but the code checks for each file
to contain non-printable characters. If it contains all printable letters, and does
not have the extension PDF, PS or EPS, it's shown inline.
ELOG V3.1.5-3fb85fa6