[OT] Re: Automatic mail archiving
On 2000.07.26, in [EMAIL PROTECTED], "Gregor Zattler" [EMAIL PROTECTED] wrote: * David Champion [EMAIL PROTECTED] [Mit 26 Jul 2000 03:37:59 GMT]: I have procmail deliver to ~/Mail/lists/listname. Each "listname" in that directory is a symlink to ~/Mail/lists/monthly/listname-MM or to ~/Mail/lists/annual/listname-. A cron job rewrites the symlinks once a month using a Makefile designed for handling the links. I'm interested too. I know it's OT on this list but perhaps it's easier to post it on the list. There were a number of people interested, so I guess I will. I cleaned commented it up a bit, too, and added an ability to do quarterlies since Mikko mentioned that. It's not hard to define whatever period you want. I hope everything still works. :) I feel a little foolish -- there's really no reason this should be a makefile instead of a shell script. But my old archive handler (using another scheme) used make with good reason, so it came naturally in this case. Oh well. I'll add to what Mikko mentioned before: using symlinks is nice, too, because it takes a lot of weight from procmail. Using symlinks is essentially caching the "date" command output on the filesystem, and executing it once per month rather than with each incoming message. It's altogether more efficient. Enough of that. Here's the file. -- -D.[EMAIL PROTECTED]NSITUniversity of Chicago ## ## Makefile for managing periodic mail-archive symlinks ## ## $Id: Makefile,v 1.2 2000/07/27 10:16:23 dgc Exp $ ## ## DIRECTIONS: ## 1. Drop this Makefile into a directory where you want to keep links to ##your archives. ## 2. Create subdirectories there named "annual", "monthly", and/or ##"quarterly", or whatever you'd rather call them. ## 3. For each archive: ##a. Decide whether you want to cycle the archive on an annual, ## quarterly, or monthly basis. ##b. Run "make add ARCHIVE=name-of-archive PERIOD=xxx", where "xxx" is ## the period you decide on. This will create the initial symlink. ## 4. Set up procmail to deliver mail into the "name-of-archive" folder. ## 5. Create a cron(1) task to run "cd .../path/to/dir; make rotate" once ##per month. This will update all symlinks. (Actually, you can run ##this more or less often; it doesn't matter. If you made a weekly ##period, you could run it monthly *and* weekly.) ## ## NOTES: ## The file for the "family" archive (cycled monthly) for April, 1998 ## will be .../monthly/family-199804. You can gzip these if you wish -- ## no trouble. ## ## To add support for a new period, create a subdirectory for it, and ## add a macro definition for SFXfoo as below. SFXfoo should expand ## to the correct suffix for today's date, and be unique among all ## iterations of that period. For example, a period of one week, labelled ## according to the ISO definition, could use ## SFXweekly = `date %Y-%V` ## ## You can change SFX* macros as you wish if you don't like these formats, ## but be sure to change $(STRIP) accordingly. $(STRIP) must be capable ## of removing any of your SFX* macros from the end of a filename. ## ## Uncomment to debug, or use "make DO=echo". #DO = echo ## Default period for rotation of new archives with "make add-archive". ## Supercede this with (for example) "make add-archive PERIOD=quarterly". ## A valid PERIOD = monthly # You probably don't need to touch anything else. # ## Generates a suffix for PERIOD=annual SFXannual = `date +%Y` ## Generates a suffix for PERIOD=monthly SFXmonthly = `date +%Y%m` ## Generates a suffix for PERIOD=quarterly, like "1997q2". (Hi Mikko! :) SFXquarterly= `date '+[%Yq] P %m 1 - 3 / 1 + p' | dc` ## A command to strip suffices from archive files. STRIP = sed -e 's/-[0-9][0-9][0-9][0-9q-]*$$//' -e 's/-[0-9][0-9][0-9][0-9q-]*\.gz$$//' ## How to create and remove locks. LOCK= /opt/bin/lockfile UNLOCK = /usr/bin/rm -f ## A default target that tells you available targets. all: @echo @echo "make rotate- rotate all archives" @echo "make add ARCHIVE=name [PERIOD=xxx] - link new archive (default period=$(PERIOD))" @echo @echo "or, if you prefer:" @echo "make add-annual ARCHIVE=name - link new archive (annual period)" @echo "make add-monthly ARCHIVE=name - link new archive (monthly period)" @echo "make add-quarterly ARCHIVE=name- link new archive (quarterly period)" @echo ## Safety valves check-archive: @ if [ -z "$(ARCHIVE)" ]; then \ echo; \ echo '!!! You need to give ARCHIVE=name on the command line.'; \ echo; \ exit 255; \ fi check-period: @ if [ -z "$(PERIOD)" ]; then \ echo; \ echo '!!! PERIOD is not set.'; \ echo; \ exit 255; \ fi ##
wierd mutt/vim syntax higlight thingy
Not a terrible problem but anyways.. :) I have this in my .muttrc: ## Edit my muttrc macro pager escE "!vim $HOME/.mutt/.muttrc\n:source $HOME/.mutt/.muttrc\n" macro index escE "!vim $HOME/.mutt/.muttrc\n:source $HOME/.mutt/.muttrc\n" macro browser escE "!vim $HOME/.mutt/.muttrc\n:source $HOME/.mutt/.muttrc\n" Now when i do from the shell 'vim $HOME/.mutt/.muttrc' i get syntax highlighting. But from mutt when i do escE the file loads without syntax highlighting. Now when i do :set syntax=muttrc, then i get it again. When i do it in my muttrc file with ...!vim \"+set syntax=muttrc\" .. no way. Why doesn't vim recognise the extension and switch on syntax highlighting as it does from the commandline? Not that it keeps me awake, but i was just wondering :) jan
Re: wierd mutt/vim syntax higlight thingy
Jan Houtsma: Dienstag, 01 Aug 2000: ## Edit my muttrc macro pager escE "!vim $HOME/.mutt/.muttrc\n:source $HOME/.mutt/.muttrc\n" macro index escE "!vim $HOME/.mutt/.muttrc\n:source $HOME/.mutt/.muttrc\n" macro browser escE "!vim $HOME/.mutt/.muttrc\n:source $HOME/.mutt/.muttrc\n" Hi, why do you ":source $HOME/.mutt/.muttrc\n"? I use: macro···index···F9"!vim ~/.muttrc\n" "Edit muttrc" macro···index···F10···":source ~/.muttrc\n" "Reload muttrc" This works perfectly (with highlighting). Greetings Dirk
Re: wierd mutt/vim syntax higlight thingy
On Tue, Aug 01, 2000 at 10:48:25AM +0200, Jan Houtsma wrote: When i do it in my muttrc file with ...!vim \"+set syntax=muttrc\" .. no way. try this : !vim '+set syntax=muttrc' $HOME/.mutt/.muttrc Antoine
Re: wierd mutt/vim syntax higlight thingy
On Tue, Aug 01, 2000 at 11:12:26AM +0200, Dirk Huebner wrote: Jan Houtsma: Dienstag, 01 Aug 2000: ## Edit my muttrc macro pager escE "!vim $HOME/.mutt/.muttrc\n:source $HOME/.mutt/.muttrc\n" macro index escE "!vim $HOME/.mutt/.muttrc\n:source $HOME/.mutt/.muttrc\n" macro browser escE "!vim $HOME/.mutt/.muttrc\n:source $HOME/.mutt/.muttrc\n" Hi, why do you ":source $HOME/.mutt/.muttrc\n"? I use: macro···index···F9"!vim ~/.muttrc\n" "Edit muttrc" macro···index···F10···":source ~/.muttrc\n" "Reload muttrc" This works perfectly (with highlighting). Well, what you do with pressing both F9 and then pressing F10, i do with only one single press (F2). I always want to reload after i edited the settings so. But besides that, i just noticed that what i described only happens when i am remotely logged in via telnet!! When i am locally on the PC, then it's fine. But when i am telnetted to my box from work then from the commandline 'vim .muttrc' works fine with syntax highlighting, but from mutt it doesn't. I just found that out. Makes it even more obscure does it? :))) jan jan
Re: mime viewer
J-C -- ...and then J-C Hendrickx said... % Hi, % % I receved a mail from a Mac OS, with an attachment file % that Mutt recognise as : % Image 2 [image/x-pict, base64, 174k] % % My question is how can I see this image ? % Mutt show it as a text data. You need, of course, to get a program that can view it; in the absence of anything that will work, mutt will let you look at the item in its encoded form. You might try ImageMagick; it works for darned near everything. % % Thanks. HTH HAND % % J-C % % -- % % --_- % (o-Jean-Claude Hendrickx % //\[EMAIL PROTECTED] % v_/_ :-D -- David T-G * It's easier to fight for one's principles (play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie (work) [EMAIL PROTECTED] http://www.bigfoot.com/~davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg! The "new millennium" starts at the beginning of 2001. There was no year 0. Note: If bigfoot.com gives you fits, try sector13.org in its place. *sigh* PGP signature
Re: imap + ssl error - entropy?
(Yes, I can see you're not using linux.) But the following excerpt might give some conceptual guidance: ** RANDOM(4) Linux Programmer's Manual RANDOM(4) NAME random, urandom - kernel random number source devices DESCRIPTION The character special files /dev/random and /dev/urandom (present since Linux 1.3.30) proAD vide an interface to the kernel's random number generator. File /dev/random has major device number 1 and minor device number 8. File /dev/urandom has major device number 1 and minor device number 9. The random number generator gathers environmental noise from device drivers and other sources into an entropy pool. The generator also keeps an estimate of the number of bit of the noise in the entropy pool. From this entropy pool random numbers are created. ** From this I form the vague idea that your ssl "ain't gettin' enough random." To this end, you might check your OS documentation on this subject, or look at the RAND_egd(3) man page. This page is available on my system in /usr/local/ssl/man/man3/. On Mon, Jul 31, 2000 at 05:49:38PM -0500, matthew zeier wrote: When I try using SSL IMAP on my machine I get the following error message: Failed to find enough entropy on your system SSL disabled due the lack of entropy -- Leon Dague. My opinions.
Re: imap + ssl error - entropy?
[openssl-0.9.5a on SunOS 5.5.1] From this I form the vague idea that your ssl "ain't gettin' enough random." Yep, this is definitely the case. To this end, you might check your OS documentation on this subject, or look at the RAND_egd(3) man page. This page is available on my system in /usr/local/ssl/man/man3/. Matthew, check out http://www.openssl.org/support/faq.html#6 (entropy gathering in ossl 0.9.5+) http://www.lothar.com/tech/crypto/ (egd) http://www.cosy.sbg.ac.at/~andi/ The latter is untested on SunOS 5.5.1 so far, but I think it should work.
No Mail on Spool
Though I can send mail with mutt, I receive nothing. I'm using Linux Mandrake 7.1 with pop, and I'm pretty sure that I've set up the pop options correctly (user, server, password). Nothing goes to the local spool that I've set up, and I get no errors or other signs of trouble from mutt. Any ideas? ken
problem bouncing messages
Hello, I have come across a minor problem with mutt-1.2.5: when I bounce a message, my ISP's SMTP server always refuses to accept it. It tries to resolve my home computer's name, and since the address look-up always fails it refuses the connection attempt from my local MTA. Can you tell me why this happens? In my .muttrc I set the variable envelope_from, which fills the "From " field in all my sent/forwarded emails correctly (by "hiding" my local address), but perhaps this doesn't work with bounced emails and my local address ([EMAIL PROTECTED]) show up in the header and confuses my ISP's server. If this is the problem, how can I overcome it? Thank you for any tip, Manuel
Re: No Mail on Spool
Hi Ken, If you are using the built-in pop support (I am not sure about what you meant with "with pop"), then don't mind reading the rest of this email :). Otherwise, and although this might seem trivial to you, I had the same problem until I found out that my MTA was putting my incoming mail in /home/{username}/Mail/Inbox and I had instructed mutt to only look for mail at /var/spool/mail/{username}. Are you sure that mutt is looking for the incoming mail at the right location? Cheers, Manuel On Tue, Aug 01, 2000 at 11:28:09AM -0400, Ken Kelly wrote: Though I can send mail with mutt, I receive nothing. I'm using Linux Mandrake 7.1 with pop, and I'm pretty sure that I've set up the pop options correctly (user, server, password). Nothing goes to the local spool that I've set up, and I get no errors or other signs of trouble from mutt. Any ideas?
Re: No Mail on Spool
Hi Ken, If you are using the built-in pop support (I am not sure about what you meant with "with pop"), then don't mind reading the rest of this email :). I meant that I compiled mutt with '--enable-pop' (...) Yep, that's what I meant, too ... I never really tried it, so I am afraid I can't be of any real help on the technical issues you described ... But, IIRC, usually it is suggested that you don't use the "built-in" pop capability but a program such as fetchmail instead. But then, using such a program implies running a MTA such as sendmail or Postfix, so that fetchmail retrieves your email from your ISP's POP server and then feeds it into the delivery queue of your local MTA, which in turn must put it in your spool file (where mutt will look for it). Or you can use procmail, which you can "teach" how to filter your incoming email and then sort it into different mailboxes. I use Postfix together with fetchmail, and the setup was very easy (besides one or two minor problems). Let me know if I can be of any further help. Cheers, Manuel
Re: No Mail on Spool
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: But, IIRC, usually it is suggested that you don't use the "built-in" pop capability but a program such as fetchmail instead. But then, using such a program implies running a MTA such as sendmail or Postfix, [...] Not necessarily. 'getmail' delivers directly to mbox files or Maildirs, and fetchmail can (I believe) be set to deliver directly through procmail or another MDA rather than by SMTP injection. Charles -- --- Charles Cazabon [EMAIL PROTECTED] GPL'ed software available at: http://www.qcc.sk.ca/~charlesc/software/ Any opinions expressed are just that -- my opinions. ---
Re: No Mail on Spool
But, IIRC, usually it is suggested that you don't use the "built-in" pop capability but a program such as fetchmail instead. But then, using such a program implies running a MTA such as sendmail or Postfix, [...] Not necessarily. 'getmail' delivers directly to mbox files or Maildirs, and fetchmail can (I believe) be set to deliver directly through procmail or another MDA rather than by SMTP injection. Thanks, I didn't know it could also work like that. - Manuel
Re: No Mail on Spool
Using a large mallet, Charles Cazabon whacked out: [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: But, IIRC, usually it is suggested that you don't use the "built-in" pop capability but a program such as fetchmail instead. But then, using such a program implies running a MTA such as sendmail or Postfix, Not necessarily. 'getmail' delivers directly to mbox files or Maildirs, and fetchmail can (I believe) be set to deliver directly through procmail or another MDA rather than by SMTP injection. Yep - I run fetchmail with procmail as the mda (qmail / maildir users consider maildrop) something like: defaults forcecr poll pop.gmx.net with proto pop3 no dns user 'foo' with pass bar mda "sed -e '1s/^\t/Received: /'| formail |/usr/bin/procmail -d mallet" fetchall -- Suresh Ramasubramanian + Lumber Cartel India - tinlcI mallet @ cluestick.org + Wallopus Malletus Indigenensis Cynic, n.: One who looks through rose-colored glasses with a jaundiced eye.
Re: No Mail on Spool
On Aug 01, 2000, [EMAIL PROTECTED] wrote: [...] I meant that I compiled mutt with '--enable-pop' (...) Yep, that's what I meant, too ... I never really tried it, so I am afraid I can't be of any real help on the technical issues you described ... I'm afraid that the main technical issue is that I'm an idiot... :-) All I had to do was explicitly check the pop server with the 'G' command. Everything works now, but I certainly do feel foolish. My mistake was in assuming that 'mail_check' accessed the pop server, but it seems that it only polls the spool. The way I've set things up, polling the spool is useless, since nothing in the background is feeding it. But, IIRC, usually it is suggested that you don't use the "built-in" pop capability but a program such as fetchmail [...] Yes, I've considered that. I just wanted to make mutt work for now in the simplest way possible. I've plenty of time to break/fix it further in the fullness of time. :-) I use Postfix together with fetchmail, and the setup was very easy (besides one or two minor problems). I may well investigate Postfix in the near future. For the time being, though, I think I'll concentrate on learning how to use mutt the way it's set up now. I may find that I'll *need* to change it to do what I want, but I'm too much a newbie to know that yet. Let me know if I can be of any further help. Thanks. It may not be obvious, but you did help me realize that nothing was feeding the spool, which was the key to the problem. ken
Re: problem bouncing messages
On Tue, Aug 01, 2000 at 04:33:42PM +, [EMAIL PROTECTED] wrote: Hello, I have come across a minor problem with mutt-1.2.5: when I bounce a message, my ISP's SMTP server always refuses to accept it. I have a similair problem -- bounced messages are lost and never reach the destination. It tries to resolve my home computer's name, and since the address look-up always fails it refuses the connection attempt from my local MTA. Can you tell me why this happens? I think I can. I've set $sendmail to a wrapper script and noticed, that the "-f user@host" is not added when bouncing a message, despite $envelope_from being turned on. In my .muttrc I set the variable envelope_from, which fills the "From " field in all my sent/forwarded emails correctly (by "hiding" my local address), but perhaps this doesn't work with bounced emails and my local address ([EMAIL PROTECTED]) show up in the header and confuses my ISP's server. If this is the problem, how can I overcome it? You can add -fyour@address to $sendmail variable or you can make your MTA do envelope masquerading. These solutions are not perfect, as they override $envelope_from (I think... what would sendmail do if it got two -f options?), and sometimes you need to have your envelope from equal to the From: field. Marius Gedminas -- Q: Why do mountain climbers rope themselves together? A: To prevent the sensible ones from going home.
Re: problem bouncing messages
Hi Suresh, Thank you for your reply. ([EMAIL PROTECTED]) shows up in the header and confuses my ISP's server. If this is the problem, how can I overcome it? Hmmm... you are using Postfix locally and I don't grok postfix - but sendmail can be set to masquerade as a domain (setting DMip.pt in sendmail.cf would make your sendmail masquerade as ip.pt instead of localhost.localdomain or whatever). I also thought about that, but masquerading my localhost behind my ISP's domain won't work, because my local username is different from the one at my ISP and my emails would go out as "From: [EMAIL PROTECTED]", an inexistent email address. Another problem with solving this at MTA level (namely with some sort of address rewriting) is that I only have one user account at my computer, but more than one email address at my ISP. So imposing an address rewriting rule saying [EMAIL PROTECTED] = [EMAIL PROTECTED] doesn't really solve my problem. Which leaves me with only one solution: configuring mutt. :) As I said, whenever I try to bounce a message it always shows up in my system's mail queue with an error message saying that my ISP's refused it because the field [EMAIL PROTECTED] (I suppose it is "From ") includes an unresolvable host name... which makes sense, because if I didn't specify in my .muttrc which email addresses mutt should use in my outgoing messages it would always use [EMAIL PROTECTED], and the messages would also show up in my system's mail queue as refused by the remote server (this really happens, I just tested it). I get this error message whenever I send out an email with a correct "From:" field, but an invalid "From ". So I guess that since when I bounce a message the "From: " field doesn't contain any of my email addresses, the fact that I've set the variable $envelope_from doesn't lead to mutt forcing a correct "From " field, which I believe is the header field my ISP's SMTP server is looking at when it refuses the emails I bounce (since "From: " stays unchanged when bouncing). How can I tell mutt to use the right "From " field when "From: " contains an address which isn't on my $alternates list? my_hdr doesn't change the email's envelope, right? So what's left? Cheers and thank you for any help, Manuel
Re: problem bouncing messages
Hi Marius, Can you tell me why this happens? I think I can. I've set $sendmail to a wrapper script and noticed, that the "-f user@host" is not added when bouncing a message, despite $envelope_from being turned on. Exactly. In my last email to the list I also mentioned that I am convinced that the problem lies in mutt *not* changing the "From " field in bounced messages although $envelope_from is set... If this is the problem, how can I overcome it? You can add -fyour@address to $sendmail variable or you can make your MTA do envelope masquerading. I also thought about using some sort of address rewriting at MTA-level, but having more than one email address at my ISP makes it rather complicated to "teach" the MTA which of the addresses to use when doing the rewrite. These solutions are not perfect, as they override $envelope_from (I think... what would sendmail do if it got two -f options?), and sometimes you need to have your envelope from equal to the From: field. I thought that solution *was* perfect :) ... Afterall, if you add "-f" to your $sendmail there it is no longer necessary to set $envelope_from, right?, because according to the manual "set envelope_from=yes" does precisely that: "envelope_from: (...) When set, mutt will try to derive the message's envelope sender from the "From:" header. Note that this option is passed to sendmail command using the "-f" command line switch, so don't set this option if you are using that switch in sendmail yourself(...)" So by manually adding the "-f" switch to $sendmail you get all the $envelope_from functionality, in addition to (working!) message bouncing. But I just tested it and it seems to have a problem: "manually" doing the job $envelope_from performs isn't easy if you wish to have different "From " headers (based on "From:")... I guess this problem was what you mean in the first place when you said that this solution wasn't perfect... perhaps you were right :( Thank you for your help, Manuel PS: Probably this is trivial to implement: I guess the team of developers can easily make $envelope_from also assure that "From "=="From:" when the user bounces a message... afterall, it already works flawlessly when sending, replying and forwarding!
Sort
How do i set so that mail comming from ex. [EMAIL PROTECTED] automaticly will be moved for ex. another mailbox called Freshmeat after i have read it?
Conditionals in macros?
I'd like to map the Tab key to go to the next new message if there is one, else the next unread message. How can I do that? It's easy to bind Tab to one of those functions (next-new or next-unread), but I don't know how to get it to do a combination. Ideally, I'd like to create a macro that mapped Tab to something like "next-new || next-unread || next-entry". -Brett -- - Brett Coon - [EMAIL PROTECTED] - http://www.rahul.net/brett --- Diana: The dress is for sale. I'm not. [139] "Indecent Proposal" (1993)
Re: problem bouncing messages
Using a large mallet, [EMAIL PROTECTED] whacked out: Another problem with solving this at MTA level (namely with some sort of address rewriting) is that I only have one user account at my computer, but Then the only idea I can offer you is to create multiple usernames on your computer ;) Or downgrade to a lower version of mutt which doesn't do this ... 1.2.4 doesn't have this problem afaict. -- Suresh Ramasubramanian + Lumber Cartel India - tinlcI mallet @ cluestick.org + Wallopus Malletus Indigenensis So, what's with this guy Gideon, anyway? And why can't he ever remember his Bible?
Re: problem bouncing messages
Using a large mallet, Suresh Ramasubramanian whacked out: Or downgrade to a lower version of mutt which doesn't do this ... 1.2.4 doesn't have this problem afaict. I spoke too soon :( Tried it (use procmail as my mda - mda /usr/bin/procmail -d mallet in my .fetchmailrc Here are some sample headers. Feature, I'm afraid - but any fix forthcoming? From sureshr Wed Aug 2 10:41:26 2000 Return-Path: sureshr Received: (from sureshr@localhost) by frodo.kcircle.com (8.11.0/8.11.0/SuSE6.4/NOSPAM) id e725BQp00390 for mallet@frodo; Wed, 2 Aug 2000 10:41:26 +0530 Resent-Message-Id: [EMAIL PROTECTED] Received: from mailandnews.com by localhost with POP3 (fetchmail-5.3.0) for sureshr@localhost (single-drop); Mon, 31 Jul 2000 18:40:36 +0530 (IST) -- Suresh Ramasubramanian + Lumber Cartel India - tinlcI mallet @ cluestick.org + Wallopus Malletus Indigenensis main(int c,char **v){while(!fork()){strcpy(v[0],tmpnam(0));sleep(1);}} A program that changes its name and pid every second. Try at your risk.