LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-28-2004, 08:38 PM   #1
AMMullan
Member
 
Registered: Sep 2003
Location: United Kingdom
Distribution: Ubuntu, Arch
Posts: 438

Rep: Reputation: 30
Sendmail configuration


Hey all

I'm trying to setup my web server to send mail via sendmail. I've changed my /etc/mail/sendmail.cf DS to my ISP's SMTP server but whenever I try to send an email to an external email account I get a returned email saying "Domain of sender address root[at]localhost.localdomain does not exist" - I've also changed my C{w} to my ISP address (IP.orcon.net.nz)...

Can anyone tell me what the easiest way to setup sendmail to send mail via a SMTP server is? Adn no I don't really want to use QMail (I know it's good but Sendmail comes with Linux distros and I really don't have the time at the moment to configure QMail)...

Thanks all
 
Old 09-30-2004, 01:18 AM   #2
AMMullan
Member
 
Registered: Sep 2003
Location: United Kingdom
Distribution: Ubuntu, Arch
Posts: 438

Original Poster
Rep: Reputation: 30
Got it fixed - Just had to change the localhost.localdomain in /etc/hosts to a valid dns entry (skorpion.orcon.net.nz)....

So mail works perfectly now But I need to figure out how to do masquerading or set the reply to field in all outgoing emails (ammullan@skorpion.orcon.net.nz isn't a valid email account so it'll just bounce if anyone tries to reply to emails sent from the PC)

Can anyone give me any ideas on how to do this?
 
Old 09-30-2004, 03:38 AM   #3
akilles
Member
 
Registered: Sep 2004
Location: Vestfold, Norway
Distribution: Slackware
Posts: 139

Rep: Reputation: 15
what application are you sending mail with?
In PHP I use:

mail(TO, SUBJECT, MESSAGE, [OPTIONAL HEADER]) Like this:

mail("geir@linuxboxonline.net", "Test subject", "This is a test mail",
"From: web@linuxboxonline.net\n" .
"Reply-To: web@linuxboxonline.net\n" .
"X-Mailer: My own script.";

This sends a mail to me: geir@linuxboxonline.net, but instead of showing an unvalid adress, I specify with From: ...\n and Reply-To: ...\n
The server I use has Sendmail as MTA.

The way I've written this, with \n at the end and first letter is capital is important for sendmail to recognize optional header.

Hope this can help.

-Geir O.
 
Old 09-30-2004, 09:12 AM   #4
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
Quote:
Originally posted by AMMullan
Got it fixed - Just had to change the localhost.localdomain in /etc/hosts to a valid dns entry (skorpion.orcon.net.nz)....

So mail works perfectly now But I need to figure out how to do masquerading or set the reply to field in all outgoing emails (ammullan@skorpion.orcon.net.nz isn't a valid email account so it'll just bounce if anyone tries to reply to emails sent from the PC)

Can anyone give me any ideas on how to do this?
Since you are using Fedora, take a look at /etc/mail/sendmail.mc. Down near the bottom of this file is a section for masquerading. You'll probaly want to enable "masquerade envelope" as well. Especially if your systems domain name is different than the domain name you want to use in your e-mail

Note: Setting the masq features in sendmail.mc are global in scope and apply to all e-mails. If you want sendmail to perform sender address re-writing per user, enable the genericstable feature. I can post examples if needed.
 
Old 09-30-2004, 02:51 PM   #5
AMMullan
Member
 
Registered: Sep 2003
Location: United Kingdom
Distribution: Ubuntu, Arch
Posts: 438

Original Poster
Rep: Reputation: 30
Thanks for the help guys - I've got it all sorted now, I used masquerading for my domain name which worked wonderfully... Also, I just realized that with PHP's mail function you can have specify headers which means I can send from another email address anyway (Alot easier)...

Thanks again
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sendmail Configuration - I need Help ukjairaj Linux - Networking 5 06-23-2005 01:26 PM
SendMail Configuration ChaChi Linux - Newbie 6 06-10-2004 05:00 PM
Sendmail Configuration arshad Red Hat 3 12-14-2003 01:11 AM
Sendmail configuration lapthorn Linux - Newbie 2 12-09-2003 09:13 PM
Sendmail Configuration svsalian Linux - Software 7 08-29-2003 05:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration