Setting up a MTA

Discuss Networking
agent007
administrator
administrator
Posts: 254
Joined: Wed Feb 12, 2003 11:26 pm

Setting up a MTA

Post by agent007 » Sun Mar 02, 2003 3:45 am

hi all,

I am thinking of setting up a Mail Transport Agent on my system...so as to use the SMTP service for outgoing mails. Is it possible to do this? Will I be able to send mails using my system? This is just a home system..not on a LAN
Am on a dial-up modem with a dynamic IP.


thanks,
007

TheQuirk
programmer
programmer
Posts: 114
Joined: Wed Jan 22, 2003 4:11 pm

Post by TheQuirk » Tue Mar 04, 2003 10:01 pm

Are you just trying to send emails, but send and recieve them? Either way, it's possible... But can you be more clear?

agent007
administrator
administrator
Posts: 254
Joined: Wed Feb 12, 2003 11:26 pm

Post by agent007 » Tue Mar 04, 2003 11:20 pm

Hi!

Am only trying to send mails....I have a pop account at GMX, so I will be using GMX to receive mails and want to use my system to send mails....Is it possible to do this?

thanks for ur help,
007

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Wed Mar 05, 2003 7:12 am

That's what Sendmail does. Sendmail comes with every Linux distro. I use Sendmail on every single UNIX/Linux machine I manage for sending mail and manage several incoming mail servers (pop/imap/etc) also using Sendmail.

TheQuirk
programmer
programmer
Posts: 114
Joined: Wed Jan 22, 2003 4:11 pm

Post by TheQuirk » Wed Mar 05, 2003 6:59 pm

Void Main wrote:That's what Sendmail does. Sendmail comes with every Linux distro. I use Sendmail on every single UNIX/Linux machine I manage for sending mail and manage several incoming mail servers (pop/imap/etc) also using Sendmail.
What void said. You should check if you have it:

rpm -qa|grep sendmail

If you do, try the "mail" program and see if it works.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Wed Mar 05, 2003 8:49 pm

If you are using Red Hat 8.0 you will want to change the default configuration to get it to work properly. I can give you some pointers.

User avatar
Calum
guru
guru
Posts: 1349
Joined: Fri Jan 10, 2003 11:32 am
Location: Bonny Scotland
Contact:

Post by Calum » Thu Mar 06, 2003 9:46 am

i too am interested in this, but it's way over my head (i think i have a mental block when it comes to anything network related)

i'll be interested in any information this thread throws light on.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Thu Mar 06, 2003 10:31 am

Ok, if you have Red Hat 8.0 what I usually do is first make sure I have the "sendmail", "sendmail-cf" and "m4" packages installed:

$ rpm -qa | egrep "sendmail|m4"

Then I modify my /etc/mail/sendmail.mc file. You can use mine as a template if you wish. You can make a backup copy of your /etc/mail/sendmail.mc and then "wget" mine in it's place. Edit it and change "voidmain.is-a-geek.net" to whatever your hostname is (keep the trailing "." on the entries that have them). It must be a valid host/domain name or many mail servers will reject your messages. It doesn't necessarily have to be "your" host/domain name (shhhh). Use your provider's domain name if you don't have your own.

If you want to also be able to receive mail (SMTP) then you'll need to comment out the line with "127.0.0.1" in it. Just place the letters "dnl " at the beginning of that line.

Now you'll need to build the configuration file for sendmail based on this template:

# m4 < /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

Now restart sendmail, or if you don't have it set to start up automatically do this:

# chkconfig sendmail on
# service sendmail start

to restart it:

# service sendmail restart

That's pretty much it. Now if you want to send a test message you can easily do this right from the command line:

$ echo "This is a test" | mail somebody@somewhere.com

One word of caution if you do comment out the "127.0.0.1" line to accept incoming mail, you need to make sure you upgrade Sendmail with the update on the Red Hat 8.0 errata page. Within the last few days a nasty security hole has been discovered that effects all versions of Sendmail on all platforms. Luckily it hasn't been exploited yet and it's still unclear as to how exploitable the hole really is. Still, better safe than sorry.

Have fun!

agent007
administrator
administrator
Posts: 254
Joined: Wed Feb 12, 2003 11:26 pm

Post by agent007 » Tue Apr 08, 2003 10:29 pm

VoidMain,

I'm on a dial-up, so I will be using sendmail to send mails NOT to receive. Am using Evolution as the e-mail client. What should be the SMTP settings? and will the mails be relayed directly or will there be some kind of authentication involved? If yes, what will be the username and password?


