Re: [opensuse] postfix master.cf question

2008-01-29 Thread Carlos Lorenzo Matés
Hi Sandy.


El Viernes, 25 de Enero de 2008, Sandy Drobic escribió:
> Carlos Lorenzo Matés wrote:
> >> Okay, I finally realized just what you wanted to do. This is a script I
> >> adjusted for your purpose.


This worked like a charm. :-D


Many Thanks




-- 
Un saludo.

Carlos Lorenzo Matés.
clmates AT mundo-r DOT com


signature.asc
Description: This is a digitally signed message part.


Re: [opensuse] postfix master.cf question

2008-01-25 Thread Sandy Drobic

Carlos Lorenzo Matés wrote:


Okay, I finally realized just what you wanted to do. This is a script I
adjusted for your purpose.

You need to add error handling to your faxmail routine to achieve a robust
transport.


#-
#!/bin/sh
# I set this up in /var/lib/filter
INSPECT_DIR=/var/lib/filter

# Exit codes from 
EX_TEMPFAIL=75
EX_UNAVAILABLE=69

# Clean up when done or when aborting.
trap "rm -f in.$$" 0 1 2 3 15

# Start processing.
cd $INSPECT_DIR || {
 echo $INSPECT_DIR does not exist; exit $EX_TEMPFAIL; }

cat >in.$$ || {
 echo Cannot save mail to file; exit $EX_TEMPFAIL; }

# Specify your content filter here.
# filter 



Thank you very much, Sandy, I will try with your script on monday, as i need 
this in my job.


just to enhance my knowledge, could you explain a bit this sentences please?


 cat >in.$$ || {
  echo Cannot save mail to file; exit $EX_TEMPFAIL; }

I assume this gets the piped mail into "in.PID"


The mail gets piped into the file or if this is not possible the script 
reports the problem and sets exit code to tempfail and exits.


I need no content filter, as faxmail parses teh mail contents and convers teh 
multiparts to postscripts


That script is taken from the example of the simple filter script of the 
postfix documentation. The part with the content filter is commented out to 
show where the content filter should be called.


In your case I would probably check the error code of faxmail and report back 
to the sender if the fax was sent or not.




faxmail -o $owner -d -n $destination then the way to pass the piped mail is with the < in.$$ saved previously, 
rigth?


Yes.


how should i call this script form master.cf like i was calling mine?


Exactly as you have shown. Otherwise the script parameters probably would not 
be $1 and $2.

--
Sandy

List replies only please!
Please address PMs to: news-reply2 (@) japantest (.) homelinux (.) com

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] postfix master.cf question

2008-01-25 Thread Carlos Lorenzo Matés
Hi Sandy.


