Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
06-06-2006, 10:43 AM
|
#1
|
Member
Registered: Jun 2003
Distribution: Fedora Core 5
Posts: 100
Rep:
|
how to send emails through ISP's smtp server
Hi. I've an fc5 box at home. I'd like to be able to send emails to the internet (outside home network) with something simple like this
cat /etc/hosts | mail foo@bar.com
my ISP's smtp host requires authentication. Any idea how to get the fc5 machine to automatically send all emails to the ISP's smtp & authenticate in the process?
TIA!!!
|
|
|
06-06-2006, 11:55 AM
|
#2
|
Senior Member
Registered: Jan 2005
Distribution: Slackware, BackTrack, Windows XP
Posts: 1,020
Rep:
|
Quote:
Originally Posted by coontie
Hi. I've an fc5 box at home. I'd like to be able to send emails to the internet (outside home network) with something simple like this
cat /etc/hosts | mail foo@bar.com
my ISP's smtp host requires authentication. Any idea how to get the fc5 machine to automatically send all emails to the ISP's smtp & authenticate in the process?
TIA!!!
|
tough job man.
now a days most of the admins don't allow mail relaying.
otherwise you could have easily "telnet" into the ISP port number 25 SMTP port and send mails from any fake id to any genuine mail id.
Some government servers still allow them . Search them on your own risk.
regards
|
|
|
06-06-2006, 12:08 PM
|
#3
|
Senior Member
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
|
You want to configure your FC5 sendmail to send all mail to the ISP, which you can do in /etc/mail/sendmail.mc with (for example):
define(`SMART_HOST',`mail.optonline.net')dnl
MASQUERADE_AS(`optonline.net')dnl
FEATURE(masquerade_envelope)dnl
You need to have your sendmail authenticate, so also add:
FEATURE(`authinfo')dnl
In /etc/mail/authinfo:
Authinfo:mail.optonline.net "U:<username>" "I:<identity>" "P:<password>" "M:LOGIN PLAIN"
Rebuild the sendmail.cf:
make -C /etc/mail
Restart sendmail:
service sendmail restart
Last edited by macemoneta; 06-06-2006 at 12:10 PM.
|
|
|
06-06-2006, 12:24 PM
|
#4
|
Member
Registered: Jun 2003
Distribution: Fedora Core 5
Posts: 100
Original Poster
Rep:
|
Thank you.
I followed your instructions (had to adjust hosts.allow also but nevermind that).
I see this in the maillog:
Quote:
Jun 6 13:21:03 fedora sendmail[5882]: k56HL368005882: from=root, size=217, class=0, nrcpts=1, msgid=<200606061721.k56HL368005882@localhost.localdomain>, relay=root@localhost
Jun 6 13:21:03 fedora sendmail[5883]: k56HL3T9005883: from=<root@localhost.localdomain>, size=516, class=0, nrcpts=1, msgid=<200606061721.k56HL368005882@localhost.localdomain>, proto=ESMTP, daemon=MTA, relay=fedora [127.0.0.1]
Jun 6 13:21:03 fedora sendmail[5882]: k56HL368005882: to=logastellus@yahoo.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30217, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (k56HL3T9005883 Message accepted for delivery)
|
But the email never arrives.
mailq shows an empty queue.
|
|
|
06-06-2006, 12:30 PM
|
#5
|
Senior Member
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
|
Never must be a relative term; I've seen emails take an hour to go between ISPs. If you receive a successful 'sent', then the mail was accepted by your ISP. That's all you can do with email. Delivery is now up to the intermediate systems.
|
|
|
06-06-2006, 12:45 PM
|
#6
|
Member
Registered: Jun 2003
Distribution: Fedora Core 5
Posts: 100
Original Poster
Rep:
|
Quote:
Originally Posted by macemoneta
Never must be a relative term; I've seen emails take an hour to go between ISPs. If you receive a successful 'sent', then the mail was accepted by your ISP. That's all you can do with email. Delivery is now up to the intermediate systems.
|
You are right!
I just changed the msg from yahoo to gmail and it arrived fine!
Still waiting for hotmail & yahoo.. I can't believe they've such terrible mail servers.. Gmail rules!
|
|
|
06-06-2006, 12:55 PM
|
#7
|
Member
Registered: Jun 2003
Distribution: Fedora Core 5
Posts: 100
Original Poster
Rep:
|
The only problem is that the emails arrive like this:
<root@localhost.localdomain>
I want them to look like they came from my official ISP email. I have this:
[root@fedora ~]# cat /etc/mail/userdb
root@fedora susanb@rr.com
[root@fedora ~]#
but that doesn't seem to be doing anything. What am I missing?
|
|
|
06-06-2006, 03:24 PM
|
#8
|
Senior Member
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
|
In /etc/mail/sendmail.mc add:
MASQUERADE_DOMAIN(`rr.com')dnl
FEATURE(masquerade_entire_domain)dnl
Rerun the make and restart of sendmail.
Now all your emails look like they come from "user@rr.com".
If you are sending email as root, and want it to appear to come from another userid (for example, "susanb") with the mail command, you need to su to that user:
/bin/su - susanb -c "/bin/mail -s \"Some Subject\" destination-user@destination-domain.com" < somefile
Last edited by macemoneta; 06-06-2006 at 04:20 PM.
|
|
|
06-06-2006, 04:07 PM
|
#9
|
Member
Registered: Jun 2003
Distribution: Fedora Core 5
Posts: 100
Original Poster
Rep:
|
Quote:
Originally Posted by macemoneta
In /etc/mail/sendmail.mc add:
MASQUERADE_DOMAIN(rr.com)dnl
FEATURE(masquerade_entire_domain)dnl
Rerun the make and restart of sendmail.
Now all your emails look like they come from "user@rr.com".
If you are sending email as root, and want it to appear to come from another userid (for example, "susanb") with the mail command, you need to su to that user:
/bin/su - susanb -c "/bin/mail -s \"Some Subject\" destination-user@destination-domain.com" < somefile
|
OK, I'll try this when I get home. BTW, do I still need to keep userdb file or no?
the amazing thing is that I was playing around with this and I rolled back all the changes I made, with authinfo & stuff, returning sendmail to its pristine state and guess what -- everything still worked! I was such an idiot, I didn't have to do anything. Apparently, FC5's sendmail just works right outta the box...
|
|
|
06-06-2006, 04:14 PM
|
#10
|
Member
Registered: Jun 2003
Distribution: Fedora Core 5
Posts: 100
Original Poster
Rep:
|
Quote:
Originally Posted by macemoneta
In /etc/mail/sendmail.mc add:
MASQUERADE_DOMAIN(rr.com)dnl
FEATURE(masquerade_entire_domain)dnl
Rerun the make and restart of sendmail.
Now all your emails look like they come from "user@rr.com".
If you are sending email as root, and want it to appear to come from another userid (for example, "susanb") with the mail command, you need to su to that user:
/bin/su - susanb -c "/bin/mail -s \"Some Subject\" destination-user@destination-domain.com" < somefile
|
Just tried your suggestion, didn't do anything. Emails still arrive from localhost.localdomain
Jun 6 17:10:12 fedora sendmail[7533]: k56LABsg007531: to=<XXXXX@gmail.com>, ctladdr=<root@localhost.localdomain> (0/0), delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=120508, relay=gmail-smtp-in.l.google.com. [66.249.83.114], dsn=2.0.0, stat=Sent (OK 1149628305 i16si93078wxd)
[root@fedora ~]#
so... what can I do to troubleshoot this?
[root@fedora mail]# egrep "MASQ|domain" sendmail.mc
MASQUERADE_DOMAIN(rr.com)dnl
FEATURE(masquerade_entire_domain)dnl
FEATURE(always_add_domain)dnl
|
|
|
06-06-2006, 04:19 PM
|
#11
|
Senior Member
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
|
I think that's my bad; forgot the quoting:
MASQUERADE_DOMAIN(`rr.com')dnl
You shouldn't need the userdb.
|
|
|
06-06-2006, 07:04 PM
|
#12
|
Member
Registered: Jun 2003
Distribution: Fedora Core 5
Posts: 100
Original Poster
Rep:
|
Quote:
Originally Posted by macemoneta
I think that's my bad; forgot the quoting:
MASQUERADE_DOMAIN(`rr.com')dnl
You shouldn't need the userdb.
|
no good. m4 the file, restart:
[root@fedora ~]# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
[root@fedora ~]# service sendmail restart
Shutting down sendmail: [ OK ]
Shutting down sm-client: [ OK ]
Starting sendmail: [ OK ]
Starting sm-client: [ OK ]
[root@fedora ~]# cat /etc/services | mail XXXXXX@gmail.com
in the file:
dnl define(`SMART_HOST',`smtp.your.provider')
MASQUERADE_DOMAIN(`rr.com')dnl
FEATURE(`masquerade_entire_domain')dnl
dnl #
i tried with & w/o quotes in the FEATURE section... still:
Date: Tue, 6 Jun 2006 19:59:13 -0400
From: root <root@localhost.localdomain>
Message-Id: <200606062359.k56NxDSR007811@localhost.localdomain>
To: XXXXXX@gmail.com
man.. I hate to keep bugging you but what do you think the problem is???
|
|
|
06-06-2006, 08:22 PM
|
#13
|
Senior Member
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
|
Sorry, I'm at a loss. Can you check your sendmail.mc to make sure that all references to "localhost.localdomain" are commented out? Also, verify that your sendmail.cf has been properly created. You should see entries like:
DSmail.rr.com
DMrr.com
It might be necessary to set your machine's domain name to 'rr.com' (via system-config-network) - but I don't remember having to do that.
Perhaps someone else can chime in with a suggestion?
|
|
|
06-06-2006, 08:25 PM
|
#14
|
Senior Member
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
|
I just noticed - your smart host is commented out. Instead of:
dnl define(`SMART_HOST',`smtp.your.provider')
You should have:
define(`SMART_HOST',`mail.rr.com')dnl
Note: replace 'mail.rr.com' with the SMTP server for rr.com.
|
|
|
06-07-2006, 02:20 PM
|
#15
|
LQ Guru
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195
|
WOW! This is all so complicated!
Use sendEmail. It works exactly as you want:
echo "text body" | sendEmail [options]
In the options you specify recipient, sender AND password authentication as required by your ISP.
Look for both sendEmail and sendemail package. I always forget whether there is a caps in the name or not.
jlinkels
|
|
|
All times are GMT -5. The time now is 03:52 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|