Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 96540 - net-dialup/capisuite-0.4.5 has no date in header of notification emails
Summary: net-dialup/capisuite-0.4.5 has no date in header of notification emails
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High minor
Assignee: Stefan Briesenick (RETIRED)
URL:
Whiteboard:
Keywords: Inclusion
Depends on:
Blocks:
 
Reported: 2005-06-19 12:05 UTC by Torben Janssen
Modified: 2005-06-20 13:51 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patchfile for Dateheader in Nofificationemails (cs_helpers.patch,740 bytes, patch)
2005-06-19 23:44 UTC, Torben Janssen
Details | Diff
capisuite-0.4.5-date-header.patch (capisuite-0.4.5-date-header.patch,821 bytes, patch)
2005-06-20 13:02 UTC, Stefan Briesenick (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Torben Janssen 2005-06-19 12:05:25 UTC
Capisuite assembles the notification mails on its own. in these mails there is
no date header. it was discussed on capisuites mailinglist (german). i attached
a little patch to fix this behaviour

Reproducible: Always
Steps to Reproduce:
1. enable notification of fax by mail (MailAndSave)
2. send a fax and/or receive one
3. look at the notification mail. it has no date header so it will be displayed
as 1.1.1979

Actual Results:  
i got an email with bad date header

Expected Results:  
insert actual date in header

cs_helpers.pyin is original
cs_helpers.py is my patched version

--- cs_helpers.pyin     2004-11-28 14:35:23.000000000 +0100
+++ cs_helpers.py       2005-06-19 20:55:49.000000000 +0200
@@ -10,6 +10,7 @@
 #  (at your option) any later version.
 
 import os
+import time
 
 # the name of the config file read by the scripts; see there for options and
 # descriptions
@@ -170,6 +171,7 @@
        msg['Subject']=mail_subject
        msg['From']=mail_from
        msg['To']=mail_to
+       msg['Date']=time.ctime()
 
        msg.preamble = 'This is a Multipart-MIME-message. Please use a capable
mailer.\n'
        msg.epilogue = '' # To guarantee the message ends with a newline
@@ -267,6 +269,7 @@
        msg['Subject'] = mail_subject
        msg['From'] = mail_from
        msg['To'] = mail_to
+       msg['Date']=time.ctime()
 
        try:
                server = smtplib.SMTP('localhost')
Comment 1 Stefan Briesenick (RETIRED) gentoo-dev 2005-06-19 21:16:10 UTC
A friendly MTA should add the date header for you. But I agree, it's always 
better to set it directly. This patch should be go to upstream, but 
unfortunately capisuite has no maintainer right now. :-( 
 
So I will add this patch for the time being to our ebuild. 
 
Please attach your patch to this bug as a file. Or do you have a link for us to 
the patch (asuming that you also downloaded it somewhere)? 
 
btw: which (ebuild) version do you use? 
 
Comment 2 Alin Năstac (RETIRED) gentoo-dev 2005-06-19 22:45:12 UTC
Stefan, please add net-dialup herd to CC list when you take over bugs regarding
this herd.
Comment 3 Torben Janssen 2005-06-19 23:44:52 UTC
Created attachment 61559 [details, diff]
Patchfile for Dateheader in Nofificationemails

btw: I use the capisuite-0.4.5.ebuild
Comment 4 Stefan Briesenick (RETIRED) gentoo-dev 2005-06-20 04:36:05 UTC
Python 2.4.1 (#1, Jun 17 2005, 13:16:30) 
[GCC 3.4.4 (Gentoo 3.4.4, ssp-3.4.4-1.0, pie-8.7.8)] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import time 
>>> time.ctime() 
'Mon Jun 20 13:30:09 2005' 
 
 
it seems, that 'ctime' produces a wrong date format. 
 
Here some real world examples (taken from different mails): ;-) 
 
Date: Sat, 04 Jun 2005 02:49:19 +0000 
Date: Fri, 17 Jun 2005 10:21:37 +0200 
Date: Mon, 20 Jun 2005 07:01:48 +0200 
 
I think time.strftime() with a correct format mask would be better. 
 
Comment 5 Stefan Briesenick (RETIRED) gentoo-dev 2005-06-20 04:43:45 UTC
>>> time.strftime('%a, %d %b %Y %H:%M:%S %z') 
'Mon, 20 Jun 2005 13:41:18 +0200' 
 
This is the correct format mask for RFC822 conformant dates. 
 
Comment 6 Stefan Briesenick (RETIRED) gentoo-dev 2005-06-20 13:02:39 UTC
Created attachment 61593 [details, diff]
capisuite-0.4.5-date-header.patch

corrected patch.
Comment 7 Stefan Briesenick (RETIRED) gentoo-dev 2005-06-20 13:30:44 UTC
fixed in capisuite-0.4.5-r2 
please test it. thanks! 
 
Comment 8 Stefan Briesenick (RETIRED) gentoo-dev 2005-06-20 13:51:29 UTC
should be available on the mirrors in a few mins/hours. It's in CVS now.