catchall for all postmaster accounts

2006-03-10 Thread Nicolas de Bari Embriz Garcia Rojas
Is there a way for having one single postmaster account for all the  
domains ?


maybe a catchall but for the domains?


regards.



mailmessagestore in procmail

2006-03-10 Thread Nicolas de Bari Embriz Garcia Rojas
Hi all, is there a way to pass the full path stored on the  
mailMessagestore atribut of the ldap to procmail when using  
deliveryProgramPath ?


my mailMessagestore looks something like this: /usr/home/qmail/ 
maildirs/ejemplo.org/nbari
and my deliveryProgramPath like this: /usr/local/bin/procmail -p  
[EMAIL PROTECTED] /usr/local/etc/procmailrc


with that procmail imports the $HOME just like /usr/home/qmail/ 
maildirs but i have to complement it using the LOGNAME. I would like  
to avoid doing that and to maybe just use a $MAILDIR having the full  
path of the mailMessagestore.



any ideas ?


regards
 


Re: SHA and Perl.

2006-03-10 Thread Andre Gerhard

Maybe something like this ?

#!/usr/bin/perl

use Digest::SHA;
use MIME::Base64;

my $filename = shift(@ARGV) || die("no args");

open (FILE, "$filename") ||
  die ("can't open $filename: $!\n");

while (my $line = ) {
  chomp($line);

  $context = Digest::SHA->new(1);

  $context->add("$line");

  print encode_base64($context->digest);
}

close (FILE);


Andre


On Fri, 10 Mar 2006 02:55:31 -0800 (PST)
Its Azfar <[EMAIL PROTECTED]> wrote:

> I am running qmail with ldap backend. I have an
> application (Platypus) which can connect to ldap and
> make user accounts. It forward plain text password
> from my database (MS SQL) to ldap hence userPassword
> fieled remain clear text but base_64 encoded. My old
> ldap (netscape DS) can automaticay crypt the
> userPassword attribute value with {SHA} but openldap
> dont. Can I make it possible openldap automaticaly
> crypt the userPassword attribue value with {SHA}.
> 
> OR any one guide me how to make a perl script which
> read userPassword value from a file and then convert
> it into {SHA} and then take is as a variable.
> 
> 
> __
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 


Re: Hacking qmail-smtpd : how to use logit()?

2006-03-10 Thread B S Srinidhi
Hi,

On Fri, 2006-03-10 at 15:55 +0530, B S Srinidhi wrote:
> I'm getting this in the log:
> 
> qldap: bad state transition 2 -> 4
> 
> It would really be very helpful if you could explain me the meaning of
> the above message. :)
> 

No problem. I figured this out and everything's working the way I
wanted. :) 

Thanks alot Claudio for your time and timely inputs. :)

Srinidhi.
-- 
ASCII ribbon campaign ( ) B S Srinidhi
 - against HTML email  X  http://srinidhi.deeproot.co.in
 & vCards / \ DeepRoot Linux



Re: SHA and Perl.

2006-03-10 Thread Its Azfar
can i include a shell script in perl script, How ?

--- Russell Simpkins <[EMAIL PROTECTED]> wrote:

> Its Azfar wrote:
> 
> >I am running qmail with ldap backend. I have an
> >application (Platypus) which can connect to ldap
> and
> >make user accounts. It forward plain text password
> >from my database (MS SQL) to ldap hence
> userPassword
> >fieled remain clear text but base_64 encoded. My
> old
> >ldap (netscape DS) can automaticay crypt the
> >userPassword attribute value with {SHA} but
> openldap
> >dont. Can I make it possible openldap automaticaly
> >crypt the userPassword attribue value with {SHA}.
> >
> >OR any one guide me how to make a perl script which
> >read userPassword value from a file and then
> convert
> >it into {SHA} and then take is as a variable.
> >  
> >
> I wrote a small script to get passwords to SHA
> 
> #!/bin/sh
> slappasswd -h '{SHA}' -s $1
> 
> Try something like that. The perl script can loop
> though the passwords 
> and execute this shell script passing in each
> password on each loop.
> 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Re: SHA and Perl.