El Viernes, 25 de Enero de 2008, Sandy Drobic escribió:
> Carlos Lorenzo Matés wrote:
> >>> I'm having a lot of feedback in the hylafax list, i'm playing around a
> >>> few ideas they told me. But i will try in the postfix list if i don't
> >>> find a good solution
> >>
> >> Have you tried to use the command in mailbox_command as I suggested?
> >> That would take care of the user rights problem, provided the user is a
> >> system user.
> >
> > I tried with a custom script but i cant find how to get the mail to a
> > variable to pass it to the mailfax command, i get the rest of the
> > parameters, but no idea of how to get the mail itself (it comes form the
> > pipe)
> >
> > I don't really understand right what you mean with mailbox:command, sorry
> > :-(
>
> http://www.postfix.org/postconf.5.html#mailbox_command
>
> This is only available for recipient address in $mydestination. The
> documentation also lists the variables that can be used in mailbox_command.

I'm going to read this just now.

>
> > the users ara autentified against pam and ldap, but there is not problem,
> > the command is executed as user fax, this is right , but i can pass it a
>
> That is what would be different with mailbox_command. The script is called
> as the user, that the command is run for.
>
> > parameter to set the job owner, the problem is that parameter is not in
> > the proper way in the postfix master.cf.
> >
> > What i tried to do is call a custom script in the master.cf like that
> >
> >  fax   unix  -   n   n   -   1   pipe
> > flags= user=fax argv=/usr/local/bin/customfax.sh $(user) $(sender)
> >
> > then the customfax.sh shoul do
> >
> > #owner sender
> > owner='cut -f 1 -d @ $sender'
> >
> > #destination is user
> > destination=$1
> >
> > faxmail -o $owner -d -n $destination (and here should pass the piped
> > mail)
> >
> > this is the point i'm stoped in this way
>
> Okay, I finally realized just what you wanted to do. This is a script I
> adjusted for your purpose.
>
> You need to add error handling to your faxmail routine to achieve a robust
> transport.
>
>
> #-
> #!/bin/sh
> # I set this up in /var/lib/filter
> INSPECT_DIR=/var/lib/filter
>
> # Exit codes from 
> EX_TEMPFAIL=75
> EX_UNAVAILABLE=69
>
> # Clean up when done or when aborting.
> trap "rm -f in.$$" 0 1 2 3 15
>
> # Start processing.
> cd $INSPECT_DIR || {
>  echo $INSPECT_DIR does not exist; exit $EX_TEMPFAIL; }
>
> cat >in.$$ || {
>  echo Cannot save mail to file; exit $EX_TEMPFAIL; }
>
> # Specify your content filter here.
> # filter  #   echo Message content rejected; exit $EX_UNAVAILABLE; }
>
>   #owner sender
>   owner=`echo $2|cut -f 1 -d"@"`
>
> #destination is the user
>   destination=$1
>
>   faxmail -o $owner -d -n $destination 
> exit $?
> #-
> --



Thank you very much, Sandy, I will try with your script on monday, as i need 
this in my job.

just to enhance my knowledge, could you explain a bit this sentences please?


 cat >in.$$ || {
  echo Cannot save mail to file; exit $EX_TEMPFAIL; }

I assume this gets the piped mail into "in.PID"

I need no content filter, as faxmail parses teh mail contents and convers teh 
multiparts to postscripts

faxmail -o $owner -d -n $destination 

signature.asc
Description: This is a digitally signed message part.


Re: [opensuse] postfix master.cf question

2008-01-25 Thread Sandy Drobic

Carlos Lorenzo Matés wrote:


I'm having a lot of feedback in the hylafax list, i'm playing around a
few ideas they told me. But i will try in the postfix list if i don't
find a good solution

Have you tried to use the command in mailbox_command as I suggested? That
would take care of the user rights problem, provided the user is a system
user.


I tried with a custom script but i cant find how to get the mail to a variable 
to pass it to the mailfax command, i get the rest of the parameters, but no 
idea of how to get the mail itself (it comes form the pipe)


I don't really understand right what you mean with mailbox:command, sorry :-(


http://www.postfix.org/postconf.5.html#mailbox_command

This is only available for recipient address in $mydestination. The 
documentation also lists the variables that can be used in mailbox_command.


the users ara autentified against pam and ldap, but there is not problem, the 
command is executed as user fax, this is right , but i can pass it a 


That is what would be different with mailbox_command. The script is called as 
the user, that the command is run for.


parameter to set the job owner, the problem is that parameter is not in the 
proper way in the postfix master.cf.


What i tried to do is call a custom script in the master.cf like that

 fax   unix  -   n   n   -   1   pipe
flags= user=fax argv=/usr/local/bin/customfax.sh $(user) $(sender)

then the customfax.sh shoul do

#owner sender
owner='cut -f 1 -d @ $sender'

#destination is user
destination=$1

faxmail -o $owner -d -n $destination (and here should pass the piped mail)

this is the point i'm stoped in this way


Okay, I finally realized just what you wanted to do. This is a script I 
adjusted for your purpose.


You need to add error handling to your faxmail routine to achieve a robust 
transport.



#-
#!/bin/sh
# I set this up in /var/lib/filter
INSPECT_DIR=/var/lib/filter

# Exit codes from 
EX_TEMPFAIL=75
EX_UNAVAILABLE=69

# Clean up when done or when aborting.
trap "rm -f in.$$" 0 1 2 3 15

# Start processing.
cd $INSPECT_DIR || {
echo $INSPECT_DIR does not exist; exit $EX_TEMPFAIL; }

cat >in.$$ || {
echo Cannot save mail to file; exit $EX_TEMPFAIL; }

# Specify your content filter here.
# filter 

Re: [opensuse] postfix master.cf question

2008-01-25 Thread Carlos Lorenzo Matés
Hi.


El Jueves, 24 de Enero de 2008, Sandy Drobic escribió:
> Carlos Lorenzo Matés wrote:
> > Hi.
> >
> > Thanks.
> >
> > I'm having a lot of feedback in the hylafax list, i'm playing around a
> > few ideas they told me. But i will try in the postfix list if i don't
> > find a good solution
>
> Have you tried to use the command in mailbox_command as I suggested? That
> would take care of the user rights problem, provided the user is a system
> user.


I tried with a custom script but i cant find how to get the mail to a variable 
to pass it to the mailfax command, i get the rest of the parameters, but no 
idea of how to get the mail itself (it comes form the pipe)

I don't really understand right what you mean with mailbox:command, sorry :-(

the users ara autentified against pam and ldap, but there is not problem, the 
command is executed as user fax, this is right , but i can pass it a 
parameter to set the job owner, the problem is that parameter is not in the 
proper way in the postfix master.cf.

What i tried to do is call a custom script in the master.cf like that

 fax   unix  -   n   n   -   1   pipe
flags= user=fax argv=/usr/local/bin/customfax.sh $(user) $(sender)

then the customfax.sh shoul do

#owner sender
owner='cut -f 1 -d @ $sender'

#destination is user
destination=$1

faxmail -o $owner -d -n $destination (and here should pass the piped mail)

this is the point i'm stoped in this way

Many Thanks



-- 
Un saludo.

Carlos Lorenzo Matés.
clmates AT mundo-r DOT com


signature.asc
Description: This is a digitally signed message part.


Re: [opensuse] postfix master.cf question

2008-01-24 Thread Sandy Drobic

Carlos Lorenzo Matés wrote:

Hi.


El Jueves, 24 de Enero de 2008, Hylton Conacher (ZR1HPC) escribió:

Yes, it is notifying the user passed in $(user) but the job of the fax
belongs to the user who call faxmail

Well, i will try in the HylaFax list.

You might also try the Postfix users list at by sending an mail to
<[EMAIL PROTECTED]> to subscribe, with the following command in the
body of your email message:

subscribe postfix-users



Thanks.

I'm having a lot of feedback in the hylafax list, i'm playing around a few 
ideas they told me. But i will try in the postfix list if i don't find a good 
solution


Have you tried to use the command in mailbox_command as I suggested? That 
would take care of the user rights problem, provided the user is a system user.


--
Sandy

List replies only please!
Please address PMs to: news-reply2 (@) japantest (.) homelinux (.) com

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] postfix master.cf question

