PDA

View Full Version : Problem with CPAN module MIME::Lite



web1x
07-23-2005, 09:01 PM
I'm unable to use the MIME::Lite module to send e-mail to an account on my own domain. I can send messages to domains on other servers, including domains on other WestHost 2 servers, but not my own. Here's a snippet of code I'm using:


my $msg = MIME::Lite->new(
From => $from,
To => $to,
Subject => $subj,
Type => 'TEXT',
Data => $body
);
my $send = $msg->send();

If I set $to to an address on my own domain, $send is empty and I don't receive the message. If I set $to to an address at a different domain, $send is 1 and I receive the message.

Any idea what is going on???:confused:

Thanks!

jalal
07-24-2005, 04:06 AM
Make sure the email you are sending to has a home directory. By this I mean there must be a directory for the user under /ftp/pub/

This is normally taken care of if you allow FTP access for the user when you create the email account. You can disallow FTP access after creating the account without problem.

HTH

web1x
07-24-2005, 09:28 AM
That worked! Wow! I would never have thought of that! Why does the home directory need to exist? I noticed that manually creating the directory doesn't work, you have to enable FTP through the control panel. Is there a way to make MIME::Lite send it blindly without checking for the home directory?

Thanks!

wildjokerdesign
07-24-2005, 11:59 AM
I don't think it is MIME::Lite but how things are set up with our VPS. The same thing happens with other scripts even php that do not use it if you try to send to a user that you did not first set up FTP access for. Is there a deadletter file in your root directory now when you log in?

jalal
07-24-2005, 02:12 PM
That worked! Wow! I would never have thought of that! Why does the home directory need to exist? I noticed that manually creating the directory doesn't work, you have to enable FTP through the control panel. Is there a way to make MIME::Lite send it blindly without checking for the home directory?

Thanks!

I think it is sendmail that needs the /ftp/pub/username directory to exist. If memory serves me correctly sendmail looks in /etc/passwd for the users home directory and then checks for the directory. That is also where it looks a .forward file. This is how sendmail discovers whether a user is a valid user when mail is sent internally. When it comes from outside it uses a different method I think.

web1x
07-24-2005, 02:20 PM
Originally I used an older script I had and was getting the dead.letter file. Then I realized I was using an older script. I had modified that script to use MIME::Lite for another site, which I no longer have. I then started woring with that script. I went to jalal's help site and figured out how to install MIME::Lite, but continued to have problems getting the script to work. However, this version wasn't creating the dead.letter file, just refused to send the message.

I really don't remember having to set up the FTP folder on the site I had used this script on or for that matter even having to install MIME::Lite. That site was also on a WestHost server. I really think I would have remembered, if I had this problem before.

Thanks!