Re: filter feedback/help request

2019-07-05 Thread Edgar Pettijohn
Turned out to be a line buffering issue. The following works.

#!/usr/bin/perl

open(my $fh, '>', '/tmp/test.txt');

select(STDOUT);
$|++;
select($fh);
$|++;

print STDOUT "register|report|smtp-in|*\n";
print STDOUT "register|ready\n";

while ( my $line = <> ) {
print $fh "$line";
}

close $fh;

0;

-- 
You received this mail because you are subscribed to misc@opensmtpd.org
To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org



Re: what's your LMTP use-case

2019-07-05 Thread Vijay Sankar



Quoting Gilles Chehade :


helo,

this is just a question out of curiosity

I know plenty of people use the lmtp action to deliver mail through LMTP
and I'm genuinely curious: what is your use-case ?

Why do you deliver to LMTP ?

--
Gilles Chehade @poolpOrg

https://www.poolp.orgpatreon: https://www.patreon.com/gilles

--
You received this mail because you are subscribed to misc@opensmtpd.org
To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org


My mail server is internal (OpenBSD 6.4+dovecot+OpenSMTPd) and gets  
mail from an MX (OpenSMTPd). With SMTP, I used to get failures even if  
I had one invalid recipient. So I use LMTP since email to multiple  
recipients works more smoothly.


Thanks very much Gilles for all your detailed answers.

Vijay
--
ForeTell Technologies Limited
59 Flamingo Avenue
Winnipeg, MB, Canada
R3J 0X6


--
You received this mail because you are subscribed to misc@opensmtpd.org
To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org



Re: what's your LMTP use-case

2019-07-05 Thread Thomas Bohl

Hello,


I know plenty of people use the lmtp action to deliver mail through LMTP
and I'm genuinely curious: what is your use-case ?


I use dovecot's lmtp to utilise Sieve[1] scripts and mailbox replication[2].

[1] https://wiki2.dovecot.org/Pigeonhole
[2] https://wiki2.dovecot.org/Replication

--
You received this mail because you are subscribed to misc@opensmtpd.org
To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org



Re: what's your LMTP use-case

2019-07-05 Thread mabi
‐‐‐ Original Message ‐‐‐
On Friday, July 5, 2019 5:25 PM, Edgar Pettijohn  
wrote:

> I'm using dovecot for imap so might as well let it handle the delivery also. 
> Not much of a reason but it's it.

Same here, Dovecot "dictates" me to use LMTP...


--
You received this mail because you are subscribed to misc@opensmtpd.org
To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org



Re: what's your LMTP use-case

2019-07-05 Thread Edgar Pettijohn

On Jul 5, 2019 9:57 AM, Gilles Chehade  wrote:
>
> helo,
>
> this is just a question out of curiosity
>
> I know plenty of people use the lmtp action to deliver mail through LMTP
> and I'm genuinely curious: what is your use-case ?
>
> Why do you deliver to LMTP ?
>
> -- 
> Gilles Chehade    @poolpOrg
>
> https://www.poolp.org    patreon: https://www.patreon.com/gilles
>
> -- 
> You received this mail because you are subscribed to misc@opensmtpd.org
> To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org
>


I'm using dovecot for imap so might as well let it handle the delivery also. 
Not much of a reason but it's 
it.b��yǢ��m�+&j)[yƮ�쨹�޲��r��y�h�+kiv��N�r��zǧu���[h�+��칻�&ޢ���kiv��

what's your LMTP use-case

2019-07-05 Thread Gilles Chehade
helo,

this is just a question out of curiosity

I know plenty of people use the lmtp action to deliver mail through LMTP
and I'm genuinely curious: what is your use-case ?

Why do you deliver to LMTP ?

-- 
Gilles Chehade @poolpOrg

https://www.poolp.orgpatreon: https://www.patreon.com/gilles

-- 
You received this mail because you are subscribed to misc@opensmtpd.org
To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org



Re: filter feedback/help request

2019-07-05 Thread Marc Chantreux
hello,

as it's not relatted to opensmtp, i don't know if replying is ok. please
let me know if it wasn't.

  > Here is a basic shell script that works.
  
  #!/bin/sh
  
  echo "register|report|smtp-in|*"
  echo "register|ready"
  
  while read -r line;
  do
echo "$line" >> /tmp/test.txt
  done

are you aware you just missed a use of cat?

  #!/bin/sh
  
  echo "register|report|smtp-in|*"
  echo "register|ready"
  cat >> /tmp/test.txt
  
> However, the perl and lua equivalents do nothing.

* I don't know about lua but as you used '>>' in your shell script, you
  have to use it in the perl one to get the same behavior.
* also using print FH use the global FH (old school perl)..
  don't do that with serious scripts but you can write:

  #!/usr/bin/perl
  use autodie;
  open FH,'>/tmp/test.txt';
  print
( "register|report|smtp-in|*\n"
, "register|ready\n" );
  print FH while <>;

regards
marc

-- 
You received this mail because you are subscribed to misc@opensmtpd.org
To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org