Re: [vchkpw] Forward non-existing accounts to another server (same domain)

2011-05-09 Thread Manvendra Bhangui
On Mon, May 9, 2011 at 1:43 PM, Carlos Miranda Molina (Mstaaravin)
mstaara...@gmail.com wrote:
 Hi!

 I have one domain mydomain.com and i need split this between 3
 geographical places, differents users of course.

You can achieve this by writing a qmail-remote wrapper which gets
called in .qmail files. Search the qmail list for discussions on this.
This would be a simple solution but will require you to maintain
.qmail files for users to re-direct the mail to another host.

If you can digest something that is complicated, please look at
IndiMail - http://www.indimail.org which does exactly what you
require. IndiMail modifies qmail-rspawn to look for the location of
users in a MySQL table called hostcntrl. So you can split users for a
domain across multiple hosts. In fact one of the host can be MS
Exchange, one can be lotus notes, etc. Additionally, IndiMail provides
proxy for IMAP and POP3 so that users can transparently connect to any
host and yet see their mailbox. Most of the commands in IndiMail are
same as vpopmail (vadddomain, vadduser, vdeluser, vpasswd, etc) with
the difference that they work on users distributed across geographical
domains. IndiMail is a mix of ideas from qmail and vpopmail.

!DSPAM:4dc8012032719027393581!



Re: [vchkpw] DKIM?

2011-01-31 Thread Manvendra Bhangui
On Tue, Feb 1, 2011 at 1:01 AM, Roberto Puzzanghera ad...@sagredo.eu wrote:
 Hello Manvendra, I'm testing your patch and reading all your docs.
 Can you please clarify which is the advantage of filtering at smtp level?

At the SMTP level, qmail-smtpd does not break a mail addressed to
multiple recipients. Hence a single mail addressed to multiple
recipients will undergo encryption/decryption for DKIM only once.

In case you decide to do DKIM at remote/local delivery for better
control on signing/verification, DKIM will happen for every delivery.
At the local/remote delivery, qmail-send does an individual delivery
for each recipient in an email message. So if you have a mail
addressed to 10 recipients, DKIM will happen 10 times. Also if the
delivery to the destination fails with a temp error, the delivery will
be retried and DKIM will also happen again.

!DSPAM:4d47722532716834316241!



Re: [vchkpw] DKIM?

2011-01-29 Thread Manvendra Bhangui
On Sun, Jan 30, 2011 at 2:45 AM, Tom Collins t...@tomlogic.com wrote:
 Manvendra,

 Do you have a page on how to configure DKIM after patching qmail?  Or is it 
 in the dkfilter man page as part of the patch?


I think you mean dk-filter. The man page is part of the patch. You can
use qmail-dkim(8) if you want signing/verification at SMTP. You can
use dk-filter(8) if you desire signing/verification only at
local/remote delivery.

You will need to set the environment variables DKIMSIGN to the path of
the private key (generated by dknewkey(8) or openssl). The variable
needs to be set in the script which calls qmail-send. I believe you
want to do DKIM signing only for your remote mails. You will have to
set QMAILREMOTE=/var/indimail/bin/spawn-filter also in the qmail-send
script. Finally you will either need to use the control file
/var/qmail/control/filterargs or the environment variable FILTERAGS.
Advantage of control file is that you can have DKIMSIGNING only for
specific domains. e.g.

remote_domain:remote:/var/qmail/bin/dk-filter

Will execute dk-filter only for outgoing mails destined for the domain
remote_domain.

You can use the following page for configuration instructions. The
only thing you will have to do differently is setting the environment
variables (which I presume will be /var/qmail/rc). The page below
assumes a setup which uses envdir(8) and all environment variables for
qmail-send are in /service/qmail-send.25/variables.

http://indimail.blogspot.com/2009/04/how-to-set-dkim-signature-in-indimail.html

!DSPAM:4d44d52032711917789942!



Re: [vchkpw] DKIM?

2011-01-26 Thread Manvendra Bhangui
On Thu, Jan 27, 2011 at 10:39 AM, Tom Collins t...@tomlogic.com wrote:
 Any advice on setting up DKIM to sign outbound mail on my vpopmail server?  
 I've spent some time looking around at various patches and I'm a little 
 overwhelmed.

 I host about 150 domains, and I don't want to mess around with setting up 
 unique keys for each hosted domain.  I'm fine with signing all mail using the 
 server's hostname and a single signing key.

 I'm not really interested in verifying DKIM signatures on inbound mail, 
 unless it will significantly cut down on spam.

 Any pointers on getting a simple setup in place?

At the risk of beating my own drum, I have a patch for netqmail. You
can set the QMAILQUEUE environment variable to point to
/var/qmail/bin/qmail-dkim

You need to set DKIMSIGN environment variable for signing.

http://sourceforge.net/projects/indimail/files/netqmail-addons/qmail-dkim-1.0/dkim-netqmail-1.06.patch-1.5.gz/download

!DSPAM:4d4101ab32712002764790!



Re: [vchkpw] Problem with vpopmail: deliver all mail to /var/spool/mail/vpopmail

2009-10-08 Thread Manvendra Bhangui
On Thu, Oct 8, 2009 at 9:05 PM, Javier de Miguel Rodrí­guez 
javierdemig...@us.es wrote:


 cat /var/qmail/users/assign

 +javierito.com-:javierito.com:89:89:/home/vpopmail/domains/javierito.com:
 -::
 ..


Just to eliminate that the file /var/qmail/users/cdb is up to date, what is
the output of

strings /var/qmail/users/cdb

Also what is the entry for vpopmail user in /etc/passwd

-- 
Regards Manvendra - http://www.indimail.org


!DSPAM:4ace0fc73271896353!


Re: [vchkpw] Problem with vpopmail: deliver all mail to /var/spool/mail/vpopmail

2009-10-08 Thread Manvendra Bhangui
2009/10/9 Javier de Miguel Rodrí­guez javierdemig...@us.es


  Hi,

 Can you do a

 ps -ax | grep qmail-lspawn


 ps -ax | grep qmail-lspawn

 Warning: bad syntax, perhaps a bogus '-'? See
 /usr/share/doc/procps-3.2.7/FAQ
 18860 ?S  0:00 qmail-lspawn ./Maildir/
 30482 pts/0R+ 0:00 grep qmail-lspawn




Do you have strace ?

strace -o /tmp/problem.log -Ff -p 18860



-- 
Regards Manvendra - http://www.indimail.org
Sent from Chennai, TN, India


!DSPAM:4ace394632711612410632!


Re: [vchkpw] Problem with vpopmail: deliver all mail to /var/spool/mail/vpopmail

2009-10-08 Thread Manvendra Bhangui
2009/10/9 Javier de Miguel Rodrí­guez javierdemig...@us.es



 I attach the straced /tmp/problem.log gzipped

 Regards and LOT of thanks for the help, you are great guys!!!



The strace output shows that vdelivermail executes maildrop

