Ask a Question related to Linux / Unix Administration, Design and Development.
-
mat #1
Procmail Problem
Hi all,
I am sorry if this is not the right forum for this sort of question, it
seemed the best match from the forums I had on offer. Hopefully I will be
able to find someone who can help.
I have no real experience with 'nix, but do have a shared (Red Hat I think?)
hosting account. I am trying to set up a promailrc file to direct incoming
mail to a script. This works fine when I don't use conditionals:
:0
| /usr/bin/php /home/myaccount/myscript
However, all conditionals seem to fail....
:0
* Subject.*urgent
| /usr/bin/php /home/myaccount/myscript
I have tried so many conditional statements that I do not think it is just
me getting the syntax wrong... for example, I have tried, as some tutorials
suggest, having the colon in the above, etc.:
* Subject:.*urgent
If anyone could suggest any pearls that would help, I would greatly
appreciate it.
Many Thanks,
Mat.
mat Guest
-
[procmail] [sed] [awk] cleaning up mail headers
Not quite sure where to post this ... I am trying to write a command line for procmail that takes the From: header field from an email and cleans... -
ProcMail with Perl and MailAudit
Hi! I found a website that explains how to parse the mails with procmail and MailAudit (procmail filter send each message that arrives to my perl... -
Spamassassin and procmail
Hi all, I currently use fetchmail and procmail to get and sort my mail. I'd like to use spamassassin as well, however when I add :0fw:... -
Procmail partially working
I have setup fetchmail to get my mail from my two pop3 accounts and to be then processed by procmail. Mail is then processed by Spamassassin,... -
procmail and vacation
In article <3efac72e$0$10836$3b214f66@usenet.univie.ac.at> Martin Paul <martin@par.univie.ac.at> writes: But it still works, doesn't it? I think... -
Davide Bianchi #2
Re: Procmail Problem
mat <yubhuntleyremoveboo@yahoo.co.uk> wrote:
Try adding> However, all conditionals seem to fail....
> :0
> * Subject.*urgent
> | /usr/bin/php /home/myaccount/myscript
LOGFILE=somelogfile
VERBOSE=YES
at the beginning of the .procmailrc and see what's going on.
Warning: the "verbose" can become reaaaally verbose...
Davide
Davide Bianchi Guest
-
Michael Heiming #3
Re: Procmail Problem
Davide Bianchi <davideyeahsure@onlyforfun.net> wrote:
> mat <yubhuntleyremoveboo@yahoo.co.uk> wrote:> > However, all conditionals seem to fail....
> > :0
> > * Subject.*urgent
> > | /usr/bin/php /home/myaccount/myscript> Try addingIsn't it:> LOGFILE=somelogfile
> VERBOSE=YES
VERBOSE=on
I'd add in addition:
LOGABSTRACT=all
--
Michael Heiming
Remove +SIGNS and www. if you expect an answer, sorry for
inconvenience, but I get tons of SPAM
Michael Heiming Guest
-
Davide Bianchi #4
Re: Procmail Problem
Michael Heiming <michael+USENET@www.heiming.de> wrote:
>> LOGFILE=somelogfile
>> VERBOSE=YESHummm... I've used VERBOSE=YES and it worked, but probably is because> Isn't it:
> VERBOSE=on
I've a quite mangled version of procmail.
Davide
Davide Bianchi Guest
-
mat #5
Re: Procmail Problem
Hi Davide and Michael,
Thank you for your advice. I did as you said, and now have the following
procmailrc file:
LOGFILE=/home/account/maillogs/mail.txt
VERBOSE=on
LOGABSTRACT=all
:0
^From.*mat*
^Subject:.*mail2
|/usr/bin/php /home/account/incoming/mail.php
This is not supposed to, but does, write two files before failing. One is
the LOGFILE mail.txt file and the other is one called ^From.*mat*.
Obviously, it thinks I want the mail written to the "file" ^From etc., but
why? Why doesn't it see that as a conditional. This has also raised another
problem, in as much as both of these files (i.e. the LOGFILE as well) are in
accessible to me via ftp or the servers control panel... I can see them but
not touch them. Tech support suggested this was because Procmail would have
written it with "mail" as a user, and that this therefore blocked me out...
If I can appeal to you guys again for help on this one, I am more than at a
loss to know what to do from here.
Thanks Again,
Mat
"mat" <yubhuntleyremoveboo@yahoo.co.uk> wrote in message
news:bntrj1$e7m$1@news8.svr.pol.co.uk...think?)> Hi all,
>
> I am sorry if this is not the right forum for this sort of question, it
> seemed the best match from the forums I had on offer. Hopefully I will be
> able to find someone who can help.
>
> I have no real experience with 'nix, but do have a shared (Red Hat Itutorials> hosting account. I am trying to set up a promailrc file to direct incoming
> mail to a script. This works fine when I don't use conditionals:
>
> :0
> | /usr/bin/php /home/myaccount/myscript
>
> However, all conditionals seem to fail....
>
> :0
> * Subject.*urgent
> | /usr/bin/php /home/myaccount/myscript
>
> I have tried so many conditional statements that I do not think it is just
> me getting the syntax wrong... for example, I have tried, as some> suggest, having the colon in the above, etc.:
>
> * Subject:.*urgent
>
> If anyone could suggest any pearls that would help, I would greatly
> appreciate it.
>
> Many Thanks,
>
> Mat.
>
>
mat Guest
-
Davide Bianchi #6
Re: Procmail Problem
mat <yubhuntleyremoveboo@yahoo.co.uk> wrote:
You forgot to put a * at the beginning of the line where the rule> the LOGFILE mail.txt file and the other is one called ^From.*mat*.
is.
Davide
Davide Bianchi Guest
-
mat #7
Re: Procmail Problem
Thanks Davide! (feels a little foolish now!)
Mat
"Davide Bianchi" <davideyeahsure@onlyforfun.net> wrote in message
news:bo0tn8$16gg68$3@ID-18487.news.uni-berlin.de...> mat <yubhuntleyremoveboo@yahoo.co.uk> wrote:>> > the LOGFILE mail.txt file and the other is one called ^From.*mat*.
> You forgot to put a * at the beginning of the line where the rule
> is.
>
> Davide
mat Guest
-
Kenny McCormack #8
Re: Procmail Problem
In article <bo0tn8$16gg68$3@ID-18487.news.uni-berlin.de>,
Davide Bianchi <davideyeahsure@onlyforfun.net> wrote:Note that the syntax of procmailrc is *really*:>mat <yubhuntleyremoveboo@yahoo.co.uk> wrote:>>> the LOGFILE mail.txt file and the other is one called ^From.*mat*.
>You forgot to put a * at the beginning of the line where the rule
>is.
:N
rule1
....
ruleN
where N is the number of rule lines. It is just that sometime later, they
decided to allow * to be sort of an "escape character" that would make
something a rule, regardless of the count. So, then the convention became
to put the count as 0 and always use the * feature. I suppose this is
a little easier for the mentally-challenged to wrap their brains around, but
it always struck me as cooky. Thus, I continue to use the original syntax,
which makes more sense to me.
So, in your case, you can do:
:2
^Subject.*...
^From.*...
Kenny McCormack Guest
-
James T. Dennis #9
Re: Procmail Problem
Kenny McCormack <gazelle@yin.interaccess.com> wrote:
> In article <bo0tn8$16gg68$3@ID-18487.news.uni-berlin.de>,
> Davide Bianchi <davideyeahsure@onlyforfun.net> wrote:>>mat <yubhuntleyremoveboo@yahoo.co.uk> wrote:>>> the LOGFILE mail.txt file and the other is one called ^From.*mat*.>>You forgot to put a * at the beginning of the line where the rule
>>is.> Note that the syntax of procmailrc is *really*:> :N
> rule1
> ...
> ruleNI would say that the original syntax was a "little cocky" (as it were)> where N is the number of rule lines. It is just that sometime later, they
> decided to allow * to be sort of an "escape character" that would make
> something a rule, regardless of the count. So, then the convention became
> to put the count as 0 and always use the * feature. I suppose this is
> a little easier for the mentally-challenged to wrap their brains around, but
> it always struck me as cooky. Thus, I continue to use the original syntax,
> which makes more sense to me.
and tell my students to treat the :0 as a block delimiter. I do teach them
the historical meaning of the digit. I honestly didn't know that the old
form was still supported :)
> So, in your case, you can do:> :2
> ^Subject.*...
> ^From.*...
--
Jim Dennis,
Starshine: Signed, Sealed, Delivered
James T. Dennis Guest



Reply With Quote

