[courier-users] pop3login timeout patch
Hi all, Here is a small patch to manage a timeout in the pop3login command. regrads Alain diff -ruN courier-imap-4.3.0.orig/imap/pop3login.c courier-imap-4.3.0/imap/pop3login.c --- courier-imap-4.3.0.orig/imap/pop3login.c2006-05-28 17:32:19.0 +0200 +++ courier-imap-4.3.0/imap/pop3login.c 2008-02-19 16:31:32.0 +0100 @@ -240,6 +240,26 @@ return (rc); } +static RETSIGTYPE bye(int signum) +{ +const char *remoteip; +const char *remoteport; + + if ((remoteip=getenv(TCPREMOTEIP)) == NULL) + remoteip=127.0.0.1; + + if ((remoteport=getenv(TCPREMOTEPORT)) == NULL) + remoteport=0; + + fprintf(stderr, INFO: TIMEOUT, ip=[%s] port=[%s]\n, + remoteip, + remoteport); + exit(0); +#ifRETSIGTYPE != void + return (0); +#endif +} + int main(int argc, char **argv) { char *user=0; @@ -272,7 +292,8 @@ fflush(stdout); fflush(stderr); - while (fgets(buf, sizeof(buf), stdin)) + signal(SIGALRM, bye); + while (alarm(300), fgets(buf, sizeof(buf), stdin)) { c=1; for (p=buf; *p; p++) - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___ courier-users mailing list courier-users@lists.sourceforge.net Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
Re: [courier-users] Announcing the Insight Connector for Courier-IMAP
Sam Varshavchik a écrit : “Good news, everyone!” -- Prof. H. Farnsworth Insight Connector for Courier-IMAP is a commercial plugin for Microsoft Outlook™ that allows native Outlook groupware capabilities using Courier-IMAP. Outlook users can perform tasks typically available only when using the Exchange server, including folder sharing. Some of the features include folder sharing, public folders sharing, appointments/tasks scheduling, real-time data management, calendar sharing and other collaborative tasks. A trial version of Connector can be downloaded from http://courier.bynari.net. This software is supported by Bynari. URL does not resolv # host courier.bynari.net Host courier.bynari.net not found: 3(NXDOMAIN) --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ courier-users mailing list courier-users@lists.sourceforge.net Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
[courier-users] [authlib PATCH] - Extra vars in AUTH cmd
Hi Sam, Here's a small patch which allow to transmit extra informations to the authlib daemon. TCPREMOTEIP and TCPLOCALIP (if they are defined) are appended at the end of an AUTH cmd. Useful to complete logging or give a way to allow/deny from IP a given service. Regards, Alain diff -ruN courier-authlib-0.58.orig/authdaemon.c courier-authlib-0.58/authdaemon.c --- courier-authlib-0.58.orig/authdaemon.c 2005-06-30 18:16:07.0 +0200 +++ courier-authlib-0.58/authdaemon.c 2006-02-13 00:14:28.0 +0100 @@ -32,6 +32,8 @@ void *void_arg), void *void_arg); +#define TCPREMOTEIPTCPREMOTEIP +#define TCPLOCALIP TCPLOCALIP int auth_generic(const char *service, const char *authtype, @@ -40,7 +42,12 @@ void *callback_arg) { chartbuf[NUMBUFSIZE]; - size_t l=strlen(service)+strlen(authtype)+strlen(authdata)+2; + char *p=getenv(TCPREMOTEIP), *q=getenv(TCPLOCALIP); + size_t l=strlen(service)+ + 1+strlen(authtype)+ + 1+strlen(authdata)+ + (p?1+sizeof(TCPREMOTEIP)+strlen(p):0)+ /* sizeof retourne la taille de la chaine du define, '\0' compris */ + (q?1+sizeof(TCPLOCALIP)+strlen(q):0); /* donc pas besoin de reserver 1 octet pour '='. */ char*n=libmail_str_size_t(l, tbuf); char*buf=malloc(strlen(n)+l+20); int rc; @@ -54,6 +61,12 @@ strcat(strcat(buf, service), \n); strcat(strcat(buf, authtype), \n); strcat(buf, authdata); + if (p) { + strcat(strcat(strcat(strcat(buf, TCPREMOTEIP), =), p), \n) ; + } + if (q) { + strcat(strcat(strcat(strcat(buf, TCPLOCALIP), =), q), \n) ; + } rc=authdaemondo(buf, callback_func, callback_arg); free(buf);
Re: [courier-users] [authlib PATCH] - Extra vars in AUTH cmd
Barry Flanagan a écrit : Alain NAKACHE wrote: Hi Sam, Here's a small patch which allow to transmit extra informations to the authlib daemon. TCPREMOTEIP and TCPLOCALIP (if they are defined) are appended at the end of an AUTH cmd. Would these variables then be available in the config file? For example, to include in the SQL statement? -Barry You didn't understand what this patch is used for. It is used to allow an authlib client to transmit these vars to the authlib daemon. Then your authlib daemon method (say authlib-pipe) can extract these vars from the AUTH cmd and apply restrictions or enhance logging. That's all Alain --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ courier-users mailing list courier-users@lists.sourceforge.net Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
Re: [courier-users] [authlib PATCH] - Extra vars in AUTH cmd
Barry Flanagan a écrit : Alain NAKACHE wrote: Barry Flanagan a écrit : Alain NAKACHE wrote: Hi Sam, Here's a small patch which allow to transmit extra informations to the authlib daemon. TCPREMOTEIP and TCPLOCALIP (if they are defined) are appended at the end of an AUTH cmd. Would these variables then be available in the config file? For example, to include in the SQL statement? -Barry You didn't understand what this patch is used for. Perhaps It is used to allow an authlib client to transmit these vars to the authlib daemon. Yes, Then your authlib daemon method (say authlib-pipe) can extract these vars from the AUTH cmd and apply restrictions or enhance logging. what I want to do is to be able to extract these vars in the mysql authlib method, and use it in my SQL statement. Would this be possible? No You have to patch the mysql authlib daemon --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ courier-users mailing list courier-users@lists.sourceforge.net Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
Re: [courier-users] How to send informations (ie IP @) to an authlib module ?
At 00:43 20/01/05, Sam Varshavchik wrote: Alain NAKACHE writes: Hi all, I'm writing my own authlib module based on authcustom but I wonder how to send addons informations like remote IP to this module (say a comma separated var=val list) This is not implemented. Hi Sam, Since your above answer I thought about a modification of the authdata structure. Say I want to transmit 2 environment variables to the auth module with the LOGIN method, my authdata will be : loginid\npasswd\nvar1=value1\nvar2=value2\0 With CRAM method it will be : base64-encoded challenge\nbase64-encoded response\nvar1=value1\nvar2=value2\0 Then in the authmodule you only have to get the environment variable and test it. I started to implement this method by modifying courier-imap interface with authlib and it works like a charm. What do you think of that method ? Are you interested by the patches ? Best regards. Alain --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ courier-users mailing list courier-users@lists.sourceforge.net Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
[courier-users] How to send informations (ie IP @) to an authlib module ?
Hi all, I'm writing my own authlib module based on authcustom but I wonder how to send addons informations like remote IP to this module (say a comma separated var=val list) Thanks in advance for your replies. regard, Alain --- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almosthttp://www.thinkgeek.com/sfshirt ___ courier-users mailing list courier-users@lists.sourceforge.net Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
[courier-users] Search for a good method to match From and To headers
Hi all, I search for a nice regexp to match exactly an address collected in From or To headers. Here is the context : My maildroprc file builds 2 lists from headers 'From:' and 'To:': TO_LIST= foreach /^(to|cc|resend-to|resent-cc):.*/ { TO_LIST = $TO_LIST$MATCH } FROM_LIST= foreach /^(From|X-Envelope-From|Envelope-Sender|Resent-Sender):.*/ { FROM_LIST = $FROM_LIST$MATCH } Now each variable is filled with a list of newline separated email addresses. In my $HOME/.mailfilter I want to match exactly an address in one of this 2 variables. My first try was to do like that : if ( $FROM_LIST =~ /[EMAIL PROTECTED]/ ) { } but it doesn't works. Where is my mistake ? Thanks in advance. Alain PS : I don't want to use the hasaddr() function because it only works with 'From:' headers.
Re: [courier-users] Re: +OK POP3 clients that break here, they violate STD53
At 20:37 24/08/03, Sam Varshavchik wrote: Alain NAKACHE writes: « HTML content follows » Hi all, when POP3 LIST command is sent without argument, courier POP3 server (courier-imap 1.7.3) returns : +OK POP3 clients that break here, they violate STD53I found this message is generated in do_list() function(imap/pop2dserver.c:525) if msgnum is NULL. I want to understand why because in STD 53 I can read : Because some old POP3 clients expect the +OK in response to a LIST to contain the message count. I disagree because this message is systematically returned when LIST is sent without argument which is legal (checking in the source confirm that). This message is explicit, it says : if LIST doesn't have argument then report that client violate STD53 --- This SF.net email is sponsored by: VM Ware With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0 ___ courier-users mailing list [EMAIL PROTECTED] Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
[courier-users] Re: [Courier-imap] Re: +OK POP3 clients that break here, theyviolate STD53
At 03:34 25/08/03, Sam Varshavchik wrote: Alain NAKACHE writes: At 20:37 24/08/03, Sam Varshavchik wrote: Alain NAKACHE writes: « HTML content follows » Hi all, when POP3 LIST command is sent without argument, courier POP3 server (courier-imap 1.7.3) returns : +OK POP3 clients that break here, they violate STD53 I found this message is generated in do_list() function (imap/pop2dserver.c:525) if msgnum is NULL. I want to understand why because in STD 53 I can read : Because some old POP3 clients expect the +OK in response to a LIST to contain the message count.I disagree because this message is systematically returned when LIST is sent without argument which is legal (checking in the source confirm that). Read what I wrote again. I'll rephrase: some old POP3 client expects that the +OK response includes a message count, when the +OK is a response to a LIST. I red it more than twice. I know that the message count is not included in : +OK POP3 clients that break here, they violate STD53 and then you expect to crash some old POP3 client with it. This message is explicit, it says : if LIST doesn't have argument then report that client violate STD53 No, that's not what it says. OK, but that's what we think when we read it. A less doubtful message would be preferable to the 99,99% of compliant POP3 client
[courier-users] +OK POP3 clients that break here, they violate STD53
Hi all, when POP3 LIST command is sent without argument, courier POP3 server (courier-imap 1.7.3) returns : +OK POP3 clients that break here, they violate STD53 I found this message is generated in do_list() function (imap/pop2dserver.c:525) if msgnum is NULL. I want to understand why because in STD 53 I can read : LIST [msg] Arguments: a message-number (optional), which, if present, may NOT refer to a message marked as deleted What optional means in this case ? Here is an extract of a sniffed dialog : T 192.168.51.101:1445 - 192.168.51.110:110 [AP] 4c 49 53 54 0d 0a LIST.. # T 192.168.51.110:110 - 192.168.51.101:1445 [AP] 2b 4f 4b 20 50 4f 50 33 20 63 6c 69 65 6e 74 73 +OK POP3 clients 20 74 68 61 74 20 62 72 65 61 6b 20 68 65 72 65 that break here 2c 20 74 68 65 79 20 76 69 6f 6c 61 74 65 20 53 , they violate S 54 44 35 33 2e 0d 0a 31 20 31 32 31 38 38 0d 0a TD53...1 12188.. 32 20 31 32 33 36 31 0d 0a 2e 0d 0a 2 12361. # Thanks for your feedback. Alain
[courier-users] How to store the result of a pattern score to a maildropvariable ?
Greetings, I want to store the result of a pattern score to a variable with the following filter rule : NBRECEIVED=/^Received:/:1 but maildrop(v1.5.3) returns me a syntax error. Bug ? What is the method to achieve this task ? Regards.
[courier-users] Advice and patch about 'cc' followed by 'to' in .mailfiler
Greetings All, In maildropex man page I can read the following example : if (/^From: [EMAIL PROTECTED]/ \ /^Subject:.*[:wbreak:]project status[:wbreak:]/) { cc !john to Mail/project } But in case of the 'to' temporary failure (Over quota for example) john will receive several times the same message until the message is successfully delivered or canceled which can be a problem. I tried to simulate a better behaviour using an 'exception' command similar to this : if (/^From: [EMAIL PROTECTED]/) { OK=0 exception { cc $DEFAULT/.domain OK=1 } } echo 'EXITCODE=$EXITCODE' if ($OK == 1) { to !john } else { exit } But in case of failure, the result is : maildrop: maildir over quota. EXITCODE= and maildrop exits whith a null status. If I suppress the 'else' in the above mailfilter script, the message is delivered in the $DEFAULT maildir too (as expected ?). By applying the following patch : -- 8 -- --- maildrop-1.5.3.orig/maildrop/deliver.C Mon Apr 8 17:11:02 2002 +++ maildrop-1.5.3/maildrop/deliver.C Wed Jul 9 17:53:17 2003 @@ -152,7 +152,14 @@ if ( deliver_maildir.MaildirOpen(mailbox, deliver_file, maildrop.msgptr-MessageSize()) 0) - throw 77; + { + Buffer name, val; + + name=EXITCODE; + val.append((unsigned long)77) ; + SetVar(name, val) ; + throw 77; + } format_mbox.Init(0); if (format_mbox.DeliverTo(deliver_file)) -- 8 -- I manage to obtain a good behaviour (which is valid only in the case of maildir deliver) Did I miss something ? Regards. Alain
Re: [courier-users] Re: Two issues when deleting maildir folders
At 21:05 03/07/03 -0400, Sam Varshavchik wrote: Alain NAKACHE writes: been developed :-) ) but I wonder if courier-imap server can refuse folder deletion in case of child folder existence. Deleting the parent folder, where child folders exist, is a perfectly valid IMAP operation. Ok in this case why not delete child folders too ? What about my second issue ? --- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa0016ave/direct;at.asp_061203_01/01 ___ courier-users mailing list [EMAIL PROTECTED] Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
Re: [courier-users] Re: Two issues when deleting maildir folders
At 09:19 04/07/03 -0500, James A Baker wrote: On Friday, Jul 4, 2003, at 04:42 US/Central, Alain NAKACHE wrote: At 21:05 03/07/03 -0400, Sam Varshavchik wrote: Alain NAKACHE writes: been developed :-) ) but I wonder if courier-imap server can refuse folder deletion in case of child folder existence. Deleting the parent folder, where child folders exist, is a perfectly valid IMAP operation. Ok in this case why not delete child folders too ? Because that would be bad. Some people don't want to have all their sub-folders deleted, but rather just want that level in the hierarchy to loose all its current messages, and then stop accepting the storage of any more messages. It is part of the IMAP design mentality that recursive deletes must be *explicitly* requested, by way of issuing a delete command on each folder level individually -- primarily to avoid user uh-oh's I believe. -jab Now I understand. Thanks for your feedback. Alain PS : I'm still awaiting a Sam's (or another) answer about the second issue I reported which is very problematic because it causes a Maildir corruption. --- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa0016ave/direct;at.asp_061203_01/01 ___ courier-users mailing list [EMAIL PROTECTED] Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
[courier-users] Two issues when deleting maildir folders
Hi All, Two issues were reported to me concerning folder deletion. My config : - Linux RH 8.0 - Maildirs are stored on NFS filesystem - Courier-Imap 1.7.3 - MUA : MS Outlook 2002 / MS Outlook Express 6 / Eudora 5.1.2 First case : I created this subfolder structure in my INBOX : + fold1 + fold2 - fold3 When trying to delete fold1, Outlook Eudora scan subfolders to delete deeper first and so on, while Outlook Express don't and try to delete fold1 first, which is accepted by the imap server leaving the two folders fold2, fold3 in the maildir with a parent folder unknown : . .. courierimapsubscribed courierimapuiddb cur .fold1.fold2 .fold1.fold2.fold3 maildirsize new tmp .Trash I know, Sam, you are not coding glue patches to correct M$ bugs (even if --enable-workarounds-for-imap-client-bugs has been developed :-) ) but I wonder if courier-imap server can refuse folder deletion in case of child folder existence. Second case : In very rare case we encounter a problem when deleting a non empty folder with MS Outlook / MS Outlook Express. Remember I use NFS filesharing. Here is an extract of a chat between MUA and imapd : ... -DONE -00X6 OK IDLE completed -00XF DELETE inbox.fold1 -00XF NO Cannot delete this folder. -00XG IDLE -entering idle mode ... After several attempts (its very difficult to obtain) we have discovered a temporary nfs file named .nfs0001d02e0144 in the cur subdirectory while folder deletion, preventing unlink success of this directory. At the end the folder was partially deleted (Maildir/.fold1/cur still exists) which cause an error when the MUA wants to refresh the folders list. We suspect concurrent imap channel opened by Outlook to send a LIST or similar command while deleting the folder leaving this temporary file which is released when we acknowledge the MS Outlook error dialog. Before installing version 1.7.3 of courier-imap (1.7.0 was our version for a long time) we never encountered this issue and I wonder if the new folder deletion behaviour which appeared in version 1.7.2 is not responsible of that. That's all folks. I'm impatient to have your feedbacks. Bye.
Re: [courier-users] Turning off logging
At 15:48 02/04/03 +, William Hue wrote: True. Courier is not the friendliest of programs when it comes to control of logging; however, not many programs are ultra-flexible about logging. Perhaps Sam could set a new standard... Someone on the list wrote a log-file analyzer and posted a link to it a while back. Personally I made a patch to suppress all the INFO logs. There are not so many lines to comment. Daniel Goepp wrote: Right, but the problem with this is that it affects all mail programs then. It would be nice if courier would allow control of its own logging, not rely on system wide mail settings for logging configuration. And even one step further, it would be nice to have some control over what is displayed. For example, right now I get three lines per mail check (connect, login, logout). I would actually like to see mail checks, but only if it could be contained to one line. So if courierlogger would monitor and upon getting a successful connect, login and logout from the same session, dump a line to mail.info. Thanks. Peace. -Daniel -Original Message- From: William Hue [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 01, 2003 5:32 PM To: Andy Ciordia Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [courier-users] Turning off logging Login/logout is logged at level mail.info while errors are logged at mail.error (and above). So modify your syslog.conf (for Solaris, don't know what the file is for other *nixes) to only log mail.error and above. Andy Ciordia wrote: Hi, Quick question. Is there way to turn on and off what is logged to syslog with pop3d and imapd? I see how I can turn debugging on and off. But even with it off, I still get and entry for each login and logout. I want to leave logging on, in case there is an actual error, but I don't want to see every time someone checks their email. Thanks in advance for any help -Daniel I asked this about a year ago and got no response.. It doesn't surprise me, but does sadden me to see that again this question goes unanswered. I have to use a log parser to give me relevant data these days out of my mail log since courier pollutes it with login/logout data. Has anyone found better workarounds/hacks? Don't want to get kungfu but I as well think that this should either should be an optional level of debugging, or go to its own log file all together. -a --- This SF.net email is sponsored by: ValueWeb: Dedicated Hosting for just $79/mo with 500 GB of bandwidth! No other company gives more support or power for your dedicated server http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ ___ courier-users mailing list [EMAIL PROTECTED] Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users --- This SF.net email is sponsored by: ValueWeb: Dedicated Hosting for just $79/mo with 500 GB of bandwidth! No other company gives more support or power for your dedicated server http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ ___ courier-users mailing list [EMAIL PROTECTED] Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users --- This SF.net email is sponsored by: ValueWeb: Dedicated Hosting for just $79/mo with 500 GB of bandwidth! No other company gives more support or power for your dedicated server http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ ___ courier-users mailing list [EMAIL PROTECTED] Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
[courier-users] AUTHSERVICE patch
Greetings all, I'm currently developping my own authdaemon service and after few tests I discover that the AUTHSERVICE functionality was not enabled with IMAP4 with CRAM-* (AUTHENTICATE) method and POP3 (LOGIN CRAM-*). Here is a small patch to enable the AUTHSERVICE in all conditions. Regards. AUTHSERVICE.patch Description: Binary data
[courier-users] Small code cleanup
Greetings all, I think you can delete the first two lines of code in : authlib/authdaemond.c:start() These lines attempt to close all file descriptors from 3 to 256 and the same statement can be found in the first lines of liblock/lockdaemon.c:ll_daemon_start() which is the next call in start() My 2 cts contribution. Regards Alain --- This SF.net email is sponsored by: Tablet PC. Does your code think in ink? You could win a Tablet PC. Get a free Tablet PC hat just for playing. What are you waiting for? http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en ___ courier-users mailing list [EMAIL PROTECTED] Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
[courier-users] New RPM package for maildir utils
Hi Sam, I have the following problem. I use several SMTP servers which all deliver mail in the same NFS maildir share. All my SMTP server are not running courier but they need the maildir utils to create maildirs or deliver into them. I think the generation of a new courier-imap-maildir RPM which includes deliverquota, maildirmake, ... (and man pages) will be useful. What do you about think this idea ? TIA Alain ___ courier-users mailing list [EMAIL PROTECTED] Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users