Re: [vchkpw] [SPAM] Re: [vchkpw] [SPAM] Dovecot-lda for vpopmail
Quoting Alessio Cecchi : Il 24/09/2012 15:34, Rick Romero ha scritto: Heres a patch for 5.4.17 - I've been running this for a while now. Basically, run the deliver command after the tempfile is created (to verify delivery and quota) then unlink the tempfile and return. I tried to make it all fancy with build options, then figured I was the only one who would do it this wacky way. :) This version passes the home directory to deliver, so you don't need to run the dovecot lookup service. I also had to specify the timezone to get the correct timestamp for some reason. Rick Thanks Rick! your patch is very helpful for me, also passes the HOME to deliver is a good idea. Another useful options, for delivery, will be to add the "extension" via "-m mailbox" so dovecot will deliver the email directly in this folder (if vpopmail is build with enable-qmail-ext). An email to alessio-vpopml@ will be delivery to the "vpopml" folder. In the enviroment, what is the variable for the "extension" (vpopml)? There is none at the point deliver is called - by the time it gets called, all the qmail-ext work has been done so the HOME directory is the correct user's Maildir directory. 'deliver' just needs to drop the email into that location and update the indexes. That's what I was shooting for. Besides using qmail-ext, I still have old vacation and forwards that I didn't want to worry about. vdelivermail still handles all of that. I just wanted deliver to update indexes on delivery. I hadn't thought about it - but the version of Dovecot on my front-end servers that do delivery is still in the 1.2 series. So there may be some slight differences if you're running 2.0 deliver. Rick !DSPAM:506074d134211000720019!
Re: [vchkpw] [SPAM] Re: [vchkpw] [SPAM] Dovecot-lda for vpopmail
Il 24/09/2012 15:34, Rick Romero ha scritto: Heres a patch for 5.4.17 - I've been running this for a while now. Basically, run the deliver command after the tempfile is created (to verify delivery and quota) then unlink the tempfile and return. I tried to make it all fancy with build options, then figured I was the only one who would do it this wacky way. :) This version passes the home directory to deliver, so you don't need to run the dovecot lookup service. I also had to specify the timezone to get the correct timestamp for some reason. Rick Thanks Rick! your patch is very helpful for me, also passes the HOME to deliver is a good idea. Another useful options, for delivery, will be to add the "extension" via "-m mailbox" so dovecot will deliver the email directly in this folder (if vpopmail is build with enable-qmail-ext). An email to alessio-vpopml@ will be delivery to the "vpopml" folder. In the enviroment, what is the variable for the "extension" (vpopml)? -- Alessio Cecchi is: @ ILS -> http://www.linux.it/~alessice/ on LinkedIn -> http://www.linkedin.com/in/alessice Assistenza Sistemi GNU/Linux -> http://www.cecchi.biz/ @ PLUG -> ex-Presidente, adesso senatore a vita, http://www.prato.linux.it !DSPAM:506072cf3421204413!
[vchkpw] [SPAM] Re: [vchkpw] [SPAM] Dovecot-lda for vpopmail
Heres a patch for 5.4.17 - I've been running this for a while now. Basically, run the deliver command after the tempfile is created (to verify delivery and quota) then unlink the tempfile and return. I tried to make it all fancy with build options, then figured I was the only one who would do it this wacky way. :) This version passes the home directory to deliver, so you don't need to run the dovecot lookup service. I also had to specify the timezone to get the correct timestamp for some reason. Rick Quoting Alessio Cecchi : As many users of vpopmail we switched to dovecot for POP and IMAP. I would like to switch also from maildrop to dovecot-lda. Many configuration are possibile but the best way is to patch vdelivermail to use dovecot-lda directly. Has anyone solved the problem? If someone wants to write a patch for me, I am willing to make a bid. Thanks -- Alessio Cecchi is: @ ILS -> http://www.linux.it/~alessice/ on LinkedIn -> http://www.linkedin.com/in/alessice Assistenza Sistemi GNU/Linux -> http://www.cecchi.biz/ @ PLUG -> ex-Presidente, adesso senatore a vita, http://www.prato.linux.it --- vdelivermail.c 2009-05-18 19:13:17.0 -0500 +++ vdelivermail.c.dovecot 2010-12-10 08:34:33.444212000 -0600 @@ -411,7 +411,8 @@ size_t headerlen; int write_fd; char quota[80]; - + char home[150]; + //char *cmd[] = { "|/usr/local/libexec/dovecot/deliver", "", (char *)0 }; headerlen = strlen (extra_headers); msgsize += headerlen; @@ -426,7 +427,19 @@ maildir, tm, pid, hostname, (long unsigned) msgsize); read_quota_from_maildir (maildir, quota, sizeof(quota)); +// #ifdef DELIVER_STDOUT +/* export HOME environment variable - strip /Maildir/ */ + if ( putenv(home) == -1 ) { +printf( + "putenv(HOME) failed errno %d %s@%s", + errno, TheUser, TheDomain); +return -1; + } +sprintf(home,"|/usr/bin/env -i HOME=%s TZ=CST /usr/local/libexec/dovecot/deliver",vpw->pw_dir); + // run_command(home); + // return 0; +// #else /* open the new email file */ if ((write_fd=open(local_file_tmp, O_CREAT|O_RDWR, S_IRUSR|S_IWUSR)) == -1) { if (errno == EDQUOT) return -1; @@ -450,6 +463,12 @@ } /* completed write to tmp directory, now move it into the new directory */ +// Scratch that - pipe to Dovecot deliver and remove tmp file (quota check) + +close(write_fd); +unlink (local_file_tmp); +run_command(home); +return 0; /* sync the data to disk and close the file */ errno = 0; @@ -487,6 +506,7 @@ /* return failure (sync/close failed, message NOT delivered) */ return -2; +//#endif } /* !DSPAM:5060615234212177865488!