31280 waitpid(31281,  unfinished ...
31281 rt_sigaction(SIGPIPE, {SIG_DFL, [PIPE], SA_RESTART}, {SIG_DFL, [], 0},
8) = 0
31281 execve(/bin/sh, [/bin/sh, -c, preline /usr/bin/maildrop], [/*
23 vars */]) = 0
31281 brk(0)= 0x86ab000

Also maildrop opens /var/mail/vpopmail
31282 uname({sys=Linux, node=buzones_externos, ...}) = 0
31282 open(/etc/maildroprc, O_RDONLY) = -1 ENOENT (No such file or
directory)
31282 open(.mailfilter, O_RDONLY) = -1 ENOENT (No such file or
directory)
31282 stat64(/var/mail/vpopmail/tmp, 0xbfec5dc0) = -1 ENOTDIR (Not a
directory)
31282 umask(077)= 07
31282 open(/var/mail/vpopmail, O_WRONLY|O_CREAT, 0666) = 4


-- 
Regards Manvendra - http://www.indimail.org
Sent from Chennai, TN, India


!DSPAM:4ace3f4b32717519411279!


Re: [vchkpw] vpopmail UID/GID hardcoded in config.h

2009-08-18 Thread Manvendra Bhangui
On Tue, 2009-08-18 at 18:34 -0500, Tom Collins wrote:

 How often does the code actually reference the UID/GID?  Could you  
 have a function to look it up and cache it in a static once found?
 
 A quick check and it looks like it's only referenced when adding a  
 user or updating the tcp.smtp.cdb file.  There are a few other  
 references, but the common things (like vchkpw and vdelivermail)  
 don't appear to make use of it.
 
 Probably not a big deal to use getpwnam.
 

Not a big deal using getpwnam(). Also if you run nscd daemon,
password/group file lookups get cached
http://docs.sun.com/app/docs/doc/816-5166/nscd-1m?a=view


Also using getpwnam() function allows you to use hooks like NSS (Name
Service Switch) - http://en.wikipedia.org/wiki/Name_Service_Switch

In Unix-like operating systems, the Name Service Switch (NSS) allows
Unix configuration databases to be provided by different sources,
including local files (for
example: /etc/passwd, /etc/group, /etc/hosts), LDAP, and other sources.

In case it can be used, attaching a function GetVpopID() which I used
with vpopmail in my early days of using vpopmail. It uses static
variables to cache the uid/gid.

Regards Manvendra
http://www.indimail.org


!DSPAM:4a8b792832719326514358!
/*
 * $Log: GetVpopID.c,v $
 * Revision 1.3  2001-11-24 12:16:57+05:30  Cprogrammer
 * version information added
 *
 * Revision 1.2  2001-11-20 10:53:16+05:30  Cprogrammer
 * *** empty log message ***
 *
 * Revision 1.1  2001-10-24 18:15:00+05:30  Cprogrammer
 * Initial revision
 *
 */
#include indimail.h
#include pwd.h

#ifndef	lint
static char sccsid[] = $Id: GetVpopID.c,v 1.3 2001-11-24 12:16:57+05:30 Cprogrammer Stab mbhangui $;
#endif

int
GetVpopID(uid_t *uid, gid_t *gid)
{
	struct passwd  *pw;
	static uid_tsuid = -1;
	static gid_tsgid = -1;

	if(suid != -1  sgid != -1)
	{
		*uid = suid;
		*gid = sgid;
		return(0);
	}
	if(!(pw = getpwnam(VPOPUSER)))
	{
		fprintf(stderr, getpwnam failed for user %s\n, VPOPUSER);
		return(-1);
	}
	*uid = suid = pw-pw_uid;
	*gid = sgid = pw-pw_gid;
	return(0);
}

void
getversion_GetVpopID_c()
{
	printf(%s\n, sccsid);
	printf(%s\n, sccsidh);
}


Re: [vchkpw] Mails delivered by maildirsmtp bounce with looping error after upgrade from 5.4.9 to 5.4.27

2009-04-24 Thread Manvendra Bhangui
On Fri, Apr 24, 2009 at 11:25 AM, Koustubha Kale kmk...@gmail.com wrote:

 here it is. I have obfuscated user, domain names  IP's.

 - Original Message - From: mailer-dae...@hub.domain1.com
 To: sen...@branch1.domain2.com
 Sent: Wednesday, April 22, 2009 10:42 AM
 Subject: failure notice


  Hi. This is the qmail-send program at hub.domain1.com.
  I'm afraid I wasn't able to deliver your message to the following
 addresses.
  This is a permanent error; I've given up. Sorry it didn't work out.
 
  rc...@branch2.domain1.com:
  mail is looping

You have given a sample of a mail which has bounced. Can you send an headers
from the email from the Maildir on the central server? This is before it is
picked up by maildirsmtp.

Also the error message is from qmail-smtpd. There is a maximum limit of no
of headers
in qmail-smtpd (defined by MAXHOPS). Are you reaching that limit. You can
create a control file /var/qmail/control/maxhops in case you want to
increase that


!DSPAM:49f16d8932688643591450!


Re: [vchkpw] Mails delivered by maildirsmtp bounce with looping error after upgrade from 5.4.9 to 5.4.27

2009-04-24 Thread Manvendra Bhangui
On Fri, Apr 24, 2009 at 3:39 PM, Koustubha Kale kmk...@gmail.com wrote:


  1. On the central server you are using vdelivermail to deliver it to a
 Maildir
 Check your .qmail-default file on the central server.
vdelivermail adds a Delivered-To: header


 My .qmail-default on central server is

 | /home/vpopmail/bin/vdelivermail '' bounce-no-mailbox


How does it get delivered to a Maildir. Are you using an alias?



 2. On the final branch server, you are again using vdelivermail to deliver
 the mail to the
   user's maildir. vdelivermail has a code is_looping() which checks if the
 header Delivered-To is present. The message mail is looping is in the
 vdelivermail code. SMTP has the message
 message is looping (#5.4.6) which is totally different from the message
 shown in the bounce.


 The message never reaches the final branch server. Its bounced by the
 central server.

 After reading this mail, I don't think that I have understood the setup.
How are the mails then picked up from the above Maildir?

Just to explain
I also use similar setup for banks who have branches with intermittent
connectivity. Typically, I don't use vdelivermail on the central server.
Just the maildir in the .qmail-default
i.e.
/mail1//autoturn/Maildir/
The delivered-To is inserted by the qmail-local program

On the branch servers I have fetchmail which uses ODMR (atrn) to pull the
mails from the central server and deliver it locally. ODMR causes
maildirsmtp to run on /mail1//autoturn/Maildir/ and strips of the
Delivered-To header when submitting it to the local SMTP on the branch
server. There is no issue with delivering as the Delivered-To is stripped
off.
But in your case you have to figure out the reason for the two Delivered-To:
headers. There should be only one.


!DSPAM:49f19f2a32686867214321!


Re: [vchkpw] Mails delivered by maildirsmtp bounce with looping error after upgrade from 5.4.9 to 5.4.27

2009-04-24 Thread Manvendra Bhangui
On Fri, Apr 24, 2009 at 1:52 PM, Koustubha Kale kmk...@gmail.com wrote:


 Delivered-To: alias-ppp-rc...@branch2.domain1.com
 Delivered-To: rc...@branch2.domain1.com
 From: sender sen...@branch2.domain1.com
 To: x...@xyz.com,
 rcpt1 rc...@branch2.domain1.com
 Cc: a...@xyz.com
 Subject: Re: some subject
 Date: Fri, 24 Apr 2009 13:23:40 +0530
 X-Priority: 1
 X-MSMail-Priority: High
 X-Mailer: Microsoft Outlook Express 6.00.2900.5512
 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579


There are two Delivered-To headers and that's the problem.
The first line is
Delivered-To: alias-ppp-rc...@branch2.domain1.com
The second is
Delivered-To: rc...@branch2.domain.com

Which of these two dissapear when you replace with the older vdelivermail?

What is your .qmail-default file for branch2.domain1.com?

What if you put just the maildir path in .qmail-default file?
/maildirpath/Maildir/


!DSPAM:49f1868932681366116692!


Re: [vchkpw] Mails delivered by maildirsmtp bounce with looping error after upgrade from 5.4.9 to 5.4.27

2009-04-24 Thread Manvendra Bhangui
On Fri, 2009-04-24 at 18:41 +0530, Koustubha Kale wrote:
 Question is why it causes mail is looping bounces with vdelivermail 5.4.27 
 and why not in 5.4.9 
 when both are receiving exactly the same headers? And what can I do to get it 
 working in 5.4.27? ( 
 The setup has been running past few years perfectly and still does with 
 everything upgraded except 
 vpopmail )
 
The difference is because of call to is_looping() in main() in vpopmail
5.4.27. The check earlier was only in deliver_mail().

You can use the vdelivermail.c.gz attached in this mail and see if it
solves the problem. The loopcheck behaviour can now be turned on by
setting the env variable LOOPCHECK


!DSPAM:49f1d05732687819611964!


vdelivermail.c.gz
Description: GNU Zip compressed data


Re: [vchkpw] vpopmail make install should support DESTDIR

2009-04-06 Thread Manvendra Bhangui
On Mon, 2009-04-06 at 08:53 -0500, Matt Brookings wrote:
 This information is set in the 5.5 branch.
 
  /home/experiments/vpopmail-5.4.27grep vpopmail.mysql *.c
  vmysql.c:Add error result for unable to read vpopmail.mysql and return
  it
  vmysql.c:sprintf(config, %s/etc/%s, VPOPMAILDIR,
  vpopmail.mysql);
  /home/experiments/vpopmail-5.4.27
  
  it needs to use SYSCONFDIR to be FHS compliant.
 
 It does, in 5.5.
 
 Try not to discuss what vpopmail does and does not do in reference to 
 development
 when looking at 5.4.  5.4 is locked.  If you want to know if vpopmail does 
 something,
 check 5.5 :)
WOW. I was outdated and I have just downloaded and compiled. I can even
see libvpopmail.so and I love it.
5.5 is a great piece of work. I have only one suggestion - Maybe later
we can look at LIBTOOL. That will make compilation of libvpopmail.so
portable.


!DSPAM:49da128732681015455080!



[vchkpw] libvpopmail.so vpopmail-5.5

2009-04-06 Thread Manvendra Bhangui
% sudo ldd /var/vpopmail/bin/vdelivermail 

linux-gate.so.1 =  (0x00f8c000)
libvpopmail.so = not found
libdl.so.2 = /lib/libdl.so.2 (0x00531000)
libcrypt.so.1 = /lib/libcrypt.so.1 (0x05bfc000)
libc.so.6 = /lib/libc.so.6 (0x0039)
/lib/ld-linux.so.2 (0x0036b000)

I had to do the following 

# echo /var/vpopmail/lib  /etc/ld.so.conf.d/vpopmail.conf
# /sbin/ldconfig

-- 
Manvendra Bhangui mbhan...@gmail.com
www.indimail.org


!DSPAM:49da144532686899313688!



Re: [vchkpw] vpopmail make install should support DESTDIR

2009-04-03 Thread Manvendra Bhangui
On Fri, 2009-04-03 at 18:49 -0400, John Simpson wrote:
 normally the configure command builds a file like config.h, which  
 all of the other source files include. my question was what  
 information is, or will be, available in config.h to tell where the  
 various pieces of the package (i.e. mailbox storage, binaries,  
 configuration info, documentation, etc.) are found, rather than  
 assuming (as we do now) that they will be in the domains, bin,  
 etc, doc, and other fixed-name directories within the home  
 directory of the vpopmail user.
 
 assuming this information is there, it would also be useful to the  
The information is not there apart from VPOPMAILDIR, QMAILDIR. IMHO one
will need to add few AC_DEFINE... statements in configure.in to have all
directories (prefix, localstatedir, sysconfdir, libdir, includedir, etc)
e.g. to open the configuration file vpopmail.mysql the code does it like
this

/home/experiments/vpopmail-5.4.27grep vpopmail.mysql *.c
vmysql.c:Add error result for unable to read vpopmail.mysql and return
it
vmysql.c:sprintf(config, %s/etc/%s, VPOPMAILDIR,
vpopmail.mysql);
/home/experiments/vpopmail-5.4.27

it needs to use SYSCONFDIR to be FHS compliant.



!DSPAM:49d6d26732681738714041!



Re: [vchkpw] vpopmail make install should support DESTDIR

2009-04-01 Thread Manvendra Bhangui
On Wed, Apr 1, 2009 at 12:52 PM, John Simpson j...@jms1.net wrote:

 On 2009-03-30, at 0844, Matt Brookings wrote:


 I think the build system needs is a way to stop the -o and -g statements
 when building a package, and to use them when not.  Most everyone has
 been installing vpopmail from source, and I have a feeling many will
 continue
 to.  We can't remove setting of permissions altogether because then people
 who used source would have to manually fix permissions.


 here's an idea... why not include a utility which sets the ownerships and
 permissions correctly?

Actually the program is not needed. One needs to fix configure.in and
Makefile.am. I am giving an example what should be in Makefile.am. This is
from a extremely hacked version of vpopmail. I am generating both rpm as
well as source installation.

The userid is needed only to figure out the home directory where vpopmail
needs to be installed. This can be fixed by changing configure.in

FILE - Makefile.am

install-data-local: initsvc libvpopmail.la vpopma...@version@-rpmlintrc
indimail.spec
if [  $(DESTDIR) =   ] ; then \
if test `...@idcommand@` != 0 ; then \
echo you are not root; \
exit 1; \
fi ; \
echo Shutting down vpopmail; \
svc -d /service/*; \
fi;

# This is the last step in vpopmail installation. Post this installation
will start in qmail
# Hence we still cannot start svscan.
install-data-hook:
$(INSTALL_DATA) config.h $(DESTDIR)@prefix@/include/indimail_config.h ||
exit 1
$(INSTALL_DATA) data/wordlist.db $(DESTDIR)@prefix@/etc/wordlist.db  ||
exit 1
for f in $(doc_list); do \
/bin/mkdir -p $(DESTDIR)@prefix@/doc; \
$(INSTALL_DATA) doc/$$f $(DESTDIR)@prefix@/doc/$$f || exit 1 ;\
done
if test `...@idcommand@` = 0 ; then \
for f in $(setuid_list); do \
if [ -f $(DESTDIR)@prefix@/bin/$$f ] ; then \
echo chown root $(DESTDIR)@prefix@/bin/$$f; \
chown root $(DESTDIR)@prefix@/bin/$$f; \
echo chmod 4555 $(DESTDIR)@prefix@/bin/$$f; \
chmod 4555 $(DESTDIR)@prefix@/bin/$$f; \
fi;  \
done; \
chown vpopmail.vchkpw $(DESTDIR)@prefix@/etc/wordlist.db || exit 1;
\
fi


!DSPAM:49d34f3532681317917420!


Re: [vchkpw] vpopmail make install should support DESTDIR

2009-04-01 Thread Manvendra Bhangui
On Wed, Apr 1, 2009 at 7:12 PM, Matt Brookings m...@inter7.com wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Manvendra Bhangui wrote:
  if [  $(DESTDIR) =   ] ; then \
  if test `...@idcommand@` != 0 ; then \
  echo you are not root; \
  exit 1; \
  fi ; \

 This was basically what I was planning on doing.  If they aren't root,
 and they haven't set the path to something they can potentially write to,
 it won't chmod or mkdir.

 That would cover the bases, right?

Yes. You got it right. RPM installation will typically use
DESTDIR=rpm_base/build_root_dir which will be writeable and hence you
need not do any chmod or chown.

For a user who plans to use source installation the steps would be

% ./configure
% make
% sudo make install-strip

So make will do the usual chmod/chown when it detects that it is running
under root user


!DSPAM:49d3718532684006790104!


[vchkpw] Re: Further Information for Building RPM for vpopmail

2009-04-01 Thread Manvendra Bhangui
On Wed, Apr 1, 2009 at 7:31 PM, Manvendra Bhangui mbhan...@gmail.comwrote:

 I have worked extensively last few months in building RPM for my project.
 So I can work with anyone who is doing this for vpopmail.
 For the RPM installation, it is a good practice to set the permission for
 every file/directory under the %files section. It shouldn't be done under
 %pre or %post section because then the RPM cannot figure out the permissions
 till it runs the script under %pre or %post section.
 Example of how the entries should be


I have generated the permissions for all the files in vpopmail installation.
Attaching the list as
vpopmail.files. This file can be used in the spec file as
%files -f vpopmail.files


!DSPAM:49d37ac132688492313895!


vpopmail.files
Description: Binary data


Re: [vchkpw] help porting qmail to auto-tools

2009-04-01 Thread Manvendra Bhangui
On Wed, Apr 1, 2009 at 10:05 PM, Itamar Reis Peixoto 
ita...@ispbrasil.com.br wrote:

 Hi

 I want to create rpm for qmal and vpopmail.

 anyone can help me porting qmail build system to gnu auto-tools ?


There are few who have already built rpm for qmail. Why reinvent the wheel?
or do you have some different thoughts on this.

http://www.google.co.in/search?q=qmail+rpmie=utf-8oe=utf-8aq=trls=org.mozilla:en-US:officialclient=firefox-a

For vpopmail, we can do it. We need to build a spec file. I have a spec file
which can be modified for vpopmail. I can send it to you offline. Post that
we can use openSUSE build service to build the RPM for the major linux
distros.

Let me know. You can mail me at mbhan...@gmail.com


!DSPAM:49d39eb132685804324027!


Re: [vchkpw] help porting qmail to auto-tools

2009-04-01 Thread Manvendra Bhangui
On Wed, Apr 1, 2009 at 10:47 PM, aledr matrixworkstat...@gmail.com wrote:

 I'm already packaging vpopmail on my home repo on openSUSE Build
 Service, you can check the spec file there at home:aledr.

 Just took a look at it. Looks like a good starting point. I also see that
you have netqmail. Why don't you include netqmail and vpopmail


!DSPAM:49d3a7a732687394575787!


Re: [vchkpw] vpopmail make install should support DESTDIR

2009-04-01 Thread Manvendra Bhangui
On Wed, Apr 1, 2009 at 9:41 PM, John Simpson j...@jms1.net wrote:

 the only problem i see at the moment is how the FHS stuff is going to
 affect where the files are. i want the program to self-adjust to FHS
 layout or built from source layout automatically, which means i'll need
 to be able to tell either which layout was used and what the FHS locations
 are, or if there's an internal list of directories (i.e. parent directory of
 all mailboxes, location of binary files, location of config files, etc.) i
 can use, and if those directory locations will be stored in a .h file which
 can be used by external programs (which would seem to make sense.)

 all these would be passed as arguments to the configure script. They are
stored in the file config.log. Else one can have a shell script which
creates a .h file using the options passed to the configure script. Just my
2 cents.


!DSPAM:49d3aad132689934912045!


[vchkpw] Domainkey-Signature to vpopmail list does not verify

2009-04-01 Thread Manvendra Bhangui
Just noticed that none of domainkey-signature in mails to vchkpw
mailling list verify. Looks like the dspam headers are the culprit. Is
it possible to have the headers above the domainkey-signature header?

-- 
Manvendra Bhangui mbhan...@gmail.com
www.indimail.org


!DSPAM:49d4491832681995072061!



Re: [vchkpw] vdelivermail stdout to Dovecot deliver

2009-03-30 Thread Manvendra Bhangui
On Mon, Mar 30, 2009 at 11:06 PM, Rick Romero r...@havokmon.com wrote:

 Programming question - if I write to fd0 (STDOUT), and then exec() a
 process, will that child process see the data I put in fd0 from the parent?
  Maybe I'll just try that as well.


make fd0 a file (using makeseekable) and do lseek (0, 0L, SEEK_SET);

Attached is a function which can make stdin seekable.


!DSPAM:49d192c032681954743819!


makeseekable.c
Description: Binary data


Re: [vchkpw] vpopmail make install should support DESTDIR

2009-03-29 Thread Manvendra Bhangui
On Mon, Mar 30, 2009 at 9:05 AM, Itamar Reis Peixoto 
ita...@ispbrasil.com.br wrote:

 what you think about a separated script called fixperms wich ends with
 exit ( 0 ) ?

 I use a command /usr/bin/fakeroot which allows most of the command to
succeed under non-root user
Fakeroot 
[1http://www.scratchbox.org/documentation/user/scratchbox-1.0/html/fakeroot.html#fakeroot]
is a utility that runs programs in an environment that looks as if they were
run with super-user privileges. It is used primarily for setting file
ownerships and modes before packaging them. You can for example create
device nodes and store them in a tarball while logged in as a normal user.
Of course, the programs run from a fakeroot session cannot really do
privileged system calls; fakeroot keeps an in-memory database of file
ownerships and such things.


!DSPAM:49d03f6632681441442462!


Re: [vchkpw] Added vmoduserflags binary to 5.5 branch

2009-03-27 Thread Manvendra Bhangui
On Fri, Mar 27, 2009 at 2:57 PM, Wouter van der Schagt
wou...@vdschagt.comwrote:

 I have one more request. Could you have a look at

 https://sourceforge.net/tracker/?func=detailatid=577801aid=2532389group_id=85937
 for possible inclusion in 5.5? It is a nice feature that is also useful in
 automation which
 is currently missing in the stable brach (as far as I know).

 That is exactly what the vmodddoman does (as described in the link above).


!DSPAM:49cc9d9432684702869566!


Re: [vchkpw] vmoddomain and vfilter

2009-03-27 Thread Manvendra Bhangui
On Fri, Mar 27, 2009 at 7:29 PM, Matt Brookings m...@inter7.com wrote:

 I'm adding vmoddomain to 5.5 along with a few other changes and I noticed a
 'vfilter' flag in
 vmoddomain which is not used.  What is the purpose of this flag?
  Left-overs from other work?
 If it has no specific use within vpopmail as a whole, which it appears it
 does not, I'll be
 removing it from the source file.


My mistake. That flag was meant for a filter executable built using eps. I
have not yet completed it for vpopmail. It should be removed.

Thanks Manvendra


!DSPAM:49cce1f632684624187547!


Re: [vchkpw] vpopmail now hosted in a Subversion repository

2009-02-10 Thread Manvendra Bhangui
On Tue, Feb 10, 2009 at 11:46 PM, Matt Brookings m...@inter7.com wrote:


 What does this patch do exactly?  From looking at the patch and trying it,
 I don't see any difference in operation related to the requirement of root.

The patch removes all references to user/groups in /etc/passwd and hence
dependency of having vpopmail user in /etc/passwd.

This will allow compilation of vpopmail without root. It will also allow
installation as non-root in a destination directory owned by the user.
e.g.
make DESTDIR=$HOME/vpopmail install

Once you do this, it would be trivial writing a .spec file for vpopmail and
build rpm as non-root.


!DSPAM:4991c70532683868620980!


Re: [vchkpw] vpopmail now hosted in a Subversion repository

2009-02-10 Thread Manvendra Bhangui
On Wed, Feb 11, 2009 at 12:14 AM, aledr matrixworkstat...@gmail.com wrote:

 I agree to add an option, I sent the patch just to explain myself. =D
 Can I write the modifications or someone of inter7 will do that?


the option enable-non-root-build has already been put by someone in
configure script.


-- 
Regards Manvendra - http://www.indimail.org


!DSPAM:4991cd5932687639499607!


Re: [vchkpw] New Command vmoddomain

2009-02-02 Thread Manvendra Bhangui
On Mon, Feb 2, 2009 at 2:28 PM, Wouter van der Schagt
wou...@vdschagt.comwrote:

 To compile, edit Makefile.am and add vmoddomain as a program in
 vpopmailbin_PROGRAMS
 and also add the following
 vmoddomain_SOURCES = vmoddomain.c
 vmoddomain_LDADD = libvpopmail.a @auth_libs@

 After editing Makefile.am you can do make


 I did that, but no success. Do i also have to modify Makefile.in ? Im on a
 Debian system.


You can also manually compile the program as below
you will have to replace /usr/local/mysql with the path you are using

cd vpopmail-5.4.26

gcc -I.  -g -O2 -Wall -c vmoddomain.c

gcc  -g -O2 -Wall   -o vmoddomain vmoddomain.o libvpopmail.a -Xlinker -R
-Xlinker /usr/local/mysql/lib/mysql -L/usr/local/mysql/lib/mysql
-lmysqlclient -lz -lm -lcrypt


!DSPAM:4986c48c32681786314763!


Re: [vchkpw] New Command vmoddomain

2009-01-31 Thread Manvendra Bhangui
On Sat, Jan 31, 2009 at 7:47 PM, Wouter van der Schagt
wou...@vdschagt.comwrote:

  Not that i can think off, most things are popbox specific. Is this in the
 development version already? if now, how can i link and test it?


vmoddomain.c is attached as a file in the following tracker
https://sourceforge.net/tracker2/?func=detailaid=2542381group_id=85937atid=577801

To compile, edit Makefile.am and add vmoddomain as a program in
vpopmailbin_PROGRAMS

and also add the following

vmoddomain_SOURCES = vmoddomain.c
vmoddomain_LDADD = libvpopmail.a @auth_libs@

After editing Makefile.am you can do make


!DSPAM:498490d232681910221151!


[vchkpw] New Command vmoddomain

2009-01-29 Thread Manvendra Bhangui
I have added a new command vmoddomain based on a request by Wouter van der
Schagt.
Have attached vmoddomain.c in the tracker request.

Currently the command will change the catch-all address

usage: vmoddomain [options] domain
options: -f   (Sets the Domain with VFILTER capability)
  -h handler (can be one of the following
(1 delete)
(2 bounce-no-mailbox)
(3 Maildir)
(4 Email Addres)

Apart from changing catch-all, can anything else be added to vmoddomain?

-- 
Regards Manvendra - http://www.indimail.org


!DSPAM:49816dc432685146912522!


Re: [vchkpw] Opinions needed - Bignum Arithmetic

2009-01-22 Thread Manvendra Bhangui
On Wed, 2009-01-21 at 21:13 -0800, Tom Collins wrote:
 Two thoughts on quotas.
 
 You're going to have to deal in sub-megabyte numbers, since the size  
 of most messages are measured in KB.  Maybe you could track the quota  
 in kbytes, rounding up/down as necessary?
 
 All programs that deal with the quota (maildirsize file) will have to  
 use 128-bit numbers (long long?) or whatever new method you come up  
 with.  This includes not just vpopmail, but your IMAP server and  
 potentially maildrop and qmail (if you have any .qmail files that are  
 handled by qmail and not vdelivermail).  Maybe they can use a  
 dynamically linked library?
 
In computer science, arbitrary-precision arithmetic, also called bignum
arithmetic, is a technique whereby programs perform calculations on
integers or rational numbers with an arbitrary number of digits of
precision.

I am planning to use GMP GNU Multiple Precision Arithmentic Library. It
claims to be the fastest bignum library on planet.
GMP is a free library/ There is no practical limit to the precision
except the ones implied by the available memory in the machine. GMP has
a rich set of functions to help you deal with these large numbers.

http://gmplib.org

At this point, I am not sure if bignum is an overkill, but I will be
trying this soon and will keep you folks posted

Regards Manvendra
(http://www.indimail.org)


!DSPAM:4978452a32681009520127!



Re: [vchkpw] Backfill patch

2009-01-15 Thread Manvendra Bhangui
On Fri, Jan 16, 2009 at 6:36 AM, Shane Chrisp sh...@2000cn.com.au wrote:

  Not having a go at the excellent work that's been done, but I don't know
 why anyone would want to run courier these days when Dovecot runs so much
 faster and uses so much less in the way of system resources.


I use courier imap for few reasons below. Honestly, I haven't studied
dovecot so much as to come to pros and cons.

   1.  IMAP and POP3 services get configured under supervise and tcpserver.
   i.e. courier-imap is daemontools and ucspi-tcp friendly. Since I use qmail
   as the MTA, everthing is quite like running qmail.
   2. The code is modular. The programs for login, authentication and actual
   implementation of IMAP/POP3 protocol are all handled by different programs
   (e.g. imaplogin, pop3login, authvchkpw, imapd, pop3d). This makes it trivial
   implementing of hooks into courier-imap. I have implemented hooks to force
   password change, implement instant bulletins, send welcome mails to new
   users, quota warning to users exceeding disk space, etc.
   3. The modular code has also helped me implement a proxy for IMAP and
   POP3. For an ISP we had around 3Million+ users. Using the proxy it was
   possible to have these users split across 30 different servers located at
   different places. NFS was not possible and the proxy authenticated against a
   database containing user locations and executed the executable imapd or
   pop3d on the remote host. The user could log in to any machine and still see
   all his/her mails.
   4. All configuration items in courier-imap are configurable through
   environment variables. e.g. IMAP_CHECK_ALL_FOLDERS, IMAP_EMPTYTRASH,
   MAXPERIP, MAILDIRPATH, etc. Hence using envdir invocation in the run file of
   supervise makes it possible to configure courier-imap through simple text
   files.

I am sure same would be possible in dovecot but I do not know as I have
grown up from the early days (2001) with courier-imap. One of these days I
might dirty my hands with dovecot. Till then it is courier-imap for me :)

Regards Manvenda (http://www.indimail.org)


!DSPAM:496ffbdb32671972818673!


[vchkpw] Backfill Patch for dir_control

2009-01-14 Thread Manvendra Bhangui
On Mon, 2009-01-12 at 08:22 -0600, Matt Brookings wrote:
 Okay.  I can definitely see how this would work.  It is a reasonable
 solution, and I'd be very interested to see a completed patch against
 the CVS head.
 

I have completed the patch.

How do I use CVS? I know very little of CVS. But any pointers would
help. I anyway would want to learn using cvs as it would benefit me in
using it for my own projects.

Meanwhile I have submitted the patch on sourceforge. Patch ID: 2507177
https://sourceforge.net/tracker2/?func=detailaid=2507177group_id=85937atid=577800


The patch fill create a new file backfill.c, modify make_user_dir() and
vdeluser() functions in vpopmail.c. It also modifies Makefile.am to
compile backfill() function.

Apart from providing backfill(), the patch also provides an
authentication module for courier-imap (which I am maintaining). The
executable authindi needs to be copied to courier-imap's authlib
directory.

 It would be interesting to see a more efficient method where duplicates,
 as in your example, the hash directory 2, could be listed a single time.

I get the point. Will work on this but would take some more time. This
would be easier to do in MySQL though.

 Remember that this feature does not yet exist, and that there are probably
 many systems with backfilling needs that go back years.  Potentially this
 patch could hit a system with four levels of hashing simply because there's
 been a lot of additions and deletions.  If the backfill patch doesn't take
 this into consideration, we may need to consider writing some sort of
 utility to analyze and clean, a system that is overhashed.

If someone could work on a script which does ls on the domain
directories and creates this file, the script would then fulfill the
needs of some of us who needs backfilling. I can do this script probably
this Saturday. Let me know if this is also needed.
Dave,
Your dircheck.sh script could shorten the development time for me. I
just will have to subtract your numbers from 100.

Regards Manvendra 
from www.indimail.org


!DSPAM:496e00c232671814015369!



Re: [vchkpw] vpopmail development

2009-01-12 Thread Manvendra Bhangui
On Fri, 2009-01-09 at 08:57 -0600, Matt Brookings wrote:
 This would not work because users can be deleted out of the hash tree
 anywhere.  It appears your patch assumes a FILO ordering of user additions
 and deletions.
I have not been able to explain properly. It would be FIFO.

 If the hashes, 'a' through 'd' existed, and the 'b' hash directory cleared
 out, your method would fail to backfill correctly.
Let's take an example
suppose
there are 100 users (with 100 directories) in /var/vpopmail/domains
there are 100 users (with 100 directories) in /var/vpopmail/domains/0
there are 100 users (with 100 directories) in /var/vpopmail/domains/1
there are 100 users (with 100 directories) in /var/vpopmail/domains/2
there are 50  users (with  50 direcotires) in /var/vpopmail/domains/3

Now let say I delete a user who has a directory
in /var/vpopmail/domains/1
The backfill code will put the entry '1' in the first line in the file
dir_control_free.
Also let us say that we delete two users in /var/vpopmail/domains/2
The backfill code in vdeluser will put entry '2' twice in the file
dir_control_free

So after deleting 3 users, the file dir_control_free will have 3 lines
1
2
2


So now we have 99 users in /var/vpopmail/domains/1
andwe have 98 users in /var/vpopmail/domains/2

Now the modified vadduser will call a function called backfill() which
will open this file, lock the file and pickup the first line, delete the
line and return the value as user_hash

#ifdef USERS_BIG_DIR
  /* go into a user hash dir if required */
  if (!(user_hash = backfill(domain)))
  {
  open_big_dir(domain, uid, gid);
  user_hash = next_big_dir(uid, gid);
  close_big_dir(domain, uid, gid);
  chdir(user_hash);
  }
#endif

Each time the function backfill() is called it will deplete the file
dir_control_free by one line and will always return the first line as
the user_hash. When all lines get depleted, backfill() will return NULL
in which case the regular dir_control will again come into effect and
start from where it had left earlier.

The advantage of this method is that you can use the find command to
generate the missing directories in dir_control_free to catch up with
the actual dir_control.

Another way to explain this is that when backfill is in operation,
dir_control stops working and when backfill() gets depleted and stops
working, dir_control starts working


!DSPAM:496b235e32678184414047!



Re: [vchkpw] vpopmail development

2009-01-08 Thread Manvendra Bhangui
On Thu, 2009-01-08 at 17:10 -0500, DAve wrote:
 My reward for fixing the dir_control to backfill still stands.
 
 http://pixelhammer.com/Dan/aargh.jpg
 
 Follow the thread...
 http://www.mail-archive.com/vchkpw@inter7.com/msg25272.html
 
 I could improve on the prize some as well, how about two dozen award 
 winning homemade cookies and a snapped drive shaft u-joint from the 
 Seattle Monorail?
Following the thread above I have the following idea on how to achieve
this
1. vdeluser appends the directory being deleted in a MySQL table (for
   file for cdb backend). The latest directory deleted will be at the 
   end. Let's say this filename is dir_control_free
2. vaddduser locks this file (dir_control_free). Picks up the first
   entry and assigns the new user the first prefix and after creating
   the user and the Maildir, deletes the line. No changes will be made
   to dir_control if a entry exists in this file. When all entries are 
   backfilled, dir_control will again get used.

I will work on this and have a patch ready for vpopmail and incorporate
in Indimail - http://www.indimail.org


!DSPAM:4966e0e232671449321458!



[vchkpw] ANNOUNCE: Flexible Single Sign-On for IndiMail and Vpopmail

2008-09-04 Thread Manvendra Bhangui
FSSOS stands for Flexible Single Sign-On Solution and
has been written by Ben Goodwin for extending
authentication via getpwnam(), getspnam(), getgrent(), etc calls.

Official website: http://fssos.sourceforge.net/

This source has been hacked and adapted to IndiMail as nssd from the
FSSOS site.

The hacked source will also work with vpopmail by just changing the
configuration file nssd.conf. You just need to change the table_name,
username, password, uid, gid appropriate for your vpopmail installation.

nssd is a multi-threaded daemon and pre-connects to MySQL. This
saves response times in user lookup queries as one no longer needs
to keep on making and breaking connections to MySQL

nssd is experimental and without warranty.

The hacked source can be downloaded from
http://downloads.sourceforge.net/indimail/nssd-1.0.tar.gz

Modification has been made to have user and domain in the query
e.g. [EMAIL PROTECTED] gets split into mbhangui as the user
and gmail.com as the domain. This split allows authentication against
IndiMail's MySQL database. By just changing the configuration,
authentication should also work for vpopmail. The other change I have
made is to make the Name Service Switch daemon supervise friendly.

You may also want to look at the wonderful original code written by Ben.

You may find this of use if you want to run a IMAP/POP3 server which
does not yet have support for IndiMail or vpopmail

Having this installed allows many IMAP/POP3 servers which use
getpwnam(), getspnam(), PAM, etc to authenticate against IndiMail's
database without making a single change to the IMAP/POP3 server code.
This gives a Yet Another Way to have courier-imap, dovecot, etc to
authenticate against your own custom MySQL database.

NSSD - Name Service Switch Daemon

Supported Operating Systems:
o Linux (glibc = 2.2.5)
o Solaris (Sparc or Intel = 8) (SEE NOTE BELOW)
o FreeBSD (5.1+, prefer 5.2+)   (SEE NOTE BELOW)

Supported MySQL Versions:
o MySQL 3.23.9 - 6.0.3-alpha

Supported Compilers:
o GCC (2.95.2, 3.x)

Prerequisites
=
o Installing from source:
  o A functional compile environment (system headers, gcc, ...)
  o MySQL client library  header files (local)
  o MySQL server (local or remote)

INSTALLATION DETAILS

o If installing from source:
  o wget http://downloads.sourceforge.net/indimail/nssd-1.0.tar.gz
  o ./configure --prefix=/var/indimail \
--default-domain=indimail.org --with-mysql=/usr/local/mysql
  o make
  o make install-strip
# For IndiMail, to install a supervise service, run the svctool
  command
# For vpopmail, you need to have nssd run either by supervise or
  by your favourite method (rc, etc)
   o ./svctool --pwdlookup=/tmp/nssd.sock --threads=5 \
 --timeout=5000 \
--mysqlhost=localhost --mysqluser=indimail \
 --mysqlpass= \
 --mysqlsocket=/tmp/mysql.sock --servicedir=/service

On some systems, libtool insists on adding -lc to the link stage
(due to the way gcc was built for that system), which breaks nssd
threading in daemon mode.  If you see a -lc before a -pthread or
-lpthread, then you're in trouble.  You'll notice the broken
behavior in the form of fewer-than-expected threads running (3) and
the inability to kill the parent process off without a -9 signal. 
To fix this, do
the following:
PTRHEAD_LIBS=-lpthread -lc ./configure
and then run make/make install.

If your MySQL installation is based in a strange directory, use
the --with-mysql=DIR option of ./configure to specify.  For example,
./configure --with-mysql=/usr2

o Edit /var/indimail/etc/nssd.conf (or /var/vpopmail/etc/nssd.conf)
  You will find nssd.conf in samples directory of the source

o Edit (or create) /etc/nsswitch.conf such that it contains at least
  the following:
  passwd: files nssd
  shadow: files nssd

  If you don't want groups from MySQL, simply don't include 'nssd'
  in in the 'group' line.

o Start 'nssd' (e.g. /var/indimail/sbin/nssd or
  /var/vpopmail/sbin/nssd)
  you can use supervise
  I have the following lines in the run file
  #!/bin/sh
  # $Id: svctool.in,v 2.69 2008-09-04 16:41:45+05:30 Cprogrammer Exp
mbhangui $
  # generated on i686-pc-linux-gnu on Thu Sep  4 16:45:35 IST 2008
  # ./svctool --pwdlookup=/tmp/nssd.sock --threads=5 --timeout=5000
--mysqlhost=localhost --mysqluser=indimail --mysqlpass=ssh-1.5-
--mysqlsocket=/tmp/mysql.sock --servicedir=/service

  exec /var/indimail/bin/envdir /service/pwdlookup/variables \
  /var/indimail/bin/setuidgid indimail /var/indimail/sbin/nssd -d
debug 21

Regards Manvendra

The individual choice of garnishment of a burger can be an important
point to the consumer in this day when individualism is an increasingly
important thing to people. -- 

Re: [vchkpw] Set external and internal users

2008-08-29 Thread Manvendra Bhangui
On Fri, 2008-08-29 at 17:06 +0800, Kenny Lee wrote:
 not really understand ... please you tell me where to set the auth smtp or 
 disable the default allowed relay ?
vpopmail should have been configured with --enable-roaming-users while
building vpopmail. I am assuming that this was done

1. Check your qmail-smtpd run file. It would refer to a cdb file i.e
   -x /var/vpopmail/etc/tcp.smtp.cdb
   
   The above file contains rules for tcpserver. One of the rules could
   be setting the environment variable RELAYCLIENT.
   If this variable is set for an IP address, qmail-smtpd will relay the
   mail through.

   This file should be updated everytime a person  authenticates. When
   you authenticate using IMAP or POP does the timestamp of this file
   change? 

   When you set vmoduser -r, this file should not get updated if you
   login with the user for whom vmoduser -r has been set

   what is the output of
   strings /var/vpopmail/etc/tcp.smtp.cdb




!DSPAM:48b7c3db32311318313575!



Re: [vchkpw] Set external and internal users

2008-08-28 Thread Manvendra Bhangui

On Thu, 2008-08-28 at 14:31 +0800, Kenny Lee wrote:
 Internal group: which mean that those user set in this group can send mail 
 to example.com's users only.

vmoduser -r [EMAIL PROTECTED]

sets no external relay  flag - which means the user should not be able to
send mails to external domains. However this needs to be done for each
user. I am not sure if there is a concept of groups in vpopmail.


!DSPAM:48b6842d32311014182908!



[vchkpw] brand new courier-imap authmodule for vpopmail-5.4.26d

2008-08-28 Thread Manvendra Bhangui
I think this might be useful for few.

so I did a strace to hack the courier-imap authentication protocol.

I have tweaked a bit the module which i wrote for IndiMail to make it
work for vpopmail. The module is totally independent of courier-imap
(i.e. it will get installed in the vpopmail bin directory without the
presence of courier-imap). And you need not depend on courier-imap
mailing list for help. However, you need to copy the executable
'authvchkpw' manually to the courier-imap libexec/authlib directory.

To install it you need to apply patch to vpopmail-5.4.26d. It modifies
Makefile.am, configure.in, vpopmail.c,vpopmail.h and creates a new file
authvchkpw.c. I have tested it on my laptop and found it to work.

You need to set AUTHMODULES in courier-imap needs to have authvchkpw as
one of the authentication modules

The module does the following

reads 5 lines from imaplogin or pop3login. Authenticates the user and if
successful executes imapd or pop3d executable. If the authentication is
not successful, the data is passed to the next authmodule in chain.
On successful authentication the module adds entry to lastauth and a
entry in relay table.

Instructions are in INSTALL section below. If you need more help let me
know. If more modifications are needed let me know.

/*
 * Courier-IMAP authmodules Protocol
 * imap\n
 * login\n
 * [EMAIL PROTECTED]
 * pass\n
 * newpass\n
 * argv[0]=/var/indimail/libexec/authlib/authvchkpw
 * argv[1]=/var/indimail/libexec/authlib/authpam
 * argv[2]=/var/indimail/bin/imapd
 * argv[3]=Maildir
*/

INSTALLATION

1. Extract vpopmail Development tar.gz file vpopmail-5.4.26d.tar.gz
  wget http://downloads.sourceforge.net/vpopmail/vpopmail-5.4.26d.tar.gz
   cd /home/local/src
   gunzip -c vpopmail-5.4.26d.tar.gz |tar xf -

2. Apply patch (see the link at bottom)
   patch -p0  authvchkpw-vpopmail-5.4.26d.patch

3. cd vpopmail-5.4.26
   su
   make
   make install-strip

I have submitted the patch here

https://sourceforge.net/tracker/download.php?group_id=85937atid=577800file_id=291128aid=2080688

Thank you for your patience

-- Manvendra
The coast was clear. -- Lope de Vega



!DSPAM:48b6c16b32312378210272!



[vchkpw] ANNOUNCE: IndiMail authmodule for courier-imap

2008-08-24 Thread Manvendra Bhangui
IndiMail (http://www.indimail.org) works with a hacked authvchkpw module
to authenticate with courier-imap.

courier-imap no longer supports the vchkpw module. After getting tired
of frequently hacking the authvchkpw module to work with new versions of
courier-imap, I have finally made the module independent of
courier-imap.

The new module 'authindi' reads data from file descriptor 3 the way
courier-imap expects it's authentication modules to read. It then
queries IndiMail's authentication database using 'inlookup' query
daemon. If the authentication is successful, it writes an entry in the
relay table for relay, lastauth table for audit. It then executes imapd
or pop3d executable. If the authentication is unsuccessful, it calls
other authentication module in the pipeline. inlookup has the same
purpose as that of vpopmail's vpopmaild daemon. But it works on a fifo
instead of sockets.

The authindi module can easily be hacked to make it work with vpopmail.
For those who may be interested you can download the patch at
http://downloads.sourceforge.net/indimail/indimail-1.1-rc1.patch.gz

The patch is meant for indimail, however you may create an
empty indimail-1.0 directory and apply the patch. (ignore the
error for Makefile.am)

I am currently working on a generic PAM module which will allow any IMAP
Server's PAM authentication module to authenticate using
1) a command
2) a pipe
3) any MySQL query

