|
|
| Boulware5 2003-02-18, 3:17 am |
| Randy or anyone...
I want to be able to send mail through the command line interface. Right now I send and receive through Gnome's Evolution. I also retreive mail on the CLI with fetchmail. I want to send mail to other email addresses with the "mail" command. However, emails are not reaching their destination because I need to configure sendmail a little. Is there a simple line in sendmail.cf or any related /etc/mail/ files that I can change my smtp server and I'll be able to send mail? Configuring sendmail is stuff of legends (one of my books says that. ), but there has to be somewhere a simple edit where you can put your SMTP server so to send mail to external email addresses. A few things I have tried that have not worked:
in sendmail.mc:
DAEMON_OPTIONS(`Port=smtp,Addr
=mail.abs.adelphia.net, Name=MTA')
in sendmail.cf:
# SMTP daemon options
O DaemonPortOptions=Port=smtp,Ad
dr=mail.abs.adelphia.net, Name=MTA
Then I restarted sendmail, but it didn't work. I obviously don't know sendmail configuration so I just searched for "smtp" in /etc/mail/ config files and entered my SMTP mail server. | |
| TW2001 2003-02-18, 7:14 pm |
| your outgoing smtp is working through the mail client?
looked at your relaying?
just somethings to consider.Im wrestling sendmail myself My issues are relating to the iptables config i have (i think ) | |
| Boulware5 2003-02-18, 7:26 pm |
| It works fine in evolution (GUI interface). What do you mean about relaying? | |
| Boulware5 2003-02-18, 8:32 pm |
| Now I realized some things I did wrong, but it is still not working. I shouldn't have edited the sendmail.cf file itself. Rather the sendmail.mc file. I then needed to make a new sendmail.cf file with the " m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf " command.
dnl define(`SMART_HOST',`mail.abs.adelphia.net')
is the one line I see in sendmail.mc that needs your SMTP server. Randy where are you. 
From doing some research, that line in sendmail.mc tells sendmail to relay all non-local mail messages to the server mail.abs.adelphia.net (my SMTP server) | |
| Boulware5 2003-02-20, 3:16 pm |
| Ok I've discovered someone else having this problem in Red Hat 8.0. I think it is a RH 8.0 thing. Before RH 8.0 and with other distros you could send email from the CLI without any configuration. Arghh oh well. If anyone else has Red Hat 8.0 try sending an email to someone from the command line and check to see if it reaches. ("mail" command.) | |
| masamune 2003-02-20, 4:29 pm |
| Login as root and type newaliases.
You should get a message like this:
/etc/aliases: n aliases, longest x bytes, w bytes total
(n, x and w replaced by the values for your system)
Then you should recieve all the mail that was in /var/spool/mail/username. | |
| Boulware5 2003-02-22, 4:31 pm |
| quote: Originally posted by masamune
Login as root and type newaliases.
You should get a message like this:
/etc/aliases: n aliases, longest x bytes, w bytes total
(n, x and w replaced by the values for your system)
Then you should recieve all the mail that was in /var/spool/mail/username.
What's this supposed to do? My prpblem is with sending mail through sendmail; not receiveing mail. I got fetchmail for that. | |
| masamune 2003-02-22, 5:34 pm |
| In RH8.0 the file /etc/aliases is not populated with the mail aliases for your local system, therefore can't local users get/send mail through sendmail...
The "newaliases" cmd allows you to automatically populate this file.
For external mail I'll check the config tomorrow. | |
| Boulware5 2003-02-22, 5:44 pm |
| That didn't work either. I also set up my machine to use a FQDN. I read that sendmail needs that to work properly. Well that didn't work either. I really think it's a RH8.0 thing. | |
| masamune 2003-02-22, 5:52 pm |
| Sorry to hear that.
I'll (try) to configure my RH8.0 box to send external mail through sendmail tomorrow, I had a pb sending local mail, that was solved by what I told you before.
If that works I'll post my conf file  | |
| Boulware5 2003-02-22, 5:57 pm |
| quote: Originally posted by masamune
Sorry to hear that.
I'll (try) to configure my RH8.0 box to send external mail through sendmail tomorrow, I had a pb sending local mail, that was solved by what I told you before.
If that works I'll post my conf file
Thanks.
I remember when I used slackware I didn't have to do any configuration and could send mail on the CLI. | |
|
|
|
|
| masamune 2003-02-23, 6:34 pm |
| quote: Originally posted by Boulware5
No I'm trying to send email to an outside email address. Like for example user@aol.com.
Oops, excuse me for my poorly worded sentence.
What I meant to ask was : Does local mail sending run?
Here's the line I commented out in /etc/mail/sendmail.mc:
define(`SMART_HOST',`mymx.mydomain').
This works fine because mymx is an open-relay Exchange server (lab thing, no inet connection yet), so no authentication is needed... Still looking for the way to set up user auth for external smtp using sendmail.
That's what I did:
$cp /etc/sendmail.cf /etc/sendmail.cf.old
$cp /etc/sendmail.mc /etc/sendmail.mc.old
Then edited sendmail.mc to set the SMART_HOST value.
Then $m4 /etc/sendmail.mc>/etc/sendmail.cf
restart sendmail, and finally:
$/usr/lib/sendmail -v -q (tells sendmail
to process verbosely the queue).
What does the mailq command give you?
Are you on a dial-up connection?
Does your ISP allow open-relay, or does it need authentication?
This could be helpful for debugging because it will give the reason why mail couldn't be delivered. | |
| Boulware5 2003-02-23, 6:51 pm |
| Ok...
My Line in sendmail.mc:
define(`SMART_HOST',`mail.abs.adelphia.net')
I set that to my SMTP server (I use adelphia as my cable provider). You set it to your exchange server, I rather set that to my SMTP server. Now here is some things I tried (copy and paste):
[root@furio mail]# mail -s test rlurman@adelphia.net
This is a test.
^D
[root@furio mail]# /usr/lib/sendmail -bp
/var/spool/mqueue is empty
Total requests: 0
[root@furio mail]# /usr/lib/sendmail -v rlurman@adelphia.net
asdfggasa
^D
rlurman@adelphia.net... Connecting to localhost.wmnsmd.adelphia.net. via relay...
220 furio.ircfootball.com ESMTP Sendmail 8.12.5/8.12.5; Sun, 23 Feb 2003 19:48:24 -0500
>>> EHLO furio.ircfootball.com
250-furio.ircfootball.com Hello localhost.localdomain [127.0.0.1], pleased to meet you
250 ENHANCEDSTATUSCODES
>>> MAIL From:<root@furio.ircfootball.com>
550 5.0.0 Access denied
root... Using cached ESMTP connection to localhost.wmnsmd.adelphia.net. via relay...
>>> RSET
250 2.0.0 Reset state
>>> MAIL From:<>
550 5.0.0 Access denied
postmaster... Using cached ESMTP connection to localhost.wmnsmd.adelphia.net. via relay...
>>> RSET
250 2.0.0 Reset state
>>> MAIL From:<>
550 5.0.0 Access denied
Closing connection to localhost.wmnsmd.adelphia.net.
>>> QUIT
221 2.0.0 furio.ircfootball.com closing connection
------End copy and paste -------------
Now that is interesting. My Access is denied. Do I need my username and password? If so, where the heck does that go? Ya know, I checked though sendmail.cf and there is no place for your usuername and password. | |
| masamune 2003-02-23, 6:58 pm |
| Ok that's your pb, you need to define your
username/pass somewhere...
I think it could be in the access.db file,
but I can be wrong.
I'll try to find how to fix this and will post as soon as I'll have found the answer. | |
| Boulware5 2003-02-23, 9:56 pm |
| Got this from a google search:
Now we just need to setup the /etc/mail/default-auth-info file, and tell Sendmail our SMTP username/password. This file is simple enough. It's 4 lines: username,username,password,rea
lm Mine looks like this:
username
username
password
outgoing.verizon.net
Restart Sendmail, and you should now be authenticating properly with the SMTP server! If something does not work, you need to troubleshoot Sendmail. That is beyond the scope of this article, but if the mail does not make it out, it is probably still in the queue. I usually run Sendmail manually with a verbose setting to see what's going on:
sendmail -v -q
I'll let you know if this works after I try it in a little bit.  | |
|
|
| masamune 2003-02-23, 10:18 pm |
| Hmm, I don't know if this article is really accurate... It was written for redhat 6.2.
Anyway the SASL thing is good to dig a bit further.
I think you might want to take a look there: http://sendmail.org/~ca/email/sm-812.html#812AUTH | |
| Boulware5 2003-02-23, 11:20 pm |
| Whooo!!!! It works now! And I feel stupid right about now, too. It wasn't anything to do with any sendmail configuration or authentication configs, but it was something much simpler than that. As any security conscious person does, I had a ALL:ALL entry in /etc/hosts.deny. So after I put a sendmail:ALL in /etc/hosts.allow, it finally worked. I had forgoten I tightened down the box with that. I did have, though, a localhost:ALL in hosts.allow which *I thought* would allow me to use any local tcpd service. I can probably make that sendmail:ALL into something like sendmail:hostname or something to that affect. I guess I learned a few (and I do mean a few) things about the very complicated sendmail configuration in the process.  | |
| masamune 2003-02-23, 11:28 pm |
| Glad to see it works for you
By my side I still cannot send mail to my exchange box when I activate SASL... |
|
|
|