piped program in sendmail is/ etc/aliases

I'm attempting some type of vehicle - registration using a homemade manuscript. I recognize it can be attained by newsletter such as Mailman yet I additionally intend to find out at the very same time on just how to do it by hand.

Below is the straightforward manuscript:

#!/usr/bin/perl

use strict;
use warnings;

open ("RCV_MAIL", ">>/home/icasimpan/mail_received.txt") or die $!;
while(<STDIN>){
   print RCV_MAIL;
}
close(RCV_MAIL);

I affixed the above manuscript in/ etc/aliases making use of the syntax:

subscribe: | /home/icasimpan/parse-subscribe.pl

and also run

$ sudo newaliases

It is still a really bare manuscript. Simply examining out if I my syntax in/ etc/aliases is proper.

Yet when I attempted emailing subscribe @mydomaintests.tld, it returns something like:

Delivery failure 69

I'm making use of Lotus Notes so my google search routed me to this link. Evidently, something to do with the documents ... Not certain.

The command is executable, actually I attempted making it 777 and also also developed the mail_received. txt in the directory site simply to guarantee I have no documents approval trouble yet still the very same.

0
2019-05-18 23:11:42
Source Share
Answers: 3

You require to price estimate the "pen name" if it has a room in it:

subscribe: "| /home/icasimpan/parse-subscribe.pl"

or remove the room:

subscribe: |/home/icasimpan/parse-subscribe.pl
0
2019-05-22 20:15:40
Source
open ("RCV_MAIL", ">>/home/icasimpan/mail_received.txt") or die $!;
while(<STDIN>){
   print RCV_MAIL;
}

is incorrect.

If you are attempting to publish lines from STDIN to mail_received. txt, you would certainly require:

open (RCV_MAIL, ">>/home/icasimpan/mail_received.txt") or die $!;
while (<STDIN>) {
   print RCV_MAIL $_;
}

due to the fact that print with one argument takes the argument to suggest the checklist to publish, not the filehandle to publish it to.

$ perldoc -f print
print FILEHANDLE LIST
print LIST
...

Also, no demand for quotes around the filehandle name in open. Simply make use of RCV_MAIL.

0
2019-05-21 10:00:30
Source

If you are running a sendmail with smrsh set up (usual in a great deal of default arrangements) you will certainly require to run the piped command out of/ etc/smrsh/. It can either be a symlink or a duplicate of the manuscript, yet if sendmail has 'smrsh' specified, it will certainly require to be ranged from that directory site. As an example:

subscribe: | /etc/smrsh/parse-subscribe.pl

Check the sendmail documents on smrsh for even more information.

0
2019-05-21 09:53:10
Source