I am writing in a way that it will work for both IndiMail and vpopmail
and make it possible for any IMAP server to authenticate against
vpopmail or IndiMail. I have the partly completed source code for anyone
who could volunteer to give some help.



!DSPAM:48b141c832316338118711!



[vchkpw] libnss support for IndiMail/vpopmail

2008-08-19 Thread Manvendra Bhangui
I feel happy to announce that I have built NSS support for IndiMail
(http://www.indimail.org).

It is based on a patch on libnss-mysql at sourceforge.net. IndiMail is
mail server which patches qmail to integrate qmail-smtpd (auth,
relay,etc), qmail-local, qmail-remote, with IndiMail's MySQL database.
The patch should work for vpopmail as the schema for the user
database is the same (just change the sql statement in config file)

The patch is standalone and can easily adapted or adopted for your own
MySQL database.

NSS stands for NameService Switch.  NSS allows you to implement access
to various data using any number of modules.  This means that when the
operating system wants to look any user, it doesn't have to know how -
it calls upon the NSS system to perform the task. 

One can write modules for NSS to look for users in places other
than /etc/passwd, /etc/shadow.

The NSS API is the backend for lookup routines like getpwnam(),
getpwuid(), etc

Almost all IMAP servers that I know of have modules to authenticate
users out of /etc/passwd, /etc/shadow, etc. By using NSS, authentication
of IMAP servers can be extended to use databases like MySQL, LDAP.

You can download the libnss-mysql at
http://sourceforge.net/project/showfiles.php?group_id=56073release_id=354053

and the patch for IndiMail at
http://downloads.sourceforge.net/indimail/libnss-mysql-1.5.patch.gz

to build NSS support for Indimail. For other mail servers, you may
want to change the SQL statement in the libnss-mysql.cfg configuration
file.

libnss-mysql and this patch allows an Imap Server like the courier imap
to use the authpam module shipped with it without changing a single line
of courier-imap.

The patch builds support for PAM routines to authenticate users against
IndiMail's MySQL database. I have tested this with courier imap's
authpam.

Installation involves familiar ./configure; make; make install
Configuration involves putting 2 files in /etc
a) libnss-mysql.cfg
   This file specifies the SQL statement for selecting a user from
   a MySQL database
