TomSW has asked for the wisdom of the Perl Monks concerning the following question:

Greetings monks

I'm using Mime::Lite to bounce an internet form and some attached files to our service centre inbox.

It's set up to use sendmail, and the problem is simply that sending to some email addresses (my own for example) works, but sending to the mail service centre address, or a hotmail address, doesn't.

I don't have any access to the server, I just send this guy in Frankfurt scripts to upload, then I find that they don't work, send another one, etc. We get on better now that i test everything with a local apache server, but it doesn't do the actual emailing bit

Can anyone give me an idea of what might be causing this? Your help much appreciated

Replies are listed 'Best First'.
Re: Mime::Lite problems sending
by trs80 (Priest) on Jan 22, 2002 at 22:18 UTC
    It could be a relay issue as another user pointed out.
    In a nutshell relaying is bad. It would allow anyone to send a message through your SMTP port. To prevent this the SMTP server is going to verify that either the 'sender' or the 'to' is a valid user (this can be more or less strict depending on your SMTP server configuration).
    So in this case when you send an email message with a "to" and "from" that are not hosted by your SMTP server it is rejected for processing.
    I could be completely wrong, but I have been bitten by this in the past.
      Aha, perhaps I should be paying a lot more attention to the From field of the message?

      at the moment it defaults to script.name@server.url

      thanks for all your help; now I'm going to pester the server administrator

Re: Mime::Lite problems sending
by BazB (Priest) on Jan 22, 2002 at 21:11 UTC

    Can you post the relevant section of your code so that we can see how you're doing things?

    Is there anything in the logs?
    Are you using strict and warnings, and if so are you getting any sort of diagnostic information?

    Is the email being generated, but is it mangled in some way?
    Have you tried dumping the resulting email structure to a file or printing it to the screen and checking it over?

    Cheers.

    BazB.

      well that's the thing, I'm using strict & warnings, and I've tested it extensively using localhost, dumping the messages to the browser instead of using $msg->send. There's absolutely no difference in the output if I play around with the addresses in this environment.

      Now that it's on the real server, I pass the email address to send to in the form, so by changing the address I can see it working (for my email address) and not working (for my hotmail address and the address I want to send to).

      The script thinks everything is hunkydory, but then, my only check is this: $msg->send   || do { $error ='unsent'; return; };

      it looks like I shall have to pester Frankfurt Dirk for the sendmail configuration, because (hubris/a yet worse sin) I'm damned if it's my script. This time.

        While it is not the problem, (but as an aside), you would be well off to consider writing that with an 'or' rather than a '||':
        $msg->send() or {...};
        The '||' operator binds pretty tightly as it says in the good ol' Camel. (Though not as tightly as the 'arrow' -> operator, if I recall correctly.)
Re: Mime::Lite problems sending
by z3d (Scribe) on Jan 22, 2002 at 22:00 UTC
    Do you have any way to confirm the sendmail configuration? Almost sounds like the sendmail server is denying some of your messages as relay attempts.



    Zed? Zed's dead, baby, Zed's dead.