View previous topic :: View next topic |
Author |
Message |
javock Tux's lil' helper
Joined: 01 Jan 2004 Posts: 106 Location: Babeland... yeah! I wish!
|
Posted: Thu Feb 12, 2004 6:37 pm Post subject: maildir & procmail rules |
|
|
Hello there...
I am trying to configure my router/firewall/mail server (moved from redhat a few hours ago)...
The problem comes when I try to use .procmail based rules to deliver mails to different folders.
I use $HOME/.maildir created with maildirmake (check spelling) and the other directories inside that one where made by the IMAP client (thunderbird 0.4). Also I am running postfix and courier-IMAP, both seem to work ok because if I disable .procmailrc (mv .procmailrc .procmailrc~) or mail arrives that has no rule matching it, it gets delivered to the inbox, otherwise (matches rule) it gets lost.
I am sure it's a missconfiguration (can't get the hold of maildir yet, although it seems simple)
/etc/procmailrc :
Code: |
# Use maildir-style mailbox in user's home directory
DEFAULT=$HOME/.maildir/
|
/etc/postfix :
Code: |
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
mail_owner = postfix
myorigin = $mydomain
inet_interfaces = $myhostname, localhost
mydestination = $myhostname, localhost.$mydomain
unknown_local_recipient_reject_code = 450
home_mailbox = .maildir/
mailbox_command = /usr/bin/procmail -a $DOMAIN
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
setgid_group = postdrop
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.0.16-r1/sample
readme_directory = /usr/share/doc/postfix-2.0.16-r1/readme
default_destination_concurrency_limit = 2
alias_database = hash:/etc/mail/aliases
local_destination_concurrency_limit = 2
alias_maps = hash:/etc/mail/aliases
home_mailbox = .maildir/
|
looking at it without the comments makes me feel that there are too much options
$HOME/.procmailrc
Code: |
PATH=/usr/bin:/usr/local/bin:/bin
MAILDIR=$HOME/.maildir/
LOGFILE=/tmp/log.procmail.$LOGNAME
LOG="--- Logging for $LOGNAME."
SHELL=/bin/bash
SENDER=`formail -x Return-Path | sed 's/[<>]//g;s/^[ ]*//'`
SUBJECT=`formail -x Subject: | expand | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g'`
VERBOSE=yes
LOGABSTRACT=all
:0
* ^To:.*javock@perso.com.ar
.contactos
|
Hope you people can figure it out!
Thanks
Edit : Forgot the LOG
Code: | --- Logging for personaje.--- Logging for personaje.procmail: [11743] Thu Feb 12 12:33:50 2004
procmail: Assigning "LOGABSTRACT=all"
procmail: No match on "^Received:.*javier@urien.com.ar"
procmail: No match on "^From:.*root@homero.urien.com.ar"
procmail: Match on "^To:.*javock@perso.com.ar"
procmail: Assigning "LASTFOLDER=.contactos/msg.s9B"
procmail: Opening ".contactos/msg.s9B"
procmail: Acquiring kernel-lock
procmail: [11749] Thu Feb 12 12:33:50 2004
procmail: Assigning "LOGABSTRACT=all"
procmail: Notified comsat: "personaje@0:/home/personaje/.maildir//.contactos/msg.s9B"
From perso@abraham.com Thu Feb 12 12:33:50 2004
Subject: mas test para procmail....
Folder: .contactos/msg.s9B 1456
|
_________________ The heart has reasons that the reason will never understand.
-- La Renga. El final es donde partí |
|
Back to top |
|
|
eNut n00b
Joined: 13 Jun 2003 Posts: 36
|
Posted: Thu Feb 12, 2004 7:26 pm Post subject: |
|
|
Do you have a cur, tmp, and new dir in the .contactos/ directory? |
|
Back to top |
|
|
javock Tux's lil' helper
Joined: 01 Jan 2004 Posts: 106 Location: Babeland... yeah! I wish!
|
Posted: Thu Feb 12, 2004 7:40 pm Post subject: |
|
|
eNut wrote: | Do you have a cur, tmp, and new dir in the .contactos/ directory? |
this is what I got :
Code: | personaje@abraham .contactos $ pwd
/home/personaje/.maildir/.contactos
personaje@abraham .contactos $ ll -la
total 47
drwx------ 6 personaje users 392 Feb 12 12:33 .
drwx------ 68 personaje users 2200 Feb 12 13:45 ..
drwx------ 2 personaje users 48 Feb 9 05:31 courierimapkeywords
-rw-r--r-- 1 personaje users 1575 Feb 9 06:43 courierimapuiddb
drwx------ 2 personaje users 1984 Feb 9 06:43 cur
-rwx------ 1 personaje users 0 Feb 9 05:26 maildirfolder
-rw------- 1 personaje users 1432 Feb 12 12:04 msg.49B
-rw------- 1 personaje users 1456 Feb 12 12:12 msg.68B
-rw------- 1 personaje users 1456 Feb 12 12:23 msg.97B
-rw------- 1 personaje users 1456 Feb 12 12:16 msg.C-B
-rw------- 1 personaje users 1456 Feb 12 12:19 msg.D-B
-rw------- 1 personaje users 1456 Feb 12 12:33 msg.s9B
-rw------- 1 personaje users 12176 Feb 12 12:04 msg.y9B
drwx------ 2 personaje users 48 Feb 9 05:26 new
drwx------ 2 personaje users 48 Feb 12 13:30 tmp
|
Now that I see, there are files (msg.*) that seem to be the mails... should I change the rule to this? :
Code: | :0
* ^To:.*javock@perso.com.ar
.contactos/new
|
I will try and let you now... _________________ The heart has reasons that the reason will never understand.
-- La Renga. El final es donde partí |
|
Back to top |
|
|
Souperman Guru
Joined: 14 Jul 2003 Posts: 449 Location: Cape Town, South Africa
|
Posted: Thu Feb 12, 2004 8:03 pm Post subject: |
|
|
AFAIK, the dir to move to in your .procmailrc needs to end in a trailing / when using maildir mailboxes.
HTH _________________ moo |
|
Back to top |
|
|
javock Tux's lil' helper
Joined: 01 Jan 2004 Posts: 106 Location: Babeland... yeah! I wish!
|
Posted: Thu Feb 12, 2004 8:18 pm Post subject: |
|
|
Tryed this rules :
Code: | # procmail configuration.
# Vars
PATH=/usr/bin:/usr/local/bin:/bin
MAILDIR=$HOME/.maildir/
#LOGFILE=/var/log/log.procmail.$LOGNAME
#LOGFILE=/var/log/messages
LOGFILE=/tmp/log.procmail.$LOGNAME
LOG="--- Logging for $LOGNAME."
SHELL=/bin/bash
SENDER=`formail -x Return-Path | sed 's/[<>]//g;s/^[ ]*//'`
SUBJECT=`formail -x Subject: | expand | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g'`
VERBOSE=yes
LOGABSTRACT=all
LASTFOLDER=$(pwd)
#DEFAULT=$HOME/.maildir/
# End Config Vars
:0
* ^To:.*javock@perso.com.ar
$MAILDIRcontactos/new
:0
* ^Received:.*javock@perso.com.ar
$MAILDIRcontactos/new
|
And got this...
Code: | --- Logging for personaje.procmail: [5256] Thu Feb 12 14:26:21 2004
procmail: Assigning "LOGABSTRACT=all"
procmail: Assigning "LASTFOLDER=$(pwd)"
procmail: Match on "^To:.*javock@perso.com.ar"
procmail: Assigning "LASTFOLDER=/new"
procmail: Opening "/new"
procmail: Error while writing to "/new"
procmail: Match on "^Received:.*javock@perso.com.ar"
procmail: Assigning "LASTFOLDER=/new"
procmail: Opening "/new"
procmail: Error while writing to "/new"
procmail: Assigning "LASTFOLDER=/home/personaje/.maildir/new/1076606781.5256_0.a
braham"
procmail: Notified comsat: "personaje@0:/home/personaje/.maildir/new/1076606781.
5256_0.abraham"
From perso@abraham.com Thu Feb 12 14:26:21 2004
Subject: testeando, porque la otra vez me =?ISO-8859-1?Q?equivoqu=E9!?=
Folder: /home/personaje/.maildir/new/1076606781.5256_0.abraham 1437
|
I think I should try using the dot... I will let you know! _________________ The heart has reasons that the reason will never understand.
-- La Renga. El final es donde partí |
|
Back to top |
|
|
javock Tux's lil' helper
Joined: 01 Jan 2004 Posts: 106 Location: Babeland... yeah! I wish!
|
Posted: Thu Feb 12, 2004 8:22 pm Post subject: |
|
|
javock wrote: | Tryed this rules :
Code: | # procmail configuration.
..Snipety Snipety..
:0
* ^To:.*javock@perso.com.ar
$MAILDIRcontactos/new
:0
* ^Received:.*javock@perso.com.ar
$MAILDIRcontactos/new
|
|
is there a way to turn this two rules into one? I mean like an OR-something? like this :
Code: | IF * ^To:.*javock@perso.com.ar OR * ^Received:.*javock@perso.com.ar THEN
move/to/somewhere |
Thanks _________________ The heart has reasons that the reason will never understand.
-- La Renga. El final es donde partí |
|
Back to top |
|
|
javock Tux's lil' helper
Joined: 01 Jan 2004 Posts: 106 Location: Babeland... yeah! I wish!
|
Posted: Thu Feb 12, 2004 8:26 pm Post subject: maildir & procmail rules [WORKING] |
|
|
That did it...
Had it working with this :
Code: | # procmail configuration.
# Vars
PATH=/usr/bin:/usr/local/bin:/bin
MAILDIR=$HOME/.maildir/
#LOGFILE=/var/log/log.procmail.$LOGNAME
#LOGFILE=/var/log/messages
LOGFILE=/tmp/log.procmail.$LOGNAME
LOG="--- Logging for $LOGNAME."
SHELL=/bin/bash
SENDER=`formail -x Return-Path | sed 's/[<>]//g;s/^[ ]*//'`
SUBJECT=`formail -x Subject: | expand | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g'`
VERBOSE=yes
LOGABSTRACT=all
LASTFOLDER=$(pwd)
#DEFAULT=$HOME/.maildir/
# End Config Vars
:0
* ^To:.*javock@perso.com.ar
$MAILDIR.contactos/new
:0
* ^Received:.*javock@perso.com.ar
$MAILDIR.contactos/new
|
Now if I just could get that OR-thing working!!
Thanks!! _________________ The heart has reasons that the reason will never understand.
-- La Renga. El final es donde partí |
|
Back to top |
|
|
Souperman Guru
Joined: 14 Jul 2003 Posts: 449 Location: Cape Town, South Africa
|
Posted: Fri Feb 13, 2004 6:59 am Post subject: |
|
|
[quote="javock"] javock wrote: | is there a way to turn this two rules into one? I mean like an OR-something? like this :
Code: | IF * ^To:.*javock@perso.com.ar OR * ^Received:.*javock@perso.com.ar THEN
move/to/somewhere |
Thanks |
Code: | * ^(Received|To):.*javock@perso.com.ar |
(aaa|bbb|ccc) in regexp "match 'aaa' or 'bbb' or 'ccc'".
HTH _________________ moo |
|
Back to top |
|
|
|