LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Sendmail configuration (https://www.linuxquestions.org/questions/linux-networking-3/sendmail-configuration-236403/)

AMMullan 09-28-2004 07:38 PM

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 :)

AMMullan 09-30-2004 12:18 AM

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?

akilles 09-30-2004 02:38 AM

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.

scowles 09-30-2004 08:12 AM

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.

AMMullan 09-30-2004 01:51 PM

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 :)


All times are GMT -5. The time now is 04:05 AM.