2008-01-24 Thread Carlos Lorenzo Matés
Hi.


El Jueves, 24 de Enero de 2008, Hylton Conacher (ZR1HPC) escribió:
> > Yes, it is notifying the user passed in $(user) but the job of the fax
> > belongs to the user who call faxmail
> >
> > Well, i will try in the HylaFax list.
>
> You might also try the Postfix users list at by sending an mail to
> <[EMAIL PROTECTED]> to subscribe, with the following command in the
> body of your email message:
>
> subscribe postfix-users


Thanks.

I'm having a lot of feedback in the hylafax list, i'm playing around a few 
ideas they told me. But i will try in the postfix list if i don't find a good 
solution

Many Thanks



-- 
Un saludo.

Carlos Lorenzo Matés.
clmates AT mundo-r DOT com


signature.asc
Description: This is a digitally signed message part.


Re: [opensuse] postfix master.cf question

2008-01-24 Thread Hylton Conacher (ZR1HPC)
Carlos Lorenzo Matés wrote:
> Hi.
> 
> El Domingo, 20 de Enero de 2008, Sandy Drobic escribió:
>> Carlos Lorenzo Matés wrote:
>>> Well, the case is exactly this one.
>>>
>>> I have a mail to fax gateway, but the fax jobs are sent always with the
>>> same user (the sendfax). What i want is that the fax job is sent each
>>> time with the user who really send the mai
>>>
>>> Now i have this line in the master.cf
>>>
>>> fax   unix  -   n   n   -   1   pipe
>>>flags= user=fax argv=/usr/bin/faxmail -d -n $(user)
>>>
>>>
>>> All the faxes seems to be sent by the user fax. I whant that each fax
>>> sent belongs to the user who really sent the fax.
>>>
>>>
>>> what i whould change is the user=fax to user=$(user), but i tried this
>>> and failed
>> Have you checked the man pages for faxmail to see what options are
>> available to set the user?
>>
> Yes, it is notifying the user passed in $(user) but the job of the fax 
> belongs 
> to the user who call faxmail
> 
> Well, i will try in the HylaFax list.

