LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-27-2006, 08:05 AM   #1
nickleus
Member
 
Registered: Nov 2004
Location: Noreg
Distribution: ubuntu
Posts: 107

Rep: Reputation: 15
how to set 'from' address in linux bsd 'mail' program


I am sending emails with linux's own mail program to my cell phone so i can read them as sms text messages and i have no problem from receiving messages from linuxA (debian sarge), but i get nothing from linuxB (red hat 9), but i know the mail program works on linuxB because i can send messages to my gmail with it.

We have our imap mail system set up on linuxA so messages sent from there have a from address that looks like this:
root@example.com

but messages sent from linuxB have a from address like this:
root@localhost.localdomain

so i'm guessing that my cell phone operator blocks messages from senders with non-real from addresses because in my /var/log/maillog i have the following line:
Quote:
Apr 27 16:12:35 localhost sendmail[7507]: k3RECZxK007505: to=<22222222@sms.netcom.no>, ctladdr=<root@localhost.localdomain> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=30377, relay=lise.netcom.no. [212.45.188.59], dsn=4.0.0, stat=Deferred: 451 <root@localhost.localdomain>... Sender domain must resolve
how do i set the from address on linuxB or how do i set up the mail system so that it uses our companies domain name in the from address? i can't remember how i did that on linuxA...

Last edited by nickleus; 04-27-2006 at 09:20 AM.
 
Old 04-27-2006, 09:57 AM   #2
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
What mail server is running on linuxB? sendmail? qmail? postfix?
Try looking into name rewriting rules.
 
Old 04-27-2006, 09:58 AM   #3
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Or make linuxB send it's mail out via linuxA's mail server, which is already correctly set up.
 
Old 04-27-2006, 10:42 AM   #4
mikeyt_333
Member
 
Registered: Jun 2001
Location: Up in the clouds
Distribution: Fedora et al.
Posts: 353

Rep: Reputation: 30
To do what timmeke is refering to in sendmail, edit this line in your sendmail.mc (don't forget to run make -C /etc/mail after editing the file, and make sure sendmail-cf is installed):

Code:
dnl define(`SMART_HOST',`smtp.your.provider')
Remove the "dnl" and change smtp.your.provider to the appropriate server. Also look into these settings:

Code:
dnl # The following example makes mail from this host and any additional
dnl # specified domains appear to be sent from mydomain.com
dnl #
dnl MASQUERADE_AS(`mydomain.com')dnl
dnl #
dnl # masquerade not just the headers, but the envelope as well
dnl #
dnl FEATURE(masquerade_envelope)dnl
dnl #
dnl # masquerade not just @mydomainalias.com, but @*.mydomainalias.com as well
dnl #
dnl FEATURE(masquerade_entire_domain)dnl
dnl #
dnl MASQUERADE_DOMAIN(localhost)dnl
dnl MASQUERADE_DOMAIN(localhost.localdomain)dnl
dnl MASQUERADE_DOMAIN(mydomainalias.com)dnl
dnl MASQUERADE_DOMAIN(mydomain.lan)dnl
Basically, these can change any sending domain coming from your system to the appropriate domain that you want.

HTH,
Mike.
 
Old 04-27-2006, 10:48 AM   #5
nickleus
Member
 
Registered: Nov 2004
Location: Noreg
Distribution: ubuntu
Posts: 107

Original Poster
Rep: Reputation: 15
hilarious! i had found some documentation regarding exactly that same file and was fiddling with some of the lines, but nothing ever seemed to help, but now i realize that "dnl" must be a comment-out command =) thanks mike (and you other guys too)!
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set up a linux mail server kccobra Linux - Software 14 12-27-2004 10:51 PM
set up mail server in linux? karupt Linux - Networking 50 10-06-2004 08:48 PM
How do I set up a program in linux for OpenGL? enigma Z Programming 7 09-05-2004 10:03 PM
Set up a dialing program on Linux myguest Linux - Networking 1 06-14-2004 12:16 PM
not Linux related...good e-mail address G011um General 9 03-15-2002 04:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:38 PM.

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