PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Logiciels d'hébergement > comp.mail.sendmail > with Procmail
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.mail.sendmail Configuring and using the BSD sendmail agent.

with Procmail

Réponse
 
LinkBack Outils de la discussion
Vieux 25/09/2006, 09h45   #1 (permalink)
Dave
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut with Procmail

Hi Everyone,


I have procmail set up to scan emails for spam / viruses etc.. and then
forward mail on to another server. Last week i had to set up one
particular account locally. Now, I am trying to add a procmail rule to
deliver mail locally for that one account and i cant seem to get it
working.

This is how my system was before:
Sendmail cf file:

LOCAL_RULE_0
R$* < @ $=w > $* $#procmail $@
/etc/mail/procmailrc-systemwide/procmailrc $: $1<@$2.procmail.>$3
R$* < @ $=w. > $* $#procmail $@
/etc/mail/procmailrc-systemwide/procmailrc $: $1<@$2.procmail.>$3
R$* < @$* .procmail. > $* $1<@$2.>$3 Already filtered, map to original
address

### end of file ###

And the procmailrc:

### start of file ###
DROPPRIVS=yes
LOGFILE = /var/log/procmail.log

### Spamassassin start
:0fw: spamassassin.lock
* < 256000
| /usr/bin/spamc

### Check for executables and drop
:0B
* ^(Content-(Type|Disposition):.*|[ ]*(file)?)name=("[^"]*|[^
]*)\.(bat|cmd|com|exe|js|pif|scr)
/dev/null

### Deliver spam to folder
:0:
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*
! spamtrap@praybourne.local

### Scan again, just in case: Deliver spam to folder
:0:
* ^X-Spam-Status: Yes
! spamtrap@praybourne.local

### Backup all incoming email
BACKUP=/usr/_mailbackup
TODAY=`date +%d-%m-%Y`
:0c:
| formail -b >> $BACKUP/$TODAY

### This rule forwards on all email
:0 w
! -oi -f "$@"

### end of file ###
All of this works perfectly, now when i try to add a basic rule to
catch mail for a local account it doesnt work. This is what i have been
adding at the top of the procmail file:

# Rule for local account to collect email before hitting spam trap.
:0:
* ^TO: localuser@ourserver.com
! localuser

Will be grateful if anyone can tell me where i am going wrong.
Thanks
Dave.

  Réponse avec citation
Vieux 04/10/2006, 04h32   #2 (permalink)
Matt Dunford
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: with Procmail

* Dave <david.greenhall@praybourne.co.uk>:
> Hi Everyone,
>
>
> I have procmail set up to scan emails for spam / viruses etc.. and then
> forward mail on to another server. Last week i had to set up one
> particular account locally. Now, I am trying to add a procmail rule to
> deliver mail locally for that one account and i cant seem to get it
> working.
>
> This is how my system was before:
> Sendmail cf file:
>
> LOCAL_RULE_0
> R$* < @ $=w > $* $#procmail $@
> /etc/mail/procmailrc-systemwide/procmailrc $: $1<@$2.procmail.>$3
> R$* < @ $=w. > $* $#procmail $@
> /etc/mail/procmailrc-systemwide/procmailrc $: $1<@$2.procmail.>$3
> R$* < @$* .procmail. > $* $1<@$2.>$3 Already filtered, map to original
> address
>
> ### end of file ###
>
> And the procmailrc:
>
> ### start of file ###
> DROPPRIVS=yes
> LOGFILE = /var/log/procmail.log
>
> ### Spamassassin start
> :0fw: spamassassin.lock
> * < 256000
> | /usr/bin/spamc
>
> ### Check for executables and drop
> :0B
> * ^(Content-(Type|Disposition):.*|[ ]*(file)?)name=("[^"]*|[^
> ]*)\.(bat|cmd|com|exe|js|pif|scr)
> /dev/null
>
> ### Deliver spam to folder
> :0:
> * ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*
> ! spamtrap@praybourne.local
>
> ### Scan again, just in case: Deliver spam to folder
> :0:
> * ^X-Spam-Status: Yes
> ! spamtrap@praybourne.local
>
> ### Backup all incoming email
> BACKUP=/usr/_mailbackup
> TODAY=`date +%d-%m-%Y`
> :0c:
> | formail -b >> $BACKUP/$TODAY
>
> ### This rule forwards on all email
> :0 w
> ! -oi -f "$@"
>
> ### end of file ###
> All of this works perfectly, now when i try to add a basic rule to
> catch mail for a local account it doesnt work. This is what i have been
> adding at the top of the procmail file:
>
> # Rule for local account to collect email before hitting spam trap.
> :0:
> * ^TO: localuser@ourserver.com
> ! localuser
>
> Will be grateful if anyone can tell me where i am going wrong.