b) libnss-mysql-root.cfg
   This file specifies connection parameters for connecting to your
   MySQL database
c) modifying /etc/nsswitch.conf and have the two lines below
   passwd: files mysql
   shadow: files mysql

Two big advantage as I see it
1) the function getpwnam() gets extended and applications which use
   this routine automatically gets extended for user lookups in
   MySQL database
2) You can run the Name Service Cache Daemon (/usr/sbin/nscd) on linux.
   nscd gives you good performance boost by caching repeated requests.

You can modify the SQL statement in the file /etc/libnss-mysql.cfg to
use your own specific MySQL database.

You can compile a small tester program to test
users in your own MySQL databse.
(do gcc try.c -o try to compile)

Enjoy

--Manvendra

Very few profundities can be expressed in less than 80 characters.



!DSPAM:48aba40e32311478119004!



Re: [vchkpw] vpopmail postfix devel mailing list / calling all experts

2004-10-01 Thread manvendra bhangui
On Fri, 1 Oct 2004 00:11:21 -0500, Jeremy Kitchen [EMAIL PROTECTED] wrote:
 Due to recent displays of interest for vpopmail/postfix integration on this

I wrote a postfix wrapper for vdelivermail 1.5 years ago. With the
wrapper you can use either qmail or postfix with vpopmail. Also the
wrapper does not require qmail to be installed.

