I'm trying some sort of auto-subscription via a homegrown script. I know it can be achieved by mailing lists such as Mailman but I also want to learn at the same time on how to do it by hand.
Here's the simple script:
#!/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 attached the above script in /etc/aliases using the syntax:
subscribe: | /home/icasimpan/parse-subscribe.pl
and run
$ sudo newaliases
It's still a very bare script. Just testing out if I my syntax in /etc/aliases is correct.
But when I tried emailing [email protected], it returns something like:
Delivery failure 69
I'm using Lotus Notes so my google search directed me to this link. Apparently, something to do with the file...Not sure.
The command is executable, in fact I tried making it 777 and even created the mail_received.txt in the directory just to ensure I have no file permission problem but still the same.