2006-03-10 Thread Russell Simpkins

Its Azfar wrote:


I am running qmail with ldap backend. I have an
application (Platypus) which can connect to ldap and
make user accounts. It forward plain text password
from my database (MS SQL) to ldap hence userPassword
fieled remain clear text but base_64 encoded. My old
ldap (netscape DS) can automaticay crypt the
userPassword attribute value with {SHA} but openldap
dont. Can I make it possible openldap automaticaly
crypt the userPassword attribue value with {SHA}.

OR any one guide me how to make a perl script which
read userPassword value from a file and then convert
it into {SHA} and then take is as a variable.
 


I wrote a small script to get passwords to SHA

#!/bin/sh
slappasswd -h '{SHA}' -s $1

Try something like that. The perl script can loop though the passwords 
and execute this shell script passing in each password on each loop.


SHA and Perl.

2006-03-10 Thread Its Azfar
I am running qmail with ldap backend. I have an
application (Platypus) which can connect to ldap and
make user accounts. It forward plain text password
from my database (MS SQL) to ldap hence userPassword
fieled remain clear text but base_64 encoded. My old
ldap (netscape DS) can automaticay crypt the
userPassword attribute value with {SHA} but openldap
dont. Can I make it possible openldap automaticaly
crypt the userPassword attribue value with {SHA}.

OR any one guide me how to make a perl script which
read userPassword value from a file and then convert
it into {SHA} and then take is as a variable.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Re: Hacking qmail-smtpd : how to use logit()?

2006-03-10 Thread B S Srinidhi
Hi,

On Fri, 2006-03-10 at 11:08 +0059, Claudio Jeker wrote:
> The last argument needs to be 0 only qmail-lspawn needs 1. This is because
> the debug messages need to be passed to the main qmail-lspawn process that
> does the loging for child processes. Additionally you need to change -256
> to ~256. -256 is 0xff00 which filters out everything below level 255.
> 

Thanks a lot Claudio. :D

I got it working. I did this:

log_init(STDERR, -1, 0);

and then:

logit(255, "srinidhi\n");

I could see this in the logs now. :)

> Try with something like loglevel 0. logit(0, "foo\n");
> 

Didn't show up in the logs, that's why changed the level to 255 and
tried.

> Look at qmail-verify.c and auth_mod.c on who to use it.
> 

I have one more query. From inside qldap_get_attr() function, at:

CHECK(q, EXTRACT);

I'm getting this in the log:

qldap: bad state transition 2 -> 4

It would really be very helpful if you could explain me the meaning of
the above message. :)

Thanks once again for your time and patience. :)

Srinidhi.
-- 
ASCII ribbon campaign ( ) B S Srinidhi
 - against HTML email  X  http://srinidhi.deeproot.co.in
 & vCards / \ DeepRoot Linux



[Fwd: Re: Hacking qmail-smtpd : how to use logit()?]

2006-03-10 Thread B S Srinidhi
Forgot to mark a copy to the list. :(

Srinidhi.
-- 
ASCII ribbon campaign ( ) B S Srinidhi
 - against HTML email  X  http://srinidhi.deeproot.co.in
 & vCards / \ DeepRoot Linux
--- Begin Message ---
Hi Claudio,

Thanks alot for the quick reply.

On Fri, 2006-03-10 at 10:07 +0059, Claudio Jeker wrote:
> Logit() can only be used after calling log_init() which is not done in
> qmail-smtpd. qmail-smtpd has a simple version for logging (logline() and
> friends) to make sure that we do not run into format string issues.
> 

I called log_init() in the following manner:

log_init(STDERR, -256, 1);

Is it correct? I did not understand the use of the last argument. After
this, I call logit() in the following manner:

logit(255, "srinidhi\n");

I can't see this string in the logs. I'm running qmail-smtpd with
LOGLEVEL set to 255.

Any idea why I'm not able to see this message in the logs?

> If you are using logit() you need to change the Makefile to get the
> DEBUG flags and get the linking correct.
> 

I think I've done this correctly, since I'm not getting any errors while
compiling. :)