Some postfix error code from sys_exits.h could have changed. If any
one wants to hack the code below, they are free do do. Also like any
other free software, my code comes
without warranty or obligations. I also claim no copyrights, etc. You
are free to do anything with the code (except to involve me). If you
do something useful with the code, let me know :)

1. Edit main.cf and master.cf (assuming you have installed and
configured postfix)

Have the following in main.cf

local_transport = vdel
vdel_destination_recipient_limit = 1

Have the following line in master.cf (mind the line wrap)
vdel unix  -   n   n   -   100   pipe 
 flags=Fq. user=vpopmail argv=/var/vpopmail/bin/postdel -u $user -d
$recipient -r $sender

2. Compile postdel.c
   gcc postdel.c -s -O -o postdel
   cp postdel /var/vpopmail/bin

I used to use it on production before I switched back to qmail.


postdel.c.gz
Description: GNU Zip compressed data


Re: [vchkpw] R: [vchkpw] alias problem

2004-08-09 Thread manvendra bhangui
You can get eliminate dups from

http://www.gormand.com.au/peters/tools/

-- 
Regards Manny

Unix is simple, but it takes a genius to understand the simplicity.
 - Dennis Ritchie


Re: [vchkpw] alias problem

2004-08-06 Thread manvendra bhangui
On Fri, 6 Aug 2004 11:22:17 +0200, fmessere [EMAIL PROTECTED] wrote:
 My mail account is insert in a lot of aliases so if someone send a mail to
 two or tree of this I receve the same  mail a lot of time. Is there a way to
 avoid this?
 