It may be stuck in a loop. A piece of mail comes in for localuser, then its
forwarded to localuser. Then that mail goes through the procmail process again
and gets forwarded to localuser again (and again and again). Check your logs
(/var/log/procmail.log) to see if this is what's happening.

The easiest solution will probably be modifying that last rule to something
like:

:0 w
* ! ^TO_localuser@ourserver\.com
! -oi -f "$@"

This way everything (but localuser) is forwarded on to another host.

  Réponse avec citation
Vieux 04/10/2006, 04h32   #3 (permalink)
Matt Dunford
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: with Procmail

* Dave <david.greenhall@praybourne.co.uk>:
> Hi Everyone,
>
>
> I have procmail set up to scan emails for spam / viruses etc.. and then
> forward mail on to another server. Last week i had to set up one
> particular account locally. Now, I am trying to add a procmail rule to
> deliver mail locally for that one account and i cant seem to get it
> working.
>
> This is how my system was before:
> Sendmail cf file:
>
> LOCAL_RULE_0
> R$* < @ $=w > $* $#procmail $@
> /etc/mail/procmailrc-systemwide/procmailrc $: $1<@$2.procmail.>$3
> R$* < @ $=w. > $* $#procmail $@
> /etc/mail/procmailrc-systemwide/procmailrc $: $1<@$2.procmail.>$3
> R$* < @$* .procmail. > $* $1<@$2.>$3 Already filtered, map to original
> address
>
> ### end of file ###
>
> And the procmailrc:
>
> ### start of file ###
> DROPPRIVS=yes
> LOGFILE = /var/log/procmail.log
>
> ### Spamassassin start
> :0fw: spamassassin.lock
> * < 256000
> | /usr/bin/spamc
>
> ### Check for executables and drop
> :0B
> * ^(Content-(Type|Disposition):.*|[ ]*(file)?)name=("[^"]*|[^
> ]*)\.(bat|cmd|com|exe|js|pif|scr)
> /dev/null
>
> ### Deliver spam to folder
> :0:
> * ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*
> ! spamtrap@praybourne.local
>
> ### Scan again, just in case: Deliver spam to folder
> :0:
> * ^X-Spam-Status: Yes
> ! spamtrap@praybourne.local
>
> ### Backup all incoming email
> BACKUP=/usr/_mailbackup
> TODAY=`date +%d-%m-%Y`
> :0c:
> | formail -b >> $BACKUP/$TODAY
>
> ### This rule forwards on all email
> :0 w
> ! -oi -f "$@"
>
> ### end of file ###
> All of this works perfectly, now when i try to add a basic rule to
> catch mail for a local account it doesnt work. This is what i have been
> adding at the top of the procmail file:
>
> # Rule for local account to collect email before hitting spam trap.
> :0:
> * ^TO: localuser@ourserver.com
> ! localuser
>
> Will be grateful if anyone can tell me where i am going wrong.


It may be stuck in a loop. A piece of mail comes in for localuser, then its
forwarded to localuser. Then that mail goes through the procmail process again
and gets forwarded to localuser again (and again and again). Check your logs
(/var/log/procmail.log) to see if this is what's happening.

The easiest solution will probably be modifying that last rule to something
like:

:0 w
* ! ^TO_localuser@ourserver\.com
! -oi -f "$@"

This way everything (but localuser) is forwarded on to another host.

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 01h45.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,11076 seconds with 11 queries