> Logit() can do it printf style else you need to use fmt_ulong().
> 

Okay.

> Hope that helps.
> 

It was definetly useful. Looking at qmail-debug.c, I figured out that I
had to call log_init(), but didn't know that its not called in
qmail-smtpd. 

Srinidhi.
-- 
ASCII ribbon campaign ( ) B S Srinidhi
 - against HTML email  X  http://srinidhi.deeproot.co.in
 & vCards / \ DeepRoot Linux
--- End Message ---


Re: qmail-ldap and pureftpd

2006-03-10 Thread Nicolas de Bari Embriz Garcia Rojas

Hi, after editing the qmail-ldap.h

from:

#define LDAP_HOMEDIR"homeDirectory"

to

#define LDAP_HOMEDIR"nohomeDirectory"


Everything just start to working perfect. my final ldiff looks like  
this:


dn: [EMAIL PROTECTED],ou=ejemplo.org,ou=vusers,dc=toronja,dc=net
objectClass: top
objectClass: qmailUser
objectClass: posixAccount
objectClass: PureFTPdUser
uid: [EMAIL PROTECTED]
cn: nbari
mail: [EMAIL PROTECTED]
mailMessageStore: /ejemplo.org/nbari
accountStatus: active
deliveryMode: nolocal
deliveryProgramPath:  /usr/local/bin/procmail -p  
[EMAIL PROTECTED] /usr/local/etc/procmailrc

userPassword: {SSHA}GMI1U7S5iQw9xjCP7mwXi08mJ2qYu/mm
uidNumber: 80
gidNumber: 80
homeDirectory: /data/vftp/nbari
FTPStatus: enabled
FTPQuotaFiles: 50
FTPQuotaMBytes: 10


I added the posixAccount and the PureFTPdUser classes also I edited  
the mailMessageStore what I did specially on here was to add the  
slash at the beginning / (like it it where an absolute path)  what it  
is strange (possible bug)  is that  in normal use (no changes on  
qmail-ldap.h) I do not have the leading slash and also on the control  
files on the ldapmessagestore I have only this : /usr/home/qmail/ 
maildirs (prefix) so the  mailMessageStore looks like this /usr/home/ 
qmail/maildirs(no slash)ejemplo.org/nbari for some reasons that work,  
but after editing the qmail-ldap.h thhe behavior of the  
mailmessagestore changed. puting the full absolute path of the  
messageSatore also worked and the ldapmsessagestore was ignored.  
seems that the condition after editing the qmail-ldap.h looks like :


if mailMessageStore path exists then use it if not then try to see if  
using the ldapmessagestore plus the value on mailMessageStore are a  
valid path.


Also I had to remove the objectClass: person and the objectClass:  
inetOrgPerson for some know reasons they do not work with the  
PureFTPdUser class, so I would like to know if  there is a problem if  
i do not put does classes.


Beside that every thing seems to work perfect, if some one has a  
recommendation of a better practice of doing this i will appreciate  
the info, for now with this ldif and with the change made to the  
qmail-ldap.h file I am available to manage email and ftp, also the  
users now can control both of  the services with just one single  
login and password.


if any one is interested on doing something similar hope this info  
can help.


Regards.




On Mar 10, 2006, at 3:03 AM, Claudio Jeker wrote:

On Thu, Mar 09, 2006 at 08:19:18PM -0600, Nicolas de Bari Embriz  
Garcia Rojas wrote:

Hi all, I would like to use the same user and password for both email
and ftp using qmail-ldap and pure-ftpd has some one done this before
or has any idea of how to merge both ldifs and maybe have just one,
so a users can use their email has the user to login via ftp and also
when the users changes his password from the webmail, the user has
changed the password for the ftp to.



There is no problem in doing that. Just add an additional  
objectclass (if

necessary for pureftpd).

pureftpd uses IIRC uid, userPassword and homeDirectory (plus  
uidNumber and
gidNumber if not set by default). Now qmail-ldap uses uid for pop3/ 
imap
login, userPassword for password verification. The only porblem  
could be
homeDirectory because qmail will use this plus mailMessageStore to  
find
out where to deliver the messages. So you may need to modify  
LDAP_HOMEDIR

