Jump to content

Recommended Posts

Posted

First, let me say that I'm not a big-time scripter. I can usually edit others scripts, but not major stuff.

 

I'd like to run a script called blosmail.pl to post blog entries to a website using blosxom. I don't need anything more robust than this. blosmail can be found here - http://www.pipetree.com/testwiki/Blosmail

 

I've set up an email filter that pipes all messages sent to <blogname>@<domain.com> to /home/user/public_html/scgi-bin/blosmail.pl (this is set to chmod 755).

 

The blosmail.pl is set to send these entries to /home/user/public_html/<blogname>

 

It's not working and I cannot see the script run to see why. How do you debug this without a shell to see what's happening?

 

The email filtering test shows that the email was piped, but after that I don't know what happens.

Posted

Ok, here is some more info... It appears to be working now... the posts are created.

 

However, when I send this from an external mail client (not the test window), I get a returned mail. There is this error:

 

 

Use of uninitialized value in regexp compilation at /home/user/public_html/scgi-bin/blosmail.pl line 48, <STDIN> line 1.

Use of uninitialized value in regexp compilation at /home/user/public_html/scgi-bin/blosmail.pl line 48, <STDIN> line 1.

Use of uninitialized value in regexp compilation at /home/user/public_html/scgi-bin/blosmail.pl line 48, <STDIN> line 1.

Use of uninitialized value in regexp compilation at /home/user/public_html/scgi-bin/blosmail.pl line 48, <STDIN> line 1.

 

 

Line 48 is the 'die' line for invalid senders.

 

46> # Check it's from a valid email address

47> my ($from) = $headers =~ /^From:\s.*?<([^>]+)>.*?$/m;

48> die "Entry from invalid email address" unless grep(/$from/, @validEmail);

Posted

Did you setup a list of valid email addresses that can post?

 

1.2.2 Set up the valid email addresses

 

Create a file in your blosxom blog directory called blosmail.dat. In this file, list the email addresses that you want to allow as senders of weblog entries, one email address per line, like this:

 

>dj.adams@pobox.com 
some.other@address.com 
...

Posted

Yes.

 

From the mail client it formatted the From: field as:

 

FULL NAME <fullname@domain.com>

 

I tried using that in blosmail.dat as well as changing the manner in which the client sent the FROM: field.

Posted

Removing the -w for debugging stops the bounces.

 

The sender address function seems to work though. I've tried from accounts not in the list and nothing is posted.

 

So, for all intents and purposes this works now.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...