Were u referring to POP or SMTP? Since receiving mails is POP...
If you want to also be able to receive mail (SMTP) then you'll need to comment out the line with "127.0.0.1" in it. Just place the letters "dnl " at the beginning of that line.

thanks & rgds,
007

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Tue Apr 08, 2003 10:36 pm

When I said "receive mail" I am referring to your server's point of view. Your server receives mail on port 25 (SMTP). You are thinking from a client perspective. If you are coming from the Windows world you are not used to having an MTA right on the same machine you are typing a message on. You don't need to send your mail to an SMTP server if you have your own MTA that can deliver the message directly.

But it wouldn't make much sense to configure sendmail on your server to receive mail since your server is behind a dialup connection. No problem with configuring it to send mail and for that just do it exactly as I mention earlier in this thread using my example sendmail.mc. You'll have to have another server on the Internet receive your mail. You will fetch that mail via pop/imap/fetchmail but that's a function for your mail client, not your mail server/MTA. In fact being on a dialup connection I wouldn't mess with configuring sendmail at all. I would just use a regular mail client (like Evolution), configured much like you would configure any Windows mail client. But that's me.

agent007
administrator
administrator
Posts: 254
Joined: Wed Feb 12, 2003 11:26 pm

Post by agent007 » Tue Apr 08, 2003 11:23 pm

Since I'm using Evolution as the e-mail client what address should I give in the SMTP setting? (to send mails) Is it 127.0.0.1?

thanks,
007

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Wed Apr 09, 2003 12:03 am

You don't use an address if you want to use sendmail on your local system to send your mail. You would configure Evolution's "Sending Mail" tab to use "Sendmail" rather than "SMTP" and it will send your messages by executing your local sendmail program. Very similar to just typing:

$ echo "Test Message" | /usr/sbin/sendmail -s "Test Subject" somebody@somewhere.com

Again, you have to have sendmail configured as I describe earlier in the thread with my example sendmail.mc configuration file. But like I also said, I wouldn't use sendmail on a dialup machine. I would configure Evolution to use your normal SMTP server. In fact that's what I do here at home, and I have direct cable connection. I have a mail server out on the net that I use for my business and many clients. It is configured as a pop3(s)/imap(s)/smtp server and I configure my mail client to use it for both imaps and smtp. The voidmain web server here at my house is configured to send mail out, but only for the forum to send messages out. Actually all of my machines are configured to send mail out but I only use it for notification messages (e.g. cron job updates system and emails results to my main email address automatically, etc).

agent007
administrator
administrator
Posts: 254
Joined: Wed Feb 12, 2003 11:26 pm

Post by agent007 » Wed Apr 09, 2003 1:58 am

hmmm....Thing is if sendmail is selected in Evolution, and if I send the message when the sysyem is offline, the mail directly goes to the sent items folder.... and not in the Outbox..Now, isin't that kinda stupid?

007

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Wed Apr 09, 2003 2:15 am

agent007 wrote:hmmm....Thing is if sendmail is selected in Evolution, and if I send the message when the sysyem is offline, the mail directly goes to the sent items folder.... and not in the Outbox..Now, isin't that kinda stupid?

007
It's not really stupid at all. It would have left your Evolution mailer and placed into the queue of Sendmail. I'll bet if you type "mailq" as root you'll see it in your queue. As far as Evolution is concerned the message has been delivered and it's no longer the responsibility of Evolution. It's really no different than what happens when you have your mail client configured to use SMTP to deliver to an SMTP server. That SMTP server is also likely running Sendmail and your message gets entered in it's queue. As far as you know it's delivered but it's not really delivered until that SMTP server passes it on to the destination mail server.

Not being attached directly to the Internet you would eventually get a bounce message from sendmail if it can't deliver it after a specified amount of time. In fact it should bounce it back fairly quickly for host lookup failure. Using an SMTP server on the Internet wouldn't have that problem becuase it's connected 24x7. That's exactly why I said I would not use Sendmail locally to send mail from Evolution if you are on a dialup.

agent007
administrator
administrator
Posts: 254
Joined: Wed Feb 12, 2003 11:26 pm

Post by agent007 » Wed Apr 09, 2003 10:25 pm

I have no idea what whent wrong....Have sent a dozen mails from evolution and none of them have appeared in mailq...This is the output of mailq
/var/spool/mqueue is empty
Total requests: 0
Now what VoidMain? Have followed ur steps to the dot. I'm even using ur template. I wanna get this working!

rgds,
007

Post Reply