Hi all!
I'm trying to use procmail as send-mail command with mailx:
-----
set sendmail=/usr/bin/procmail -m /home/joe/.procmailoutrc
-----


But it doesn't work: when I try to send a test message I obtain an error:
-----
[joe@darkstar ~]$ echo "This is a test using mailx, procmail and esmtp for 
outgoing mail"|mail -r '[email protected]' -s 'Outgoing filtering test - 
mailx - procmail - esmtp' '[email protected]'

[joe@darkstar ~]$ procmail: Unrecognised options: "i"
Usage: procmail [-vptoY] [-f fromwhom] [parameter=value | rcfile] ...
   Or: procmail [-toY] [-f fromwhom] [-a argument] ... -d recipient ...
   Or: procmail [-ptY] [-f fromwhom] -m [parameter=value] ... rcfile [arg] ...
   Or: procmail [-toY] [-a argument] ... -z
Processing continued
procmail: Unknown user "myaddress"
^C
-----
[joe@darkstar ~]$ cat .mailrc 

set folder=/home/joe/Mail               # messaggi salvati
set record=/home/joe/Mail/unixbox       # messaggi inviati
set MAIL=/home/joe/Mail/unixbox         # mailbox utente

set sendmail=/usr/bin/procmail -m /home/joe/.procmailoutrc
-----
[joe@darkstar ~]$ mailx -V

12.5 7/5/10
-----


Seems "-i" flag is automatically passed to my "send-mail" call...
Anyway, this is my procmail rule to filter outgoing messages:
  
  1. copy message to "[email protected]" mbox
     ( ~/Mail/[email protected] ).

  2. then send message via sendmail command (I'm using "esmtp" as MTA).


~/.procmailoutrc
-----
:0
* ^From.*[email protected]
{
        :0c:
        [email protected]

        :0
        | sendmail -t
}
-----


I suspect that .mailrc and spaces or procmail flags don't get well
together... ... so I just tried to write a little shell script that
calls the same procmail command:
-----
[joe@darkstar ~]$ cat mybin/procsendmail.sh 

#!/bin/sh

/usr/bin/procmail -m /home/joe/.procmailoutrc
-----


And then I set it as "sendmail=" parameter in ~/.mailrc:
-----
[joe@darkstar ~]$ cat .mailrc 

set folder=/home/joe/Mail               # messaggi salvati
set record=/home/joe/Mail/unixbox       # messaggi inviati
set MAIL=/home/joe/Mail/unixbox         # mailbox utente

set sendmail=/home/joe/mybin/procsendmail.sh
-----

In that way, same mailx command reported above works properly and
my message is sent regularly, I can see also a copy of it appended
to my local mbox "~/Mail/[email protected]" as expected.



I report also that the same sendmail parameter is configured in
~/.muttrc and it works:
-----
set sendmail="/usr/bin/procmail -m /home/joe/.procmailoutrc"
-----

I tried double quote in ~/.mailrc too but seems mailx try to find
whole string as the sendmail binary and it said obvoiusly "not found":
-----
/usr/bin/procmail -m /home/joe/.procmailoutrc: File o directory non esistente
"/home/joe/dead.letter" 11/442
. . . message not sent.
-----

"File o direcotry non esistente" is itaian eq to "No such file or directory"

Any idea where could be the matter?
Why my sendmail string doesn't work with mailx?
Is there a way to set sendmail parameter in a mailx-friendly way without the
need of an external shell script to call procmail for outgoing mail messages?

Thanks in advance!   :)

PS.
...and  sorry for the lenght and for my bad english too!


------------------------------------------------------------------------------
_______________________________________________
nail-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nail-devel

Reply via email to