google  eliminate-dups

-- 
Regards Manny

Unix is simple, but it takes a genius to understand the simplicity.
 - Dennis Ritchie


Re: [vchkpw] simscan test release: simplified scanner for clamav/spamassassin

2004-07-27 Thread manvendra bhangui
On Tue, 27 Jul 2004 12:57:20 -0500, Ken Jones [EMAIL PROTECTED] wrote:
 
 Anyone interested in trying simscan before I release it?

Can you send it to me ? I will love to try it.

-- 
Regards Manny

Unix is simple, but it takes a genius to understand the simplicity.
 - Dennis Ritchie


Re: [vchkpw] Qmail should queue every mail

2004-01-09 Thread Manvendra Bhangui
two solutions

1. Don't start qmail-send in your RC script (in case u are not
using supervise (comment out the line having qmail-start).
If qmail-send is already running 

kill pid of qmail-send 
   
   If using supervise, 
   touch /service/qmail-send/down
   svc -d /service/qmail-send
   (having the down file will prevent qmail-send to come up
the next time you reboot your m/c)

2. have 0 in the control files concurrencylocal and concurrencyremote


Regards
On Fri, 2004-01-09 at 16:41, Werner Schalk wrote:
 Hi guys,
 
 I know this is not the official qmail list but I might get the best answers on 
 this list here :-)
 
 How can I make qmail to queue every incoming mail and not sending it? I mean 
 qmail should keep every mail in its queue without actually delivering it. How 
 can I do that?
 
 Bye and thanks,
 Werner.
