

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
30 messages in net.sourceforge.lists.courier-usersRe: [courier-users] spamc, virtual ac...| From | Sent On | Attachments |
|---|---|---|
| Alan Milligan | Dec 12, 2003 2:19 am | |
| Mirko Zeibig | Dec 12, 2003 7:51 am | |
| Alan Milligan | Dec 14, 2003 2:17 pm | |
| Dave Kliczbor | Dec 15, 2003 3:30 am | |
| Mitch (WebCob) | Dec 15, 2003 8:08 am | |
| Chris Petersen | Dec 15, 2003 8:37 am | |
| Mitch (WebCob) | Dec 15, 2003 10:41 am | |
| Dave Kliczbor | Dec 15, 2003 4:11 pm | |
| Alan Milligan | Dec 15, 2003 4:39 pm | |
| Dave Kliczbor | Dec 15, 2003 5:01 pm | |
| Dave Kliczbor | Dec 15, 2003 5:31 pm | |
| Rich Duzenbury | Dec 15, 2003 9:12 pm | |
| Gordon Messmer | Dec 15, 2003 10:13 pm | |
| Alan Milligan | Dec 15, 2003 10:17 pm | |
| Chris Petersen | Dec 15, 2003 11:15 pm | |
| Roland | Dec 16, 2003 2:13 am | |
| Dave Kliczbor | Dec 16, 2003 6:12 am | |
| Alan Milligan | Dec 20, 2003 9:07 am | |
| Mitch (WebCob) | Dec 20, 2003 10:27 am | |
| Chris Petersen | Dec 20, 2003 3:25 pm | |
| Chris Petersen | Jan 2, 2004 4:13 pm | |
| Alan Milligan | Jan 2, 2004 9:42 pm | |
| Chris Petersen | Jan 3, 2004 12:37 am | |
| Chris Petersen | Jan 3, 2004 1:20 am | |
| Chris Petersen | Jan 5, 2004 10:43 am | .pm |
| Alan Milligan | Jan 5, 2004 7:54 pm | |
| Chris Petersen | Jan 7, 2004 10:53 am | |
| Chris Petersen | Jan 7, 2004 11:23 am | |
| Alan Milligan | Jan 7, 2004 7:00 pm | |
| Chris Petersen | Jan 7, 2004 8:49 pm |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: [courier-users] spamc, virtual accounts and user_prefs | Actions... |
|---|---|---|
| From: | Alan Milligan (al...@balclutha.org) | |
| Date: | Dec 20, 2003 9:07:40 am | |
| List: | net.sourceforge.lists.courier-users | |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
OK,
Seems SpamAssassin is decidely thick about virtual hosting, and I've had to do something about it.
All the --virtual-config-dir stuff seems like a load of shite to me. I have solved this problem by not bothering with any of that, and to instead add
use Mail::SpamAssassin::AuthCourier;
to my spamd program.
Invoking spamc with -u $USER is now sufficient for a full virtual mail account implementation with Courier's authdaemond.
I've attached Mail::SpamAssassin::AuthCourier, and it should be placed in your @INC where the rest of the SpamAssassin modules are. This module overrides the getpwnam and getpwuid builtin's and retrieves this from authdaemond instead :)
I have noticed that authdaemond is not actually returning the UID from authpam, which makes me wonder where it does get this from ...
If anyone finds this useful, please let me know.
Cheers, Alan -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.3.3 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org Comment:
iD8DBQE/5RlyCfroLk4EZpkRAt4RAJ9yXT4hfOqtntg+Y6+zBNcvvXq2rQCfe96q oInP5PwmCuMc3w+dbVrtWSg= =R6au -----END PGP SIGNATURE-----
# Copyright (C) 2003 Corporation of Balclutha. All rights reserved. # # Visit us at http://www.balclutha.org for all of your open source # software development and support requirements and hosted solutions. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # package Mail::SpamAssassin::AuthCourier;
#
# A mechanism which uses the Courier MTA's authdaemond server to
# determine mail account information. Courier is found at
http://courier-mta.org
#
# This module automagically overrides the builtin getpwnam and getpwuid
# functions.
#
use Exporter;
use IO::Socket::UNIX;
@ISA = qw(Exporter); @EXPORT = qw( getpwnam getpwuid );
# # ensure overriding for our own internal usage as well ... # use subs qw( getpwnam getpwuid );
#
# For some frustrating reason, the socket seems to be unusable unless set each
time.
# Please contact us if you have the solution to this enhancement.
#
BEGIN { # $socket = IO::Socket::UNIX->new('/usr/lib/courier/var/authdaemon/socket'); }
END { $socket->close if $socket; }
sub getpwnam {
my $socket =
IO::Socket::UNIX->new('/usr/lib/courier/var/authdaemon/socket');
print $socket "PRE . login $_[0]\n";
my %results = (); my ($k, $v); while (<$socket>) { ($k,$v) = split '=', $_, 2; chomp $v if $v; $results{$k} = $v; }
$socket->close if $socket;
# authpam seems not to return UID - so we'll take a punt on UID/GID being
the same ...
# stop some naf 'uninitialized' errors ...
return wantarray ? ('','','','','','','') : undef unless $results{'UID'} or
$results{'GID'};
my $uid = int( $results{'UID'} || $results{'GID'} );
return wantarray ? ( $results{'USERNAME'}, $results{'PASSWD'}, $uid, int($results{'GID'}), $results{'QUOTA'}, $results{'COMMENT'}, $results{'GCOS'}, $results{'HOME'}, '/bin/bash') : $uid; }
sub getpwuid { return (getpwnam($_[0]))[2]; }
1;








.pm