Re: ?how to generate sendmail.cf from sendmail.mx?
From: Paul Lutus (nospam_at_nosite.zzz)
Date: Mon, 04 Oct 2004 21:59:56 -0700
> Paul Lutus wrote:
>> You know, all this would be resolved in one exchange of posts, if you
>> would only state the entire problem at once.
> Okay, well I will try to provide exactly the relevant information.
> I can now send and receive emails through my DSL line using Mozilla. I
> want to also be able to send emails using the BSD mail program. I am
> using an FC2 installation and basically haven't done anything other than
> tell Mozilla the names of the ISP's incoming and outgoing mail servers.
> Emails I send out using BSD mail get bounced back to me by my ISP's
> outgoing server, with a message like:
> ----- The following addresses had permanent fatal errors -----
> (reason: 554 <firstname.lastname@example.org>: Sender address rejected:
> Domain not found. See http://postmaster.myISP.net)
> Looking at that url, it seems the above message is explained by:
>> # Improperly formatted or unknown envelope sender email addresses will be
>> # blocked.
> BSD mail or something it calls is finding my Linux hostname and username
> and constructing a return address (namely email@example.com), but
> it would seem the return address should be myISPlogin@myISP.net.
There is the problem. When you post an e-mail through Mozilla, you enter
your login name and account at your ISP, and the outgoing mail is routed
through your ISP's mail service because you are logging into their mail
server, not your own. IOW Mozilla is acting as a mail client, not a mail
When you try to use BSD mail, everything is different. Your computer's
sendmail service is accessed instead, which means there are limitations as
to how you are identified and what domain name is used. Since your system
has a defualt hostname, the domain part of the e-mail address is
myhost.localdomain, while the user part is "root", which happens to be who
you are logged on as. BTW that is a bad idea, log in as a normal user.
But this certainly will not work as you seem to expect, because the local
mail server will try to forward the mail to your ISP, which will reject it
either as an unauthorized relay, or because there is no Internet domain
"myhost.localdomain". Apparently the latter happened.
> So it
> looks like I have to edit a config file (maybe .mailrc?) somewhere to
> cause BSD mail to use the correct return address, just as Mozilla uses
> the correct return address.
No, as a matter of fact, you may not be able to use BSD mail in this way.
BSD mail is meant to handle local e-mail, it is not meant to be used as a
client for your ISP's mail account, as Mozilla is.
On the other hand, if your purpose is to automate the sending of e-mails
from scripts and programs, you can always construct a text file with an
appropriate header and send it using:
$ cat messagefile.txt | sendmail -t
The messagefile.txt should look more or less like this:
If you have set up things reasonably well, sendmail will pick up any "from"
and "to" fields you want to create, and forward the mail thorugh the
system. But you will still have the problem of mails being rejected as
unauthorized relays by your ISP.
So this leads me to ask -- why are you doing this?
-- Paul Lutus http://www.arachnoid.com