-- 
Manvendra Bhangui [EMAIL PROTECTED]



Re: [vchkpw] Re: Tom's fork of vpopmail (and qmailadmin)

2003-09-10 Thread Manvendra Bhangui
Let us stop this now and put this war behind us. I can see that Tom has
added Ken as an admin. Cheers to Tom and Ken

Regards Manvendra
On Wed, 2003-09-10 at 19:39, Benjamin Tomhave, CISSP wrote:
 First off, everybody needs to quit whining.  Seriously, if Tom hadn't
 taken up the reins, there would be ZERO DEVELOPMENT on this project right
 now.  Unless you were willing to send a truck of cash to Inter7, they
 would often not even respond to emails asking whether development would
 continue, let alone addressing actual, verified bugs in the code.
 
 Second, if there's confusion about what a devel release is versus a
 stable release, then I suggest you go back to kindergarten, because this
 is NOT A NEW METHOD for developing an open source project.  If you're
 confused, perhaps it's because you're not very smart, in which case maybe
 you ought not be a systems administrator.  Some of us are running devel
 code in our production environments because we needed features that Inter7
 didn't seem inclined to add, such as seekable patch, etc.  Under the
 pressure of meeting customer demands, it has been absolutely necessary to
 install devel releases.  HOWEVER, that DOESN'T MEAN installing EVERY devel
 release -- just installing one that seems stable while providing the
 needed functionality.
 
 Third, there are certainly improvements that can be made to the PROCESS. 
 But, btw, in case everybody was sleeping when he announced it, Tom has
 created a vpopmail-devel mailing list where all of you can contribute to
 the devel discussions, where, oh btw, the question of CVS access has been
 presented previous and will, I believe, be forthcoming.
 
 Should this be a separate fork?  No.  Why?  Because, imho, regardless of
 what Ken Jones might claim, vpopmail has been shelved by Inter7, and is
 thus a dead product without this open source SF project.  Inter7 has
 failed, probably for economic reasons, to continue supporting the product
 in the open source community, which has been a very common occurrence over
 the past few years.  That anybody took over the development and moved it
 forward is quite amazing, and I think we all ought to heartily thank Tom
 for doing so.
 
 Now, onto the specific concerns raised, I think the following practice
 should be adopted:
 1) CVS should be enabled.
 2) If KJ wants to be an admin, then he needs to justify his request more
 than it was my baby originally, and then he should be added.
 3) Instead of releasing devel releases, I think we should switch to a
 nightly build approach so that there is stable-current and then
 latest-devel, and not a string of devel releases.  Tom, I would probably
 list 3 packages total: 5.2.x-stable, the last 5.3.x release from Inter7,
 and then 5.3.x-latest-devel.
 4) Inter7 needs to get over themselves and gradually join back into the
 development, IF AND ONLY IF they plan to play nicely with others.  If they
 don't, then maybe they should go get bent since there's been a ton of
 positive movement on this project in their absence.  NO FORKING.
 
 Disclaimer: If you disagree with these comments, that's your prerogative,
 but I personally don't want to hear sniping comments back about it,
 because frankly, I don't value the opinion of most of you.  The list
 membership over the past year has become overpopulated with whiny idiots
 who have no appreciation for where the product has been, how it almost
 died, and how it has now seen tremendous progress in the absence of Ken
 and Inter7.
 
  On Tuesday, September 9, 2003, at 10:07  AM, Ken Jones wrote:
  Just so everyone knows. Tom Collins is attempting
  to fork the vpopmail project. He refuses to let me
  share ownership of the vpopmail and qmailadmin
  projects on source forge. When I asked him to
  add me as an owner on the project he said he
  refuses now and at any time in the future to
  allow me to share ownership.
 
  I have forked ownership since I felt that Inter7 was doing a poor job
  of maintaining vpopmail and qmailadmin.  I readily acknowledge that Ken
  created vpopmail and qmailadmin.  They're GPL projects, so I'm free to
  fork them if I like.  Since moving the projects to SourceForge, we've
  kept up with submitted patches and bug reports.  I feel that making the
  move was beneficial to the projects themselves and the people that use
  them.
 
  I'm certainly not doing this to be malicious or to hurt Ken and Inter7.
 
  I've told Ken that he's more than welcome to contribute to the project
  on SourceForge, or to maintain his own version of vpopmail and
  qmailadmin.  I also stated that until I stopped actively maintaining
  vpopmail and qmailadmin, I saw no need to add him as a project
  administrator.  Michael Bowe has been actively involved with vpopmail
  development, and I had no problem adding him as an admin.
 
  Ken Jones hasn't contributed to vpopmail and qmailadmin development
  since March.  We've had 12 qmailadmin releases and 7 vpopmail releases
  since then.  Managing the 

Re: [vchkpw] uid and gid in assign

2003-01-08 Thread Manvendra Bhangui

correct your assign file (put back the first one) and run
/var/qmail/bin/qmail-newu. After that run
chown -R vpopmail:vchkpw ~vpopmail/domains/mavin.ath.cx

