Re: ezmlm-get: fatal: I do not reply to bounce messages
Tobias Carlsson <[email protected]> Thu, 07 Feb 2008 18:21:39 +0100
| Newsgroups | gmane.mail.ezmlm |
|---|---|
| Message-ID | <[email protected]> |
Thanks Bruce! I did actually notice that the from address wasn't there on mx2, but I didn't pay much attention to that because the normal email account was reciving the email's. Also really nice that you pointed out the flaws in the perl script as well. Thanks again for saving my day! Bruce Guenter skrev: > On Thu, Feb 07, 2008 at 08:57:37AM +0100, Tobias Carlsson wrote: > >> mx1 >> ---- >> @4000000047aab14f0ac2c4b4 new msg 539491 >> @4000000047aab14f0ac2dc24 info msg 539491: bytes 1927 from <[email protected]> qp 28699 uid 1006 >> >> mx2 >> ---- >> @4000000047aaae2c06c7fc1c new msg 2459523 >> @4000000047aaae2c06c803ec info msg 2459523: bytes 2099 from <> qp 6385 uid 1002 >> > > Here is the obvious problem. When the mail is forwarded, the sender > address is truncated, which is why ezmlm thinks that it is trying to > respond to a bounce. > > Looking at your posted script, I see some issues: > > >> #!/usr/bin/perl >> >> $argslen = scalar @ARGV; >> >> if ($argslen != 3){ >> print "qmail-remote-invoke.pl must be called as: >> qmail-remote-invoke.pl host sender recip"; >> exit 111; >> } >> >> >> @email = <STDIN>; >> $file = "/tmp/".generate_random_string(11); >> >> open(tmpfile, ">>$file"); >> >> foreach $line (@email){ >> print tmpfile $line; >> } >> >> close(tmpfile); >> > > Copying the original message to a file appears to be completely > unnecessary. You're not adding anything to the message, and programs > invoked in .qmail files already have a file as standard input, not a > pipe. Besides, by reading in the whole file into memory, the first > person to send you an email larger than available memory will reliably > blow up your system. > > >> $sender =~ s/["]//g; >> > > Here's the real problem. $sender is never set anywhere. You need: > > $sender = $ARGV[1]; > > or > > $sender = $ENV['SENDER']; > > somewhere. > > >> $status = `/var/qmail/bin/qmail-remote $ARGV[0] "$sender" "$ARGV[2]" < $file`; >> > > Safer would be: > > open(PIPE, '-|', '/var/qmail/bin/qmail-remote', $ARGV[0], $sender, $ARGV[2]); > $status = <PIPE>; > close(PIPE); > >