Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 90631 - Add Ability for Qmail to log all emails that pass through the server
Summary: Add Ability for Qmail to log all emails that pass through the server
Status: VERIFIED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Qmail Team (OBSOLETE)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 29485
  Show dependency tree
 
Reported: 2005-04-27 09:24 UTC by Andrew Preece
Modified: 2005-06-12 10:40 UTC (History)
0 users

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


Attachments
Logall Patch (logall.patch,284 bytes, patch)
2005-04-27 09:24 UTC, Andrew Preece
Details | Diff
requested qmail ebuild modification (qmail-1.03-r16.ebuild.diff,1.44 KB, patch)
2005-04-27 09:27 UTC, Andrew Preece
Details | Diff
Inter7 qmail-tap patch (qmail-tap.diff,7.81 KB, patch)
2005-05-04 15:09 UTC, Andrew Preece
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Preece 2005-04-27 09:24:04 UTC
we use qmail for our small MTA at work, and management requires that all email messages (incoming and outgoing) are logged. 

by changing a couple of lines in extra.h you can add said logging abilities though /var/qmail/alias/.qmail-log

by adding a logallmail use flag this patch can optionally be disabled. 

in the ebuild modification, i've added a URL to instructions on this feature.

This is my first contribution to portage, so i apologize for any mistakes in the patches, and appreciate feedback  

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Andrew Preece 2005-04-27 09:24:42 UTC
Created attachment 57397 [details, diff]
Logall Patch
Comment 2 Andrew Preece 2005-04-27 09:27:06 UTC
Created attachment 57398 [details, diff]
requested qmail ebuild modification
Comment 3 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2005-04-28 07:37:03 UTC
Why don't you use the QMAILQUEUE variable with a perl script?

tcp.smtp:
1.2.3.4:allow,QMAILQUEUE="/usr/local/bin/qmail-log.pl"
Comment 4 Andrew Preece 2005-04-28 07:50:11 UTC
we use qmail-scanner for content filtering, and i couldn't figure out how to pass email through both, and when i googled for logging mail, this is what came up. 

but i wanted to keep my solution as "standard" as possible, and if other people need to implement this functionality this would be an easy way for them.

it's also what (in my opinion) a use flag is _great_ for. it adds optional extra functionality, with just a simple configuration change to the user. 
the .qmail-log file works that same as any other alias/mailbox, so it makes it real simple. 
Comment 5 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2005-04-28 10:31:04 UTC
Ok, ironically someone on the qmail mailing list just asked about this and there came an URL along (http://cr.yp.to/qmail/faq/admin.html#copies) which just describes the same as you. I think we can integrate this in some way into the -r16 ebuild.
Comment 6 Andrew Preece 2005-04-28 14:12:23 UTC
please see the submitted patch and ebuild modification? 

i used my portage overlay to install this, and it works like a charm for me

all i did was put the archive email address into the /var/qmail/alias/.qmail-log

and bingo, every email in and out went to the archive account. 

it would be prudent to add to the end of the ebuild something like

if use logall
  einfo "edit the /var/qmail/alias/.qmail-log file to tell"
  einfo "qmail what to do with copies of messages"
  einfo "it behaves the same as any other .qmail file"
fi
Comment 7 Andrew Preece 2005-04-28 14:14:15 UTC
also, in the supplied ebuild patch, i added the following website to the homepages area:
http://www.cyber-sentry.com/index.php?id=35
it contains the same instructions, and a nice little overview of how to use the .qmail-log file, as well as ahandy rotation shell script. 
Comment 8 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2005-04-29 00:29:12 UTC
Yes, it'll be integrated into the -r16 ebuild. Don't stress, please.
Comment 9 Andrew Preece 2005-04-29 17:55:47 UTC
sorry, didn't mean to come across as stressed. 
i'm just excited to have contributed back to portage in some small way 
:)
Comment 10 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2005-05-01 05:47:19 UTC
It's implemented in qmail-1.03-r16 with the USE flag logmail. Can you test it, please?
Comment 11 Andrew Preece 2005-05-02 11:55:07 UTC
seems to be acting strange:

whatever i put in the /var/qmail/alias/.qmail-log 
get ignored, and every message comes back with a bounce saying that log@domain.com does not exist. 

if i create a log@domain.com alias, the message goes to the log address about 65 million times. 
Comment 12 Andrew Preece 2005-05-02 12:28:39 UTC
Further reseach has uncovered another method to create copies, made the the good folks at inter7

http://inter7.com/?page=qmailtap
Comment 13 Andrew Preece 2005-05-04 15:09:10 UTC
Created attachment 58077 [details, diff]
Inter7 qmail-tap patch

Inter7 Qmail-Tap patch minus the qmail-regex stuff that gets applied with
another patch. 

tested for sucessful compile.
Comment 14 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2005-05-07 08:24:52 UTC
Please provide a rediffed patch which applies to qmail-1.03-r16 where currently qmail-logmail.patch is applied. Thanks.

Btw., I've tried ~alias/.qmail-log -- it works. You just have to do it right.
Comment 15 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2005-05-09 10:26:59 UTC
Would it be ok if the ebuild'd provided an example of ~alias/.qmail-log?
Comment 16 Andrew Preece 2005-05-11 10:22:08 UTC
i think an example would be great since i'm not sure where i'm going wrong with the original log patch.

i'm sorry i don't quite understand what you want when you ask for a rediffed patch that appies. 
doesn't the included qmail-tap apply? 
Comment 17 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2005-06-05 08:21:46 UTC
If you now do "ebuild .../qmail-1.03-r16.ebuild config" and have USE=logmail, a
~alias/.qmail-log file is created. Is this better now?
Comment 18 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2005-06-12 10:40:42 UTC
Closing, because it's basically working. Doing more examples isn't hard.