Re: [vchkpw] pop3s hangs when connection opens

2005-11-20 Thread Fabio Varesano
Simply rebooting the sistem let pop3s works...
really don't know why!

Fabio


Fabio Varesano wrote:
 Hi everybody!
 
 I'm having problems setting up an pop3s service.
 
 I followed http://www.shupp.org/toaster/ step by step.
 
 I can connect to port 995 for pop3s but then it seems
 that there isn't a service waiting for something!
 
 This is what my pop3sd log looks.
 Seems that stunnel dies for an error on the stunnel script.
 
 @4000437e8d621bd3d914 tcpserver: status: 1/40
 @4000437e8d621bd9248c tcpserver: pid 1478 from 151.44.x.x
 @4000437e8d621bdc87bc tcpserver: ok 1478 0:217.19.x.x:995
 :151.44.x.x::40632
 @4000437e8d621c8a34ac 2005.11.19 03:26:32 LOG3[1478:16384]: -f: No
 such file or directory (2)
 @4000437e8d621cc3366c
 @4000437e8d621cc6b4f4 Syntax:
 @4000437e8d621cca27c4 stunnel [filename] | -help | -version | -sockets
 @4000437e8d621ccd870c filename- use specified config file
 instead of /etc/stunnel/stunnel.conf
 @4000437e8d621cd0de84 -help   - get config file help
 @4000437e8d621cd441b4 -version- display version and defaults
 @4000437e8d621cd6f51c -sockets- display default socket options
 @4000437e8d621ce744e4 tcpserver: end 1478 status 256
 @4000437e8d621ce76fdc tcpserver: status: 0/40
 
 
 This is my /service/qmail-pop3ds/run
 
 #!/bin/sh
 
 VPOPMAILUID=`id -u vpopmail`
 VPOPMAILGID=`id -g vpopmail`
 
 exec /usr/local/bin/tcpserver -l 0 -R -H -v\
 -u$VPOPMAILUID -g$VPOPMAILGID 0 995\
 /usr/sbin/stunnel /var/qmail/control/pop3ds.conf 21
 
 and this is /var/qmail/control/pop3ds.conf
 
 cert = /var/qmail/control/servercert.pem
 exec = /var/qmail/bin/qmail-popup
 execargs = qmail-popup `hostname` /home/vpopmail/bin/vchkpw
 /var/qmail/bin/qmail-pop3d Maildir
 foreground = yes
 
 
 Somebody has some hints?
 
 Fabio
 


[vchkpw] vpopmail skel dir (again!)

2005-11-20 Thread Robin Bowes
Hi,

Almost a year ago I was looking at adding skel dir capability to
vpopmail (check the archives - 23/11/04 !).

For one reason or another I never quite got round to it.

However, tonight I've started putting something together.

The thing is, I've not done much programming in C before. Pascal, sure.
Perl - I'm a wizard :)

So, I've put together a section of code, which may or may not be valid
C, and would appreciate comments.

Introduction

This code is intended to add skel dir functionality to vpopmail.

It first looks for a domain-specific skel dir in:

 /home/vpopmail/etc/domains/domain/skel

It then looks for a installation-specific skel dir in;

  /home/vpopmail/etc/skel

If neither are found, it creates the default maildir structure.

= snippet of vpopmail.c ==
/* Initialise a couple of strings to hold directory paths
char skel_dir[MAX_BUFF];
char skel_location[MAX_BUFF];


/* initialise skel dir to empty */
strcpy(skel_dir,);

/* first directory to check */
snprintf(skel_location, sizeof(skel_location),
 %s/etc/domains/%s/skel,
 VPOPMAILDIR, domain);

/* check if it exists + is readable */
if (check_dir_readable(skel_location)) {

  /* set the skel dir */
  snprintf(skel_dir, sizeof(skel_dir), %s, skel_location)

} else {

  /* next directory to check */
  snprintf(skel_location, sizeof(skel_location),
   %s/etc/skel,
   VPOPMAILDIR);

  /* check if it exists + is readable */
  if (check_dir_readable(skel_location)) {

/* set the skel dir */
snprintf(skel_dir, sizeof(skel_dir), %s, skel_location);

  }
};

/* if one of the skel dirs exists, use it */
if (skel_dir  ) {

  /* copy it to the newly-created user dir */
  copydir(skel_dir, .);

} else {

  /* otherwise, create the default dir structure*/
  /* (this is core vpopmail code)   */
  for (i = 0; i  sizeof(dirnames)/sizeof(dirnames[0]); i++) {
if (mkdir(dirnames[i],VPOPMAIL_DIR_MODE) == -1){
  fprintf(stderr, make_user_dir: failed on %s\n, dirnames[i]);
  /* back out of changes made above */
  chdir(..);
  vdelfiles(username);
  chdir(calling_dir);
  return(NULL);
}
  }
}

= snippet of vpopmail.c ==

I've not yet written the check_dir_readable() or copydir() functions;
check_dir_readable may be really easy (it is in Perl :) ) but I've not
looked into how to implement it. copydir() is probably already available
somewhere if I have a quick google.

I'd appreciate any comments before I go any further with this.

Thanks,

R.
-- 
http://robinbowes.com

If a man speaks in a forest,
and his wife's not there,
is he still wrong?