On Wed, 8 Jan 2003 08:59:16 +0100
Tobias Åman [EMAIL PROTECTED] wrote:

 Sorry it was me who wrote that mail to fast it should be like this
 
 first it looked like this
  +mavin.ath.cx-:mavin.ath.cx:89:89:/home/vpopmail/domains/mavin.ath.cx
 
  now it looks like this
  +mavin.ath.cx-:mavin.ath.cx:502:502:/home/vpopmail/domains/mavin.ath.cx
 
 502 is the vpopmail useraccount and 89 is vchkpw
 
 This is what i get from the ls -lisadn ~vpopmail/domains/mavin.ath.cx
 11141134 drwx--6 502  89   4096 Jan  7 14:30
 /home/vpopmail/domains/mavin.ath.cx/
 
 Although i get this one when i added a new domain
 35061784 drwx--5 502  502  4096 Jan  7 15:29
 /home/vpopmail/domains/star.homeftp.org/
 
 Regards Tobias
 
 - Original Message -
 From: Peter Palmreuther [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, January 07, 2003 4:48 PM
 Subject: Re: [vchkpw] uid and gid in assign
 
 
  Hi Tobias,
 
  On Tue, 7 Jan 2003 16:00:41 +0100
  Tobias Åman [EMAIL PROTECTED] wrote:
 
   What uid and gid should be assigned in /var/qmail/user/assign
  
   mine looked like this
  
   +mavin.ath.cx-:mavin.ath.cx:89:89:/home/vpopmail/domains/mavin.ath.
   cx:-::
  
  
   now i looks like this
  
   +mavin.ath.cx-:mavin.ath.cx:89:89:/home/vpopmail/domains/mavin.ath.
   cx:-::
  
   This happend after i re installed som stuff lika vpopmail and
   reconfigured qmail
   what is the right one ? how does yours look like ?
 
  I'm really sorry, but I don't see any difference.
 
  Nevertheless: the UID and GID given in there should be the one
  vpopmail runs the domains as. In general this are the UID and GID of
  vpopmail, unless you gave a different system-user when creating the
  domain with'vadddomain'.
 
  A hint could be the output of
 
  ls -lisadn ~vpopmail/domains/mavin.ath.cx
 
  The UID and GID given there should be the one in assign-file.
  --
  Peter
 
 
 




Re: [vchkpw] uid and gid in assign

2003-01-08 Thread Manvendra Bhangui

Are you using vadddomain on this server compiled from a different box ?

Regards Manvendra
On Wed, 8 Jan 2003 08:59:16 +0100
Tobias Åman [EMAIL PROTECTED] wrote:

 Sorry it was me who wrote that mail to fast it should be like this
 
 first it looked like this
  +mavin.ath.cx-:mavin.ath.cx:89:89:/home/vpopmail/domains/mavin.ath.cx
 
  now it looks like this
  +mavin.ath.cx-:mavin.ath.cx:502:502:/home/vpopmail/domains/mavin.ath.cx
 
 502 is the vpopmail useraccount and 89 is vchkpw
 
 This is what i get from the ls -lisadn ~vpopmail/domains/mavin.ath.cx
 11141134 drwx--6 502  89   4096 Jan  7 14:30
 /home/vpopmail/domains/mavin.ath.cx/
 
 Although i get this one when i added a new domain
 35061784 drwx--5 502  502  4096 Jan  7 15:29
 /home/vpopmail/domains/star.homeftp.org/
 
 Regards Tobias
 
 - Original Message -
 From: Peter Palmreuther [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, January 07, 2003 4:48 PM
 Subject: Re: [vchkpw] uid and gid in assign
 
 
  Hi Tobias,
 
  On Tue, 7 Jan 2003 16:00:41 +0100
  Tobias Åman [EMAIL PROTECTED] wrote:
 
   What uid and gid should be assigned in /var/qmail/user/assign
  
   mine looked like this
  
   +mavin.ath.cx-:mavin.ath.cx:89:89:/home/vpopmail/domains/mavin.ath.
   cx:-::
  
  
   now i looks like this
  
   +mavin.ath.cx-:mavin.ath.cx:89:89:/home/vpopmail/domains/mavin.ath.
   cx:-::
  
   This happend after i re installed som stuff lika vpopmail and
   reconfigured qmail
   what is the right one ? how does yours look like ?
 
  I'm really sorry, but I don't see any difference.
 
  Nevertheless: the UID and GID given in there should be the one
  vpopmail runs the domains as. In general this are the UID and GID of
  vpopmail, unless you gave a different system-user when creating the
  domain with'vadddomain'.
 
  A hint could be the output of
 
  ls -lisadn ~vpopmail/domains/mavin.ath.cx
 
  The UID and GID given there should be the one in assign-file.
  --
  Peter
 
 
 




Re: vadddomain not adding domain

2001-08-05 Thread Manvendra Bhangui

Check out your /var/qmail/users/assign file. The entry would be there.
Remove it and run /var/qmail/bin/qmail-newu

On Sat, 4 Aug 2001, chris larsen wrote:

 Date: Sat, 4 Aug 2001 23:44:44 -0500
 From: chris larsen [EMAIL PROTECTED]
 To: [EMAIL PROTECTED] [EMAIL PROTECTED]
 Subject: vadddomain not adding domain
 
 Hi All,
 I've scoured the list and looked all over the net but to no avail in finding the 
answer to this question:
 
 Why can I add domains just fine, but when it comes to a domain that I had under a 
previous installation, it tells me that it can't find the directory 
/usr/home/vpopmail/domains.
 
 the real location is /home/vpopmail/domains... and as I said, I can add domains 
other that one of which I had prior.  My mysql vpopmail db is cleared out, i've 
looked in all makefiles, etc, there's nothing in my control files that point to this 
old domain, and i've done a grep for this string system-wide.  There's not any trace 
of it being around.
 
 Anyone know why this might be happening or where I can change this path back to 
/home/vpopmail instead of /usr/home/vpopmail for this particular domain???
 
 Thanks much!
 
 Chris
 




Re: qmail and Hight CPU

2001-07-12 Thread Manvendra Bhangui

root  1096  0.8  0.2  1336  348 ?SJul10  15:40 supervise
qmail-imapd

You have a problem with your supervise supvervising imapd. It could be if
you have alread started the imapd outside supervise and hence supervise is
not able to start it (bind address already in use). If the run script exits
because of such reasons, supervise will keep on trying to execute the run
script and in the process consume CPU. To test this out just cd to the
directory i.e. /service/qmail-imapd
and execute ./run manually and see what happens
- Original Message -
From: Miranda Gomez Miguel Angel [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 12, 2001 1:04 AM
Subject: qmail and Hight CPU


 Im having a problem, my cpu looks pretty busy and i dont have many
 concurrent connections, this is the output of ps aux

 root  1081  0.0  0.2  1372  376 ?SJul10   0:00 svscan
 root  1089  0.0  0.2  1336  348 ?SJul10   0:00 supervise
 qmail-send
 root  1090  0.0  0.2  1336  348 ?SJul10   0:00 supervise
log
 root  1092  0.0  0.2  1336  348 ?SJul10   0:00 supervise
 qmail-smtpd
 root  1093  0.0  0.2  1336  348 ?SJul10   0:00 supervise
log
 root  1094  0.0  0.2  1336  348 ?SJul10   0:00 supervise
 qmail-pop3d
 root  1095  0.0  0.2  1336  348 ?SJul10   0:00 supervise
log
 root  1096  0.8  0.2  1336  348 ?SJul10  15:40 supervise
 qmail-imapd
 qmails1098  0.0  0.3  1392  432 ?SJul10   0:00 qmail-send
  WHAT IS THIS ??
 qmaild1100  0.0  0.4  1408  516 ?SJul10   0:00
 /usr/local/bin/tcpserver -v -H -P -R -l 0 -x /etc/tcp.smtp.cdb -c 20
 qmaill1103  0.0  0.3  1352  392 ?SJul10   0:00
 /usr/local/bin/multilog t /var/log/qmail
 root  1104  0.0  0.2  1348  368 ?SJul10   0:00
qmail-lspawn
 ./Maildir/
 qmailr1105  0.0  0.2  1348  368 ?SJul10   0:00
qmail-rspawn
 qmailq1106  0.0  0.2  1340  376 ?SJul10   0:00 qmail-clean



 there are 2 qmail-send proceses, one supervised and one alone. I did
 configure the qmail like LWQ, so there are a qmail script in init.d and
S***
 links in 12345 levels, i also have a qmail-send directory under
/service.Is
 this wrong ??

 look at the sar output screen

 12:01:00 PM   CPU %user %nice   %system %idle
 12:11:00 PM   all 46.98  0.00 53.01  0.01
 12:21:00 PM   all 47.38  0.00 52.61  0.01
 12:31:00 PM   all 47.31  0.00 52.68  0.01
 12:41:00 PM   all 47.35  0.00 52.64  0.01
 12:51:00 PM   all 47.19  0.00 52.81  0.00
 01:01:00 PM   all 47.24  0.00 52.75  0.01
 01:11:00 PM   all 46.78  0.00 53.21  0.01
 01:21:00 PM   all 47.21  0.00 52.78  0.01
 Average:  all 47.18  0.00 52.81  0.01


 Sorry for my english, thanks in advance


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com