View previous topic :: View next topic |
Author |
Message |
paramthegreat Tux's lil' helper
Joined: 12 Aug 2002 Posts: 78
|
Posted: Sat Jun 05, 2004 4:56 pm Post subject: procmail filtering does not seem to work |
|
|
hi,
thanx a lot for this great guide. It had got me started on mutt. but i am having problems filtering with procmail. i have 3 email accounts and 2 mailing list that belong to a single email account. i want that emails of each of 3 diff accounts goto diff folders.
i tried using the following code but no luck
Code: |
:0
* ^To_psg0217@omega\.uta\.edu
IN-omegamail\
:0
* ^To_psg0217@exchange\.uta\.edu
IN-exchangemail\
:0
* ^To_paramthegreat143@hotmail\.com
IN-paramthegreat\
:O
* ^To_parminder_gupta@hotmail\.com
IN-parminder\
:0
* ^To_rox-devel
IN-paramthegreat\
:0
* ^To_JAI_INTEREST
IN-paramthegreat\
|
all i get is unfiltered mail in my inbox. it would be great if someone could help me with this.
thanx a lot,
parminder. _________________ Parminder
guptaparminder at yahoo dot com |
|
Back to top |
|
|
nsahoo l33t
Joined: 17 Jul 2003 Posts: 618
|
Posted: Sat Jun 05, 2004 5:09 pm Post subject: |
|
|
is it just me or these guys in forums have some real talent in writing "how to"s for n00bs like me.
thanks m8 |
|
Back to top |
|
|
dkaplowitz Guru
Joined: 22 Nov 2003 Posts: 596 Location: Philadelphia, PA
|
Posted: Sat Jun 05, 2004 5:27 pm Post subject: Re: procmail filtering does not seem to work |
|
|
paramthegreat wrote: |
Code: |
:0
* ^To_psg0217@omega\.uta\.edu
IN-omegamail\
:0
* ^To_psg0217@exchange\.uta\.edu
IN-exchangemail\
:0
* ^To_paramthegreat143@hotmail\.com
IN-paramthegreat\
:O
* ^To_parminder_gupta@hotmail\.com
IN-parminder\
:0
* ^To_rox-devel
IN-paramthegreat\
:0
* ^To_JAI_INTEREST
IN-paramthegreat\
|
|
If you are using .maildir format, then I think you need to define your target folders thus:
Try that, and you might get different results.
Here's an example from my .procmailrc:
Code: | :0
* ^TO_bugtraq@*
ML_bugtraq/
|
_________________ http://dkap.info |
|
Back to top |
|
|
paramthegreat Tux's lil' helper
Joined: 12 Aug 2002 Posts: 78
|
Posted: Sat Jun 05, 2004 6:10 pm Post subject: no luck yet |
|
|
nope it does not seem to work either. i cannot figure out whats wrong. i guess i will have to dump mutt & procmail in favor of thunderbird if this does not work. _________________ Parminder
guptaparminder at yahoo dot com |
|
Back to top |
|
|
dkaplowitz Guru
Joined: 22 Nov 2003 Posts: 596 Location: Philadelphia, PA
|
Posted: Sun Jun 06, 2004 2:17 am Post subject: Re: no luck yet |
|
|
paramthegreat wrote: | nope it does not seem to work either. i cannot figure out whats wrong. i guess i will have to dump mutt & procmail in favor of thunderbird if this does not work. |
If T-bird's the easy way out and that's what you prefer, go for it. I'm curious to know if you're initializing mutt with the -y option. Also, are the folders being created in your .maildir? (Do you see folders created for the rules you defined in .procmailrc?) _________________ http://dkap.info |
|
Back to top |
|
|
paramthegreat Tux's lil' helper
Joined: 12 Aug 2002 Posts: 78
|
Posted: Sun Jun 06, 2004 6:00 pm Post subject: i prefer mutt |
|
|
i would rather use mutt if i can get it working. also i cannot c any folders being made according to the rules i defined. it seems that procmail does not do any processing on the mails, just dumps them in the .maildir folder. _________________ Parminder
guptaparminder at yahoo dot com |
|
Back to top |
|
|
dkaplowitz Guru
Joined: 22 Nov 2003 Posts: 596 Location: Philadelphia, PA
|
Posted: Sun Jun 06, 2004 9:58 pm Post subject: Re: i prefer mutt |
|
|
paramthegreat wrote: | i would rather use mutt if i can get it working. also i cannot c any folders being made according to the rules i defined. it seems that procmail does not do any processing on the mails, just dumps them in the .maildir folder. |
I think you'll be happier if you stick with mutt...it's very rewarding...and powerful to use.
I get the feeling your procmail is not even doing anything.... are you sure it's being called right by your (I'm assuming you use) fetchmail config?
Here's what I use to get my mail: Code: | fetchmail -av -m "/usr/bin/procmail -d %T"
#leaves messages on the server |
Are you sure you have the right path to procmail here? Maybe you could post your configs for us to troubleshoot.
thanks,
Dave _________________ http://dkap.info |
|
Back to top |
|
|
paramthegreat Tux's lil' helper
Joined: 12 Aug 2002 Posts: 78
|
Posted: Sun Jun 06, 2004 10:42 pm Post subject: my config files |
|
|
hi,
thanx everyone for all the help that is being offered. i am using getmail to fetch my mails cause it is simple to configure. i am going to post my configs here and c if that will help
here is my .getmail/getmailrc:
Code: |
[default] # This section provides default arguments and values,
# and variables which can be used in other sections
verbose = 1 # Be verbose by default
readall = 0 # Retrieve only new messages by default
delete = 0 # Delete mail after retrieval by default
message_log = /var/log/getmail.log # Log message retrieval and delivery to this file by default
timeout = 240 # TCP timeout value; increase if on a poor connection or
# slow POP3 server. getmail defaults to a 180 second timeout.
max_message_size = 1048576 # Don't retrieve messages over 1MB (MiB). Default is 0, which
# means no limit.
[omega mail] # Simple configuration for a single-user POP3 mailbox
server = omega.uta.edu
port = 110
username = psg0217
password = xxxxxxxxxx # no password specified; prompt for it when #getmail is run
use_apop = 0 # Use APOP authentication for this account instead of
# cleartext PASS
postmaster = "|/usr/bin/procmail" # Default delivery to this Maildir
message_log = "" # Don't log for this account
# No "local" directives necessary.
recipient_header = received # For this account, only look for recipient headers
recipient_header = x-envelope-to # in "Received:" and "X-Envelope-To:" headers
no_delivered_to = 1 # Don't add a Delivered-To: header for this mailbox
no_received = 1 # Don't add a Received: header for this mailbox
[exchange mail] # Simple configuration for a single-user POP3 mailbox
server = exchange2.uta.edu
port = 110
username = psg0217
password = xxxxxxxxx
# no password specified; prompt for it when getmail is run
use_apop = 0 # Use APOP authentication for this account instead of
# cleartext PASS
postmaster = "|/usr/bin/procmail" # Default delivery to this Maildir
message_log = "" # Don't log for this account
# No "local" directives necessary.
recipient_header = received # For this account, only look for recipient headers
recipient_header = x-envelope-to # in "Received:" and "X-Envelope-To:" headers
no_delivered_to = 1 # Don't add a Delivered-To: header for this mailbox
no_received = 1 # Don't add a Received: header for this mailbox
|
for now all i want is to get the mails placed in different folders. i know that procmail is called properly because as in the getmailrc; its procmails job to put mails in .maildir, i do not think that it is doing any filtering. i am not sure if that is related to my .procmail or something else.
thanx,
parminder. _________________ Parminder
guptaparminder at yahoo dot com |
|
Back to top |
|
|
Shemite_Dog n00b
Joined: 22 Jul 2003 Posts: 35 Location: Hailing from parts unknown!!
|
Posted: Mon Jun 07, 2004 11:12 am Post subject: |
|
|
Thanks for the great guide!!
I have one small problem though. From my home pc, everything works just fine, but when I use putty to login from my friends house I have a problem with html mail. They render fine in the preview pane, but when I press control-b, for w3m to "take over" I just see the raw html, not rendered. This has been frustrating me for two months. I've tried a few different mailcap and .muttrc entries but nothing works. I'd apreciate any insights as to why I can't get this working.
Here's what I think are the relevant snippets of my mailcap and .muttrc
mailcap:
Code: |
text/html; w3m %s; needsterminal; description=HTML Text; nametemplate=%s.html
text/html; w3m -dump %s; copiousoutput; description=HTML Text; nametemplate=%s.html
|
.muttrc:
Code: |
macro index \cb |w3m\n "call w3m to extract URLs from a message"
macro pager \cb |w3m\n "call w3m to extract URLs from a message"
|
_________________ "Mr. Mc Cluck Cluck!" |
|
Back to top |
|
|
dkaplowitz Guru
Joined: 22 Nov 2003 Posts: 596 Location: Philadelphia, PA
|
Posted: Mon Jun 07, 2004 6:54 pm Post subject: |
|
|
Shemite_Dog wrote: | Thanks for the great guide!!
I have one small problem though. From my home pc, everything works just fine, but when I use putty to login from my friends house I have a problem with html mail. They render fine in the preview pane, but when I press control-b, for w3m to "take over" I just see the raw html, not rendered. This has been frustrating me for two months. I've tried a few different mailcap and .muttrc entries but nothing works. I'd apreciate any insights as to why I can't get this working.
[/code] |
Do you have this defined in your .muttrc?:
Code: |
auto_view text/html |
Put it directly beneath your "macro pager" declaration. That's what worked for me. _________________ http://dkap.info |
|
Back to top |
|
|
BlinkEye Veteran
Joined: 21 Oct 2003 Posts: 1046 Location: Gentoo Forums
|
Posted: Fri Jun 11, 2004 12:30 pm Post subject: |
|
|
am i the only one who uses several mailaccounts and hence subfolders within ~/.maildir? i'm curious on how to convince mutt to read all my subfolder and not only one. i figured out that
Code: | #set spoolfile=~/.maildir/.INBOX |
in ~/.muttrc sets the box it reads mail from. unfortunately you can't simply add several spoolfiles as mutt only evaluates the last one specified. any suggestions? _________________ Easily backup up your system? klick
Get rid of SSH Brute Force Attempts / Script Kiddies klick |
|
Back to top |
|
|
mirko_3 l33t
Joined: 02 Nov 2003 Posts: 605 Location: Birreria
|
Posted: Fri Jun 11, 2004 6:06 pm Post subject: |
|
|
I used this guide a couple months ago, but didn't post any feedback - I'll do it now: very clearly written, very useful too.
One problem that emerged recently is with mailboxes and Imap: I've searched the web for hours, but couldn't find I could configure mailboxes on impa accounts, so that pressing c would work nice (automatically select mailbox with new mail and stuff)
That is, I've found that you could specify Imap folders in a mailboxes (in muttrc) directive, but it doesn't work... any help is gratefully accepted, but it's not a critical feature...
Again, great guide, thanks a lot! _________________ Non fa male! Non fa male! |
|
Back to top |
|
|
AgenT Apprentice
Joined: 18 May 2003 Posts: 280
|
Posted: Sat Jun 12, 2004 4:57 pm Post subject: |
|
|
BlinkEye wrote: | am i the only one who uses several mailaccounts and hence subfolders within ~/.maildir? i'm curious on how to convince mutt to read all my subfolder and not only one. i figured out that
Code: | #set spoolfile=~/.maildir/.INBOX |
in ~/.muttrc sets the box it reads mail from. unfortunately you can't simply add several spoolfiles as mutt only evaluates the last one specified. any suggestions? |
Set your spoonfile to your main email folder under ~/.maildir like so:
Code: | set spoolfile="~/.maildir/mailbox1" |
Then set the mailboxes variable like so:
Code: | mailboxes ! =mailbox1 =mailbox2 =mailbox3 |
That is all. Then use (the default) button 'c' to change between your mailboxes. The neat part about mutt is that it will auto fill mailboxes that have new emails in them. Hence you can start mutt, 'tab' your way to all the new emails in your default mailbox, press 'c' which will fill in the next mailbox that has new emails, press enter, and repeat.
If you have more than one mailbox, you should learn to use hooks. They are very useful. |
|
Back to top |
|
|
BlinkEye Veteran
Joined: 21 Oct 2003 Posts: 1046 Location: Gentoo Forums
|
Posted: Sat Jun 12, 2004 6:44 pm Post subject: |
|
|
thanks a lot for your answer. this is exactly what i've been looking for and mutt makes it even better. unfortunately i'm doing something wrong as mutt doesn't like my settings. i'll post what i've tried:
~/.muttrc
Code: | # pts/172 cat .muttrc
set spoolfile=~/.maildir/
mailboxes ! =.BlinkEye |
INBOX or .INBOX or cur doesn't work for the main spoolfile. neither .BlinkEye nor *fullpathto*blinkeye works. thanks for the hint with the key "c" - i'm now able to select my mailboxes - but not automatically or displayed via the "?" key pressed after "c" but typed in manully. _________________ Easily backup up your system? klick
Get rid of SSH Brute Force Attempts / Script Kiddies klick |
|
Back to top |
|
|
AgenT Apprentice
Joined: 18 May 2003 Posts: 280
|
Posted: Sat Jun 12, 2004 8:43 pm Post subject: |
|
|
BlinkEye wrote: | thanks a lot for your answer. this is exactly what i've been looking for and mutt makes it even better. unfortunately i'm doing something wrong as mutt doesn't like my settings. i'll post what i've tried:
~/.muttrc
Code: | # pts/172 cat .muttrc
set spoolfile=~/.maildir/
mailboxes ! =.BlinkEye |
INBOX or .INBOX or cur doesn't work for the main spoolfile. neither .BlinkEye nor *fullpathto*blinkeye works. thanks for the hint with the key "c" - i'm now able to select my mailboxes - but not automatically or displayed via the "?" key pressed after "c" but typed in manully. |
Are you saying that .maildir/ is actually a real mailbox? If so, I suggest you create a default/private maildir under that folder. So for example, if you have two mailboxes, your file structure would look something like this:
Code: |
.maildir
|_ new
|_ cur
|_ tmp
|_ mailbox1
|_ new
|_ cur
|_ tmp
|_ .sent (optional)
|_ new
|_ cur
|_ tmp
|_ mailbox2
|_ new
|_ cur
|_ tmp
|_ .sent (optional)
|_ new
|_ cur
|_ tmp
|
The new, tmp, and cur right under maildir would not be used since you will not be using the maildir folder as an actual mailbox. However, these folders are needed or mutt may have problems.
Here is the minimum .muttrc file for the above setup:
Code: |
set spoolfile="~/.maildir/mailbox1"
set folder="~/.maildir"
mailboxes ! =mailbox1 =mailbox2
|
If you opt for the .sent folder you will have to tell mutt to send all sent emails to it using folder hooks (set record="full path to .sent folder").
Please note that you may have problems if you make these directories by hand. You should use the maildir folder creation program:
I suggest you backup your .maildir folder (mv ~/.maildir ~/.maildir_backup) and start "over". Once everything works in mutt, just copy all email inside the folders in ~/.maildir_backup to ~/.maildir. Keeping newly made folders that were created by maildirmake intact. This means you would be moving only actual email files over and putting them in their corresponding directories. |
|
Back to top |
|
|
BlinkEye Veteran
Joined: 21 Oct 2003 Posts: 1046 Location: Gentoo Forums
|
Posted: Sun Jun 13, 2004 10:09 am Post subject: |
|
|
well, now i see the problem. the problem is that my mailboxes start with a ".", i.e. "~/.maildir/.mailbox1", "~/.maildir.mailbox2". if i set
Code: | set folder="~/.maildir/.mailbox1" |
i lose the ability to open my other (hidden) mailboxes via "c" and typing in ".maliboxX". i just created a new not hidden mailbox via maildirmake which works for mutt. but is it somehow possible to switch my mailboxes? _________________ Easily backup up your system? klick
Get rid of SSH Brute Force Attempts / Script Kiddies klick |
|
Back to top |
|
|
AgenT Apprentice
Joined: 18 May 2003 Posts: 280
|
Posted: Sun Jun 13, 2004 5:35 pm Post subject: |
|
|
BlinkEye wrote: | i just created a new not hidden mailbox via maildirmake which works for mutt. but is it somehow possible to switch my mailboxes? |
Not sure what you are asking. Do you want to know how to switch between mailboxes inside of mutt or how to physically move all your emails from the old mailbox to the new one which was made by maildirmake?
When you use 'c' to switch mailboxes, all you have to do is type in to switch. Notice the '=' which is exactly how it should be listed in your muttrc file.
It is actually very fast because if you have new mail mutt will fill in that blank by itself. If you want to switch to a mailbox that does not have new emails in it, all you have to do is type the = and the first or so letter of the mailbox followed by the 'tab' key (tab-completion). Easy and fast! mutt is by far the fastest email client out there especially once you have made a few configuration changes to suite your needs better. |
|
Back to top |
|
|
Benji-Boy n00b
Joined: 13 Jul 2004 Posts: 13
|
Posted: Wed Jul 14, 2004 9:07 am Post subject: |
|
|
Hey guys,
I was browsing the forums looking for any mutt configuration tips for Qmail.
There is a Qmail HowTo setup here : which recommends the use of "mutt" to browse emails, but the details on how to configure mutt for this purpose are non existent.
could someone please post some helpful code? _________________ How can one learn if one does not try?
Failure is temporary.
[>=We are what we choose to do=<] |
|
Back to top |
|
|
Andersson Guru
Joined: 12 Jul 2003 Posts: 525 Location: Göteborg, Sweden
|
Posted: Wed Jul 14, 2004 8:56 pm Post subject: |
|
|
Benji-Boy wrote: | Hey guys,
I was browsing the forums looking for any mutt configuration tips for Qmail.
There is a Qmail HowTo setup here : which recommends the use of "mutt" to browse emails, but the details on how to configure mutt for this purpose are non existent.
could someone please post some helpful code? |
mutt -f ~/.maildir opens your mailbox, if ~/.maildir is what you call it. If you'll be using mutt as your default email client, you'll probably want a configuration file. Look for examples on the mutt web page http://www.mutt.org/ _________________ Must...resist...posting....
One...step...closer...to...getting...stupid...l33t...ranking... |
|
Back to top |
|
|
Benji-Boy n00b
Joined: 13 Jul 2004 Posts: 13
|
Posted: Fri Jul 30, 2004 7:05 am Post subject: |
|
|
Thanks for the help.
Much better now.
Does anyone know a mail client which can be configured to show the entire page source?
I am really interested in being able to get information from the header of the emails such as:
encryption eg Base64 or Base 8.
If it is of mixed type or contains just text.
Originating IP, sender url etc.
text font colour and backgroung colour within the html tags.
I am trying to build a SPAM filter which uses these features but the only email client I have found which gives a comprehensive description of the RAW source is MSN hotmail euck!
Benji-Boy _________________ How can one learn if one does not try?
Failure is temporary.
[>=We are what we choose to do=<] |
|
Back to top |
|
|
Andersson Guru
Joined: 12 Jul 2003 Posts: 525 Location: Göteborg, Sweden
|
Posted: Fri Jul 30, 2004 4:49 pm Post subject: |
|
|
Benji-Boy wrote: | Does anyone know a mail client which can be configured to show the entire page source?
I am really interested in being able to get information from the header of the emails such as:
encryption eg Base64 or Base 8.
If it is of mixed type or contains just text.
Originating IP, sender url etc.
text font colour and backgroung colour within the html tags.
I am trying to build a SPAM filter which uses these features but the only email client I have found which gives a comprehensive description of the RAW source is MSN hotmail euck! |
All your mail is saved on disk as text files, the entire email including all the headers are of course in these files.
If you want to see all the headers in mutt, press h. You can set up which headers to be shown in default mode in the config file, example:
Code: | ignore * # Ignore all header info
unignore subject # Except the following
unignore to
unignore from:
unignore date
unignore CC
unignore X-Spam-Level |
_________________ Must...resist...posting....
One...step...closer...to...getting...stupid...l33t...ranking... |
|
Back to top |
|
|
AgenT Apprentice
Joined: 18 May 2003 Posts: 280
|
Posted: Sat Jul 31, 2004 5:54 pm Post subject: |
|
|
Also, if you press e you will be able to see/edit (in your set editor) the whole email source. |
|
Back to top |
|
|
Benji-Boy n00b
Joined: 13 Jul 2004 Posts: 13
|
Posted: Wed Aug 04, 2004 9:20 am Post subject: |
|
|
Thanks Agent T and Andersson.
This makes my life much easier.
I have finished the text parser which tokenises the features i am interested in as neural network inputs. It is just really annoying getting tripped up by little things that take time to lookup and find out how to get around.
Excellent support on these forums and very quick responses,
I really appreciate it.
Regards,
Benji-Boy _________________ How can one learn if one does not try?
Failure is temporary.
[>=We are what we choose to do=<] |
|
Back to top |
|
|
crimson Guru
Joined: 27 Apr 2002 Posts: 430 Location: Cedar Rapids, IA
|
Posted: Sun Sep 19, 2004 7:58 am Post subject: |
|
|
This is really informative. Thanks. |
|
Back to top |
|
|
Xaid Guru
Joined: 30 Oct 2004 Posts: 474 Location: Edmonton / Alberta
|
Posted: Wed Nov 17, 2004 6:09 pm Post subject: |
|
|
This is a good guide, thanks. One question though, if I use nbsmtp/ssmtp/msmtp and define the different smtp servers that I can send mail to, what happens for local mail? what I'm trying to say is, say I have programs which email logs to root@localhost, will using this setup break them?
Edit: nevermind, I thought msmtp would be blocked by postfix |
|
Back to top |
|
|
|