[vchkpw] new onchange cmd patch in vpalias.c : valias_insert_first

2008-01-14 Thread Ismail YENIGUL
Hello,

Nowadays, I am working on vpopmail+LDAP environment.
As you know, --enable-valias is only works on SQL backends, So
when you create an alias over qmailadmin, we can't get this
information.
I would like to make user lookup on LDAP on my SMTP GW server.
Because of the problem described above, aliases are not stored on
LDAP and the mails come to alias address are rejected on GW.

To solve the problem, I added the following patch to the vpopmail
5.4.25.
This patch will call onchange script with valias_insert_first cmd.
I know that there is already valias_insert. But it is triggered even
if you change to content of the .qmail-xxx alias.
What I wanted to do here. Only call valias_insert_first when a
new/fresh alias file is created.
Then,you can create a script to add/delete LDAP entries for the aliases.
I was trying to do same stuff for
ezmlm mailing lists + qmailadmin. But John M. Simpson already  made
it :) http://qmail.jms1.net/vpopmail/qmailadmin-1.2.11-onchange.patch

Thanks.

# diff -ruN vpalias.c.orig vpalias.c
--- vpalias.c.orig  2007-05-22 06:59:01.0 +0300
+++ vpalias.c   2008-01-14 11:25:32.0 +0200
@@ -114,6 +114,7 @@
 int valias_insert( char *alias, char *domain, char *alias_line)
 {
  int i;
+ int firstalias = 0;
  char *tmpstr;
  char Dir[156];
  char *p;
@@ -140,6 +141,14 @@
   Dir[i++] = (*p == '.' ? ':' : *p);
 Dir[i] = '\0';
 
+#ifdef ONCHANGE_SCRIPT
+if ( (fs = fopen(Dir, r)) == NULL ) {
+if (errno == ENOENT) {  /* the file is not exist, so it is a 
new .qmail-xxx file */
+firstalias = 1;
+}
+ }
+#endif
+
 if ( (fs = fopen(Dir, a)) == NULL ) {
return(-1);
 }
@@ -154,6 +163,10 @@
/* tell other programs that data has changed */
snprintf ( onchange_buf, MAX_BUFF, [EMAIL PROTECTED] - %s, alias, 
domain, alias_line );
call_onchange ( valias_insert );
+   if(firstalias == 1)
+   snprintf ( onchange_buf, MAX_BUFF, %s %s, alias, 
domain);
+   call_onchange ( valias_insert_first);
+   }
}
 #endif

  

-- 
Ismail YENIGUL
Yönetici/Manager
Servis ve Destek Bölümü/System Services and Support Division
Tel: +90 216 344 07 15
Fax: +90 216 344 07 16
http://www.endersys.com.tr

!DSPAM:478b2d73310541993387059!


vpopmail-5.4.25-onchange-vpalias.patch
Description: Binary data


[vchkpw] vlist: address already exist

2008-01-14 Thread Cristiano Deana
Hi,

vpopmail 5.4.26
i was trying vlist, but i thing i'm missing something:

bsd# ~vpopmail/bin/vuserinfo [EMAIL PROTECTED]
no such user [EMAIL PROTECTED]
bsd# ~vpopmail/bin/vlist create [EMAIL PROTECTED]
address already exists
 (-1)

this happens with any address.
what's wrong?

thanks in advance.

-- 
Cris, member of G.U.F.I
Italian FreeBSD User Group
http://www.gufi.org/

!DSPAM:478b421b310548364617230!



[vchkpw] NT

2008-01-14 Thread Sebastien FOUTREL

unsubscribe

!DSPAM:478bdb47310542053649861!