procmail
[Top] [All Lists]

Re: What is wrong here?

2001-12-28 09:22:41
On 28/12/01 at 8:38am, David Collantes wrote:

|On 28/12/01 at 1:45pm, Martin McCarthy wrote:
|
||> |How are you invoking procmail, such that you expect "$1" to contain that
||> |part of the recipient address?
||>
||> Yes, it is expected to have that part of the recipient address.
||
||I think we are talking at cross-purposes.  I understand what you want in
||$1.  Whether that value ends up in $1 and hence whether your procmailrc
||file can use it depends on your command line that runs procmail.  I
||don't know what your command line is that runs procmail.  It is the
||command line that I am asking about.  So that I can see whether your
||expectation of what should be in $1 makes sense.
||
||> But it I change $HOST for my own host
||
||If you change the value of HOST the procmail will stop processing the
||current rcfile.  The procmailrc man page has a bit to say about that.
||
||> own variable such as MYHOST="netbros.com" and use it instead of $HOST
||> it will stop working. What can I do? What is wrong?
||
||In the logfile extract that you gave us (if I understand correctly what
||you're trying to do - I'm not at all sure that I do) the process had
||"failed" before you assign a value to MYHOST because $1 did not contain
||what you expected.
|
|Yes, it failed because $1 did not contain what was expected. I use sendmail nad
|procmail as local delivery agent. What do you mean with the command line the
|runs procmail? The procmailrc I posted is .procmailrc, which procmail will run
|while performing local delivery, I am right?
|
|You mean, there is no way to change the value of HOST on procmail?

Martin and all,

What I am wondering is the following. Why this file will work:

LOGFILE=/home/d/david/procmail.log
VERBOSE=yes
LOGABSTRACT=all

EXTENSION="$1"
:0
* EXTENSION ?? .
{
  DELIMITER="+"
}

RECIPIENT="$LOGNAME$DELIMITER$EXTENSION(_at_)$HOST"
SENDER=`formail -x Return-Path | sed 's/[<>]//g;s/^[ ]*//'`

:0 w
| /home/d/david/tmda/bin/tmda-filter

EXITCODE=$?
DEFAULT=/dev/null

And render this log, which shows everything went through fine (the first email
goes to david(_at_)netbros(_dot_)com 
(david(_at_)bogart(_dot_)geeworld(_dot_)com by procmail, the second
email is the reply to the confirmation email my program sends back to the
sender)):

procmail: [21807] Fri Dec 28 09:24:40 2001
procmail: Assigning "LOGABSTRACT=all"
procmail: Assigning "EXTENSION="
procmail: No match on "."
procmail: Assigning "RECIPIENT=david(_at_)bogart(_dot_)geeworld(_dot_)com"
procmail: Executing "formail -x Return-Path | sed 's/[<>]//g;s/^[ ]*//'"
procmail: Assigning "SENDER=david(_at_)argus(_dot_)bus(_dot_)ucf(_dot_)edu"
procmail: Executing "/home/d/david/tmda/bin/tmda-filter"
procmail: Assigning "LASTFOLDER=/home/d/david/tmda/bin/tmda-filter"
From david(_at_)argus(_dot_)bus(_dot_)ucf(_dot_)edu  Fri Dec 28 09:24:40 2001
 Subject: Testing...
  Folder: /home/d/david/tmda/bin/tmda-filter                                949
procmail: Notified comsat: "david@:/home/d/david/tmda/bin/tmda-filter"

procmail: [21820] Fri Dec 28 09:24:56 2001
procmail: Assigning "LOGABSTRACT=all"
procmail: Assigning "EXTENSION=confirm+accept.1009549480.21812.5df51d"
procmail: Match on "."
procmail: Assigning "DELIMITER=+"
procmail: Assigning \
"RECIPIENT=david+confirm+accept(_dot_)1009549480(_dot_)21812(_dot_)5df51d(_at_)bogart(_dot_)geeworld(_dot_)com"
procmail: Executing "formail -x Return-Path | sed 's/[<>]//g;s/^[ ]*//'"
procmail: Assigning 
"SENDER=david+dated+1009808628(_dot_)6de4e0(_at_)argus(_dot_)bus(_dot_)ucf(_dot_)edu"
procmail: Executing "/home/d/david/tmda/bin/tmda-filter"
procmail: Assigning "LASTFOLDER=/home/d/david/tmda/bin/tmda-filter"
From 
david+dated+1009808628(_dot_)6de4e0(_at_)argus(_dot_)bus(_dot_)ucf(_dot_)edu  
Fri Dec 28 09:24:56 2001
 Subject: Re: Please confirm your message
  Folder: /home/d/david/tmda/bin/tmda-filter                               1165