in qmail-ldap.h to point to something like noHomeDirectory.

As userPassword is used by both daemons changing it will change it for
both.

--
:wq Claudio




Re: Hacking qmail-smtpd : how to use logit()?

2006-03-10 Thread Claudio Jeker
On Fri, Mar 10, 2006 at 01:49:59PM +0530, B S Srinidhi wrote:
> Hi All,
> 
> I've been trying to hack qmail-smtpd.c to get something done. But I'm
> held up at one place and I now turn to the list to seek some help and
> suggestions.
> 
> First of all, I want to use logit() inside some functions (like
> smtp_mail() and smtp_rcpt()) in qmail-smtpd.c, to output some debugging
> lines. My problem is, whatever I try to pass to logit(), I'm not able to
> see those messages in the output (logs). :( I'm running qmail-smtpd with
> the same LOGLEVEL value that I'm passing to logit(). Is it that logit()
> will not work inside qmail-smtpd.c? Do I need to change anything in the
> Makefile to get this working?
> 

Logit() can only be used after calling log_init() which is not done in
qmail-smtpd. qmail-smtpd has a simple version for logging (logline() and
friends) to make sure that we do not run into format string issues.

If you are using logit() you need to change the Makefile to get the
DEBUG flags and get the linking correct.

> Secondly, how do I output an integer (variable)? Please execuse me for
> asking such a stupid question, but I couldn't find a way other than
> logit(). I also looked at the sources, but everywhere logit() is used to
> print values of integer variables.
> 

Logit() can do it printf style else you need to use fmt_ulong().

> Many many thanks in advance for any kind of help / suggestion on solving
> the above two problems of mine.
> 

Hope that helps.

-- 
:wq Claudio


Re: qmail-ldap and pureftpd

2006-03-10 Thread Claudio Jeker
On Thu, Mar 09, 2006 at 08:19:18PM -0600, Nicolas de Bari Embriz Garcia Rojas 
wrote:
> Hi all, I would like to use the same user and password for both email  
> and ftp using qmail-ldap and pure-ftpd has some one done this before  
> or has any idea of how to merge both ldifs and maybe have just one,  
> so a users can use their email has the user to login via ftp and also  
> when the users changes his password from the webmail, the user has  
> changed the password for the ftp to.
> 

There is no problem in doing that. Just add an additional objectclass (if
necessary for pureftpd).

pureftpd uses IIRC uid, userPassword and homeDirectory (plus uidNumber and
gidNumber if not set by default). Now qmail-ldap uses uid for pop3/imap
login, userPassword for password verification. The only porblem could be
homeDirectory because qmail will use this plus mailMessageStore to find
out where to deliver the messages. So you may need to modify LDAP_HOMEDIR
in qmail-ldap.h to point to something like noHomeDirectory.

As userPassword is used by both daemons changing it will change it for
both.

-- 
:wq Claudio


Hacking qmail-smtpd : how to use logit()?

2006-03-10 Thread B S Srinidhi
Hi All,

I've been trying to hack qmail-smtpd.c to get something done. But I'm
held up at one place and I now turn to the list to seek some help and
suggestions.

First of all, I want to use logit() inside some functions (like
smtp_mail() and smtp_rcpt()) in qmail-smtpd.c, to output some debugging
lines. My problem is, whatever I try to pass to logit(), I'm not able to
see those messages in the output (logs). :( I'm running qmail-smtpd with
the same LOGLEVEL value that I'm passing to logit(). Is it that logit()
will not work inside qmail-smtpd.c? Do I need to change anything in the
Makefile to get this working?

Secondly, how do I output an integer (variable)? Please execuse me for
asking such a stupid question, but I couldn't find a way other than
logit(). I also looked at the sources, but everywhere logit() is used to
print values of integer variables.

Many many thanks in advance for any kind of help / suggestion on solving
the above two problems of mine.

Srinidhi.
-- 
ASCII ribbon campaign ( ) B S Srinidhi
 - against HTML email  X  http://srinidhi.deeproot.co.in
 & vCards / \ DeepRoot Linux