You might also try the Postfix users list at by sending an mail to
<[EMAIL PROTECTED]> to subscribe, with the following command in the
body of your email message:

subscribe postfix-users

Regards

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] postfix master.cf question

2008-01-22 Thread Sandy Drobic

Carlos Lorenzo Matés wrote:

Hi again.


El Lunes, 21 de Enero de 2008, Sandy Drobic escribió:

Carlos Lorenzo Matés wrote:

Hi.

El Domingo, 20 de Enero de 2008, Sandy Drobic escribió:

Carlos Lorenzo Matés wrote:

Well, the case is exactly this one.

I have a mail to fax gateway, but the fax jobs are sent always with the
same user (the sendfax). What i want is that the fax job is sent each
time with the user who really send the mai

Now i have this line in the master.cf

fax   unix  -   n   n   -   1   pipe
   flags= user=fax argv=/usr/bin/faxmail -d -n $(user)


All the faxes seems to be sent by the user fax. I whant that each fax
sent belongs to the user who really sent the fax.


what i whould change is the user=fax to user=$(user), but i tried this
and failed

Have you checked the man pages for faxmail to see what options are
available to set the user?

Yes, it is notifying the user passed in $(user) but the job of the fax
belongs to the user who call faxmail

Well, i will try in the HylaFax list.

It's worth a try. How would you execute the faxmail on the command line?



I have not tried this, but i found that the with -u parameter you can pass the 
user i tried -u $(sender) but it uses [EMAIL PROTECTED] and the user must be 
without the domain part. I'm going to test a bit and perhaps make a little 
bash script to adapt parameters and call faxmail form this script


The trouble might start if this script needs root privileges to work. The 
local delivery agent "local" of Postfix does not run under root privileges.



--
Sandy

List replies only please!
Please address PMs to: news-reply2 (@) japantest (.) homelinux (.) com

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] postfix master.cf question

2008-01-21 Thread Carlos Lorenzo Matés
Hi again.


El Lunes, 21 de Enero de 2008, Sandy Drobic escribió:
> Carlos Lorenzo Matés wrote:
> > Hi.
> >
> > El Domingo, 20 de Enero de 2008, Sandy Drobic escribió:
> >> Carlos Lorenzo Matés wrote:
> >>> Well, the case is exactly this one.
> >>>
> >>> I have a mail to fax gateway, but the fax jobs are sent always with the
> >>> same user (the sendfax). What i want is that the fax job is sent each
> >>> time with the user who really send the mai
> >>>
> >>> Now i have this line in the master.cf
> >>>
> >>> fax   unix  -   n   n   -   1   pipe
> >>>flags= user=fax argv=/usr/bin/faxmail -d -n $(user)
> >>>
> >>>
> >>> All the faxes seems to be sent by the user fax. I whant that each fax
> >>> sent belongs to the user who really sent the fax.
> >>>
> >>>
> >>> what i whould change is the user=fax to user=$(user), but i tried this
> >>> and failed
> >>
> >> Have you checked the man pages for faxmail to see what options are
> >> available to set the user?
> >
> > Yes, it is notifying the user passed in $(user) but the job of the fax
> > belongs to the user who call faxmail
> >
> > Well, i will try in the HylaFax list.
>
> It's worth a try. How would you execute the faxmail on the command line?
>