procmail: Notified comsat: "david@:/home/d/david/tmda/bin/tmda-filter"

procmail: [21832] Fri Dec 28 09:24:56 2001
procmail: Assigning "LOGABSTRACT=all"
procmail: Assigning "EXTENSION=confirm+done.1009549480.21812.486010"
procmail: Match on "."
procmail: Assigning "DELIMITER=+"
procmail: Assigning \
"RECIPIENT=david+confirm+done(_dot_)1009549480(_dot_)21812(_dot_)486010(_at_)bogart(_dot_)geeworld(_dot_)com"
procmail: Executing "formail -x Return-Path | sed 's/[<>]//g;s/^[ ]*//'"
procmail: Assigning "SENDER=david(_at_)argus(_dot_)bus(_dot_)ucf(_dot_)edu"
procmail: Executing "/home/d/david/tmda/bin/tmda-filter"
procmail: Assigning "LASTFOLDER=/home/d/david/tmda/bin/tmda-filter"
From david(_at_)argus(_dot_)bus(_dot_)ucf(_dot_)edu  Fri Dec 28 09:24:56 2001
 Subject: Testing...
  Folder: /home/d/david/tmda/bin/tmda-filter                               1176
procmail: Notified comsat: "david@:/home/d/david/tmda/bin/tmda-filter"

And this will not work:

LOGFILE=/home/d/david/procmail.log
VERBOSE=yes
LOGABSTRACT=all

EXTENSION="$1"
:0
* EXTENSION ?? .
{
  DELIMITER="+"
}
RECIPIENT="$LOGNAME$DELIMITER$EXTENSION(_at_)netbros(_dot_)com"
SENDER=`formail -x Return-Path | sed 's/[<>]//g;s/^[ ]*//'`

:0 w
| /home/d/david/tmda/bin/tmda-filter

EXITCODE=$?
DEFAULT=/dev/null

And shows everything failed miserably on the procmail.log (notice the extension
not added and the no match):

procmail: [22030] Fri Dec 28 11:05:19 2001
procmail: Assigning "LOGABSTRACT=all"
procmail: Assigning "EXTENSION="
procmail: No match on "."
procmail: Assigning "RECIPIENT=david(_at_)netbros(_dot_)com"
procmail: Executing "formail -x Return-Path | sed 's/[<>]//g;s/^[ ]*//'"
procmail: Assigning "SENDER=david(_at_)atlantis(_dot_)bus(_dot_)ucf(_dot_)edu"
procmail: Executing "/home/d/david/tmda/bin/tmda-filter"
procmail: Assigning "LASTFOLDER=/home/d/david/tmda/bin/tmda-filter"
From david(_at_)atlantis(_dot_)bus(_dot_)ucf(_dot_)edu  Fri Dec 28 11:05:18 
2001
 Subject: Test
  Folder: /home/d/david/tmda/bin/tmda-filter                                626
procmail: Notified comsat: "david@:/home/d/david/tmda/bin/tmda-filter"
[david(_at_)bogart david]$ cat procmail.log

procmail: [22030] Fri Dec 28 11:05:19 2001
procmail: Assigning "LOGABSTRACT=all"
procmail: Assigning "EXTENSION="
procmail: No match on "."
procmail: Assigning "RECIPIENT=david(_at_)netbros(_dot_)com"
procmail: Executing "formail -x Return-Path | sed 's/[<>]//g;s/^[ ]*//'"
procmail: Assigning "SENDER=david(_at_)atlantis(_dot_)bus(_dot_)ucf(_dot_)edu"
procmail: Executing "/home/d/david/tmda/bin/tmda-filter"
procmail: Assigning "LASTFOLDER=/home/d/david/tmda/bin/tmda-filter"
From david(_at_)atlantis(_dot_)bus(_dot_)ucf(_dot_)edu  Fri Dec 28 11:05:18 
2001
 Subject: Test
  Folder: /home/d/david/tmda/bin/tmda-filter                                626
procmail: Notified comsat: "david@:/home/d/david/tmda/bin/tmda-filter"

Help, anyone?

Cheers!


-- 
David Collantes
http://www.bus.ucf.edu/david/
"The only source of knowledge is experience" - Albert Einstein

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>