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.
|
|
01-16-2009, 09:48 AM
|
#1
|
Member
Registered: Apr 2005
Location: Scottsdale, AZ USA
Distribution: Most of them :-)
Posts: 37
Rep:
|
Using 'mail' in a script to send mail on an alternate port?
Hi Folks,
I'm working on a script to help Linux desktop users mange certain aspects of their desktop systems. Part of the script sends an email to a specified recipient on certain discoveries. This script works fine if the user's system is able to communicate with the mail server on port 25, but many users are now communicating with servers over alternate ports (the server listens for mail on a port other than 25 - Apple's mac.com server, for example).
Is it possible to tell the mail or mailx tool to use an alternate port? Or, is there another built-in command line mail tool that can send mail on an alternate port (the local system might not have the mail server process configured or running)?
Thanks,
Tim
|
|
|
01-16-2009, 10:06 AM
|
#2
|
LQ Guru
Registered: Jan 2001
Posts: 24,149
|
Well, all standard SMTP or MX records will use port 25 for mail delivery. It's not up to your mail client to pick the port of the mail server on the recieving end. When you use the mail or mailx command, it's using the local machine or server on port 25 to send the email out.
If you take a closer look at mac.com, it's just an alias for these MX records or hosts handling the mail which all listen on port 25 as I was able to telnet to each:
Code:
trickykid@myserver:~$ host mac.com
mac.com has address 17.250.248.32
mac.com mail is handled by 10 smtp-mx1.mac.com.
mac.com mail is handled by 10 smtp-mx2.mac.com.
mac.com mail is handled by 10 smtp-mx3.mac.com.
mac.com mail is handled by 10 smtp-mx4.mac.com.
mac.com mail is handled by 10 smtp-mx5.mac.com.
mac.com mail is handled by 10 smtp-mx6.mac.com.
|
|
|
01-16-2009, 10:36 AM
|
#3
|
Member
Registered: Apr 2005
Location: Scottsdale, AZ USA
Distribution: Most of them :-)
Posts: 37
Original Poster
Rep:
|
I think you didn't understand what I was asking ...
Quote:
Originally Posted by trickykid
If you take a closer look at mac.com, it's just an alias for these MX records or hosts handling the mail which all listen on port 25 as I was able to telnet to each
|
I never claimed that they didn't accept port 25 connections. However, many home users are connected via ISP's that block port 25 for all the right reasons. For these, Apple and others allow connection via port 587 (or 465 as a legacy alternate). This is where I'm coming from.
More relevant ideas?
Tim
|
|
|
01-16-2009, 02:35 PM
|
#4
|
LQ Guru
Registered: Jan 2001
Posts: 24,149
|
Quote:
Originally Posted by tim914
I never claimed that they didn't accept port 25 connections. However, many home users are connected via ISP's that block port 25 for all the right reasons. For these, Apple and others allow connection via port 587 (or 465 as a legacy alternate). This is where I'm coming from.
More relevant ideas?
Tim
|
Well yeah, for good reason to not allow users to have mail servers that are potential hosts to serve up spam.
Incoming is usually blocked but not outgoing. You should rewrite your rules so you're local box just sends the email through your ISP's SMTP provided server to send emails in this type of case.
|
|
|
01-16-2009, 03:23 PM
|
#5
|
Member
Registered: Apr 2005
Location: Scottsdale, AZ USA
Distribution: Most of them :-)
Posts: 37
Original Poster
Rep:
|
I don't want to sound ungrateful, but I don't think that you understand what I'm asking.
Regardless of right or wrong (I think it's right), many smart ISP's block port 25 outbound as well as inbound to prevent users' computers that have become members of botnets from sending mail directly. It's more than just preventing the running of server services in non-business grade accounts.
Ah well, I just wrote my own tool to handle it properly and will include it with the script.
Tim
Last edited by tim914; 01-16-2009 at 03:24 PM.
Reason: Apostrophe in the wrong place
|
|
|
All times are GMT -5. The time now is 01:55 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
|
|