I have not tried this, but i found that the with -u parameter you can pass the 
user i tried -u $(sender) but it uses [EMAIL PROTECTED] and the user must be 
without the domain part. I'm going to test a bit and perhaps make a little 
bash script to adapt parameters and call faxmail form this script

Thanks again

 

>
> --
> Sandy
>
> List replies only please!
> Please address PMs to: news-reply2 (@) japantest (.) homelinux (.) com



-- 
Un saludo.

Carlos Lorenzo Matés.
clmates AT mundo-r DOT com


signature.asc
Description: This is a digitally signed message part.


Re: [opensuse] postfix master.cf question

2008-01-21 Thread Sandy Drobic

Carlos Lorenzo Matés wrote:

Hi.

El Domingo, 20 de Enero de 2008, Sandy Drobic escribió:

Carlos Lorenzo Matés wrote:

Well, the case is exactly this one.

I have a mail to fax gateway, but the fax jobs are sent always with the
same user (the sendfax). What i want is that the fax job is sent each
time with the user who really send the mai

Now i have this line in the master.cf

fax   unix  -   n   n   -   1   pipe
   flags= user=fax argv=/usr/bin/faxmail -d -n $(user)


All the faxes seems to be sent by the user fax. I whant that each fax
sent belongs to the user who really sent the fax.


what i whould change is the user=fax to user=$(user), but i tried this
and failed

Have you checked the man pages for faxmail to see what options are
available to set the user?

Yes, it is notifying the user passed in $(user) but the job of the fax belongs 
to the user who call faxmail


Well, i will try in the HylaFax list.


It's worth a try. How would you execute the faxmail on the command line?


--
Sandy

List replies only please!
Please address PMs to: news-reply2 (@) japantest (.) homelinux (.) com

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] postfix master.cf question

2008-01-21 Thread Carlos Lorenzo Matés
Hi.

El Domingo, 20 de Enero de 2008, Sandy Drobic escribió:
> Carlos Lorenzo Matés wrote:
> > Well, the case is exactly this one.
> >
> > I have a mail to fax gateway, but the fax jobs are sent always with the
> > same user (the sendfax). What i want is that the fax job is sent each
> > time with the user who really send the mai
> >
> > Now i have this line in the master.cf
> >
> > fax   unix  -   n   n   -   1   pipe
> >flags= user=fax argv=/usr/bin/faxmail -d -n $(user)
> >
> >
> > All the faxes seems to be sent by the user fax. I whant that each fax
> > sent belongs to the user who really sent the fax.
> >
> >
> > what i whould change is the user=fax to user=$(user), but i tried this
> > and failed
>
> Have you checked the man pages for faxmail to see what options are
> available to set the user?
>
Yes, it is notifying the user passed in $(user) but the job of the fax belongs 
to the user who call faxmail

Well, i will try in the HylaFax list.

Thanks


-- 
Un saludo.

Carlos Lorenzo Matés.
clmates AT mundo-r DOT com


signature.asc
Description: This is a digitally signed message part.


Re: [opensuse] postfix master.cf question

2008-01-20 Thread Sandy Drobic

Carlos Lorenzo Matés wrote:

Well, the case is exactly this one.

I have a mail to fax gateway, but the fax jobs are sent always with the same 
user (the sendfax). What i want is that the fax job is sent each time with 
the user who really send the mai


Now i have this line in the master.cf

fax   unix  -   n   n   -   1   pipe
   flags= user=fax argv=/usr/bin/faxmail -d -n $(user)


All the faxes seems to be sent by the user fax. I whant that each fax sent 
belongs to the user who really sent the fax.



what i whould change is the user=fax to user=$(user), but i tried this and 
failed


Have you checked the man pages for faxmail to see what options are available 
to set the user?



--
Sandy

List replies only please!
Please address PMs to: news-reply2 (@) japantest (.) homelinux (.) com

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] postfix master.cf question

2008-01-19 Thread Carlos Lorenzo Matés
Hi.




El Viernes, 18 de Enero de 2008, Sandy Drobic escribió:
> Carlos Lorenzo Matés wrote:
> > Hi to All.
> >
> > Is possible to use a variable user in the pipe option?
>
> Yeees... that is possible. Though I don't know if it is exactly what you
> require. "man 8 pipe" will tell you that the pipe deamon expands the
> localpart of the recipient address (the part left of the "@" character in
> the recipient address) for the macro ${user}.
> If that is the information you need, everything works.
>
> > ie:
> >
> > procmail  unix  -   n   n   -   -   pipe
> >   flags=R user=nobody argv=/usr/bin/procmail -t -m /etc/procmailrc
> > ${sender} ${recipient}
> >
> >
> > in this line change the user=nobody to user=${user}
>
> I wouldn't touch that.
>
> If you deliver to a command via mailbox_command (not a pipe) then this
> comes to play:
>
> Mailbox delivery can be delegated to an  external  command
> specified  with  the mailbox_command_maps and mailbox_com-
> mand configuration parameters. The command  executes  with
> the  privileges  of  the  recipient user (exceptions: sec-
> ondary groups are not enabled;  in  case  of  delivery  as
> root,   the   command  executes  with  the  privileges  of
> default_privs).
>
> Would that help you?
>
> > it is not exactly to change the procmail user, but for changing the user
> > in the emailto fax gateway, the line is similar.
>
> How does the line look?
>


Well, the case is exactly this one.

I have a mail to fax gateway, but the fax jobs are sent always with the same 
user (the sendfax). What i want is that the fax job is sent each time with 
the user who really send the mai

Now i have this line in the master.cf

fax   unix  -   n   n   -   1   pipe
   flags= user=fax argv=/usr/bin/faxmail -d -n $(user)


All the faxes seems to be sent by the user fax. I whant that each fax sent 
belongs to the user who really sent the fax.


what i whould change is the user=fax to user=$(user), but i tried this and 
failed

Thanks


-- 
Un saludo.

Carlos Lorenzo Matés.
clmates AT mundo-r DOT com


signature.asc
Description: This is a digitally signed message part.


Re: [opensuse] postfix master.cf question

2008-01-18 Thread Sandy Drobic

Carlos Lorenzo Matés wrote:

Hi to All.

Is possible to use a variable user in the pipe option?


Yeees... that is possible. Though I don't know if it is exactly what you 
require. "man 8 pipe" will tell you that the pipe deamon expands the localpart 
of the recipient address (the part left of the "@" character in the recipient 
address) for the macro ${user}.

If that is the information you need, everything works.



ie:

procmail  unix  -   n   n   -   -   pipe
  flags=R user=nobody argv=/usr/bin/procmail -t -m /etc/procmailrc ${sender} 
${recipient}



in this line change the user=nobody to user=${user}


I wouldn't touch that.

If you deliver to a command via mailbox_command (not a pipe) then this comes 
to play:


   Mailbox delivery can be delegated to an  external  command
   specified  with  the mailbox_command_maps and mailbox_com-
   mand configuration parameters. The command  executes  with
   the  privileges  of  the  recipient user (exceptions: sec-
   ondary groups are not enabled;  in  case  of  delivery  as
   root,   the   command  executes  with  the  privileges  of
   default_privs).

Would that help you?



it is not exactly to change the procmail user, but for changing the user in 
the emailto fax gateway, the line is similar.


How does the line look?



--
Sandy

List replies only please!
Please address PMs to: news-reply2 (@) japantest (.) homelinux (.) com

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]