LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-16-2005, 04:02 PM   #1
datadriven
Member
 
Registered: Jun 2003
Location: Holly Hill, Florida
Distribution: Slackware 10.1
Posts: 317

Rep: Reputation: 30
Sendmail & ISP


I'm trying to get sendmail set up to send mail through my ISP's smtp server. My ISP blocks port 25 so I'm trying to connect on port 1025, which works w/ kmail. I've been searching google & I think I'm almost there but I'm a little bit stuck. Here's what I have so far.

sendmail.mc
Code:
dnl# This is the default sendmail .mc file for Slackware.  To generate
dnl# the sendmail.cf file from this (perhaps after making some changes),
dnl# use the m4 files in /usr/share/sendmail/cf like this:
dnl#
dnl# cp sendmail-slackware.mc /usr/share/sendmail/cf/config.mc
dnl# cd /usr/share/sendmail/cf
dnl# sh Build config.cf
dnl#
dnl# You may then install the resulting .cf file:
dnl# cp config.cf /etc/mail/sendmail.cf
dnl#
include(`../m4/cf.m4')
VERSIONID(`default setup for Slackware Linux')dnl
OSTYPE(`linux')dnl
dnl# These settings help protect against people verifying email addresses
dnl# at your site in order to send you email that you probably don't want:
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
dnl# Uncomment the line below to send outgoing mail through an external server:
dnl define(`SMART_HOST',`mailserver.example.com')
dnl# No timeout for ident:
define(`confTO_IDENT', `0')dnl
dnl# Enable the line below to use smrsh to restrict what sendmail can run:
dnl FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
dnl# See the README in /usr/share/sendmail/cf for a ton of information on
dnl# how these options work:
FEATURE(`use_cw_file')dnl
FEATURE(`use_ct_file')dnl
FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl
FEATURE(`access_db', `hash -T<TMPF> /etc/mail/access')dnl
FEATURE(`blacklist_recipients')dnl
FEATURE(`local_procmail',`',`procmail -t -Y -a $h -d $u')dnl
FEATURE(`always_add_domain')dnl
FEATURE(`redirect')dnl
define(`SMART_HOST',`smtp.myisp.com)dnl
define(`RELAY_MAILER_ARGS', `IPC $h 1025')dnl
define(`confAUTH_MECHANISMS', `DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
FEATURE(`authinfo',`hash /etc/mail/authinfo.db')dnl
dnl# Turn this feature on if you don't always have DNS, or enjoy junk mail:
dnl FEATURE(`accept_unresolvable_domains')dnl
EXPOSED_USER(`root')dnl
dnl# Also accept mail for localhost.localdomain:
LOCAL_DOMAIN(`localhost.localdomain')dnl
MAILER(local)dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
/etc/mail/authinfo
Code:
AuthInfo:smtp.myisp.com "U:username" "P:password" "M:PLAIN"
My mail gets bounced by my ISP, but at least I'm connecting to it, I think.
 
Old 05-16-2005, 04:24 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
It looks like you have a syntax error:
define(`SMART_HOST',`smtp.myisp.com)dnl

Should be:
define(`SMART_HOST',`smtp.myisp.com')dnl
 
Old 05-16-2005, 04:50 PM   #3
datadriven
Member
 
Registered: Jun 2003
Location: Holly Hill, Florida
Distribution: Slackware 10.1
Posts: 317

Original Poster
Rep: Reputation: 30
I edited out my actual smtp server because I didn't want to post it in a forum. I have the closing '

m4 will successfully work on my file.
 
Old 05-16-2005, 04:56 PM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
What bounce message do you get?
 
Old 05-16-2005, 06:57 PM   #5
michaelsanford
Member
 
Registered: Feb 2005
Location: Ottawa/Montréal
Distribution: Slackware + Darwin (MacOS X)
Posts: 468

Rep: Reputation: 30
You seem to know your stuff, I just want to understand you correctly: you want to be able to send mail from your machine only, or you want to set up your own SMTP server so you (or others) can use you as a mail mover?

Also, I've heard that you may need to add another line, this is what mine looks like:
Code:
AuthInfo:fake-mailer.isp.ca "U:username" "P:word" "M:LOGIN"
AuthInfo: "U:username" "P:word" "M:LOGIN"
And knowing the bounce message would be nice.
 
Old 05-16-2005, 07:40 PM   #6
datadriven
Member
 
Registered: Jun 2003
Location: Holly Hill, Florida
Distribution: Slackware 10.1
Posts: 317

Original Poster
Rep: Reputation: 30
Here's the headers from my returned message.


Code:
From MAILER-DAEMON@localhost.localdomain  Mon May 16 12:40:16 2005
Return-Path: <MAILER-DAEMON@localhost.localdomain>
Date: Mon, 16 May 2005 12:40:16 -0400
From: Mail Delivery Subsystem <MAILER-DAEMON@localhost.localdomain>
To: <jeff@localhost.localdomain>
Content-Type: multipart/report; report-type=delivery-status;
        boundary="j4GGeGHJ013159.1116261616/localhost.localdomain"
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)
Status: RO

Part 1:

The original message was received at Mon, 16 May 2005 12:40:14 -0400
from localhost [127.0.0.1]

   ----- The following addresses had permanent fatal errors -----
<data_driven_design@yahoo.com>
    (reason: 550 5.7.1 <data_driven_design@yahoo.com>... Relaying denied. IP name possibly forged [64.193.10.254])

   ----- Transcript of session follows -----
... while talking to mail.jeffrossi.clearwire.net.:
>>> DATA
<<< 550 5.7.1 <data_driven_design@yahoo.com>... Relaying denied. IP name possibly forged [64.193.10.254]
550 5.1.1 <data_driven_design@yahoo.com>... User unknown
<<< 503 5.0.0 Need RCPT (recipient)
 
Old 05-16-2005, 07:44 PM   #7
datadriven
Member
 
Registered: Jun 2003
Location: Holly Hill, Florida
Distribution: Slackware 10.1
Posts: 317

Original Poster
Rep: Reputation: 30
I write PHP code for a living. Since I switched ISPs the mail() function doesn't work, so testing scripts locally can be counter productive. It would also be nice if my rkhunter cron script could actually send me it's results.
 
Old 05-16-2005, 08:03 PM   #8
datadriven
Member
 
Registered: Jun 2003
Location: Holly Hill, Florida
Distribution: Slackware 10.1
Posts: 317

Original Poster
Rep: Reputation: 30
This might be something also

Code:
# /etc/rc.d/rc.sendmail restart
Starting sendmail MTA daemon:  /usr/sbin/sendmail -L sm-mta -bd -q25m
Mrelay: Warning: first argument in [IPC] mailer must be TCP or FILE
Starting sendmail MSP queue runner:  /usr/sbin/sendmail -L sm-msp-queue -Ac -q25m
 
Old 05-16-2005, 08:26 PM   #9
michaelsanford
Member
 
Registered: Feb 2005
Location: Ottawa/Montréal
Distribution: Slackware + Darwin (MacOS X)
Posts: 468

Rep: Reputation: 30
datadriven, I can relate as I'm in exactly the same situation (that's the only reason I have sendmail on my machine).

You are indeed connecting and moving mail from your machine.

I think your ISP believes that your mail is forged because your mail is being sent from "root@localhost.localdomain" which is not a real email address (since it doesn't point to a real FQDN).

What you should also check is the sendmail invocation line in /etc/apache/php.ini, I had to change mine to a real email address for it to work with my mailer, like so:
Code:
; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = /usr/sbin/sendmail -t -i -f spam_me_please@michaelsanford.com
Note the -f flag with a real address (which I've changed for the post obviously). For a closed system I'd suggest using your ISP-provided email address.

I'm pretty sure that if you invoke mail() with a From: header it will override the one in php.ini

Also, I don't know why your ISP would block outgoing port 25--that way you'd never connect to any SMTP server. Usually ISPs only block incoming 25 to prevent you acting as a relay agent. If all you're doing is sending mail from localhost then you aren't ever really connecting to your localhost SMTP server as PHP's mail() is just a glorified exec() wrapper.

PS I have no idea about yout "Mrelay: Warning: first argument in [IPC] mailer must be TCP or FILE" problem.

Last edited by michaelsanford; 05-16-2005 at 08:28 PM.
 
Old 05-16-2005, 08:40 PM   #10
killerbob
Member
 
Registered: Oct 2004
Location: Ottawa, ON
Distribution: Slackware
Posts: 662

Rep: Reputation: 31
Why not just use Sendmail for outgoing mail and have it relay directly? That's what I'm doing on my mail server (I'm also acting as primary MX for my domain; spammers can go to hell), and it works fine. With a broadband connection to the internet, you really aren't going to notice any speed increases or differences between relaying the mail directly, and sending it through your ISP, and it could save you an enormous headache.
 
Old 05-16-2005, 11:10 PM   #11
michaelsanford
Member
 
Registered: Feb 2005
Location: Ottawa/Montréal
Distribution: Slackware + Darwin (MacOS X)
Posts: 468

Rep: Reputation: 30
I think that's what he's doing...using it only for the mail() function in PHP to test scripts moving mail just to the ISP's mailer.
 
Old 05-17-2005, 07:51 AM   #12
datadriven
Member
 
Registered: Jun 2003
Location: Holly Hill, Florida
Distribution: Slackware 10.1
Posts: 317

Original Poster
Rep: Reputation: 30
After numerous tweaks and adjustment I got it working and sendmail connects to my ISP on port 1025

sendmail.mc
Code:
dnl# This is the default sendmail .mc file for Slackware.  To generate
dnl# the sendmail.cf file from this (perhaps after making some changes),
dnl# use the m4 files in /usr/share/sendmail/cf like this:
dnl#
dnl# cp sendmail-slackware.mc /usr/share/sendmail/cf/config.mc
dnl# cd /usr/share/sendmail/cf
dnl# sh Build config.cf
dnl#
dnl# You may then install the resulting .cf file:
dnl# cp config.cf /etc/mail/sendmail.cf
dnl#
include(`../m4/cf.m4')
VERSIONID(`default setup for Slackware Linux')dnl
OSTYPE(`linux')dnl
dnl# These settings help protect against people verifying email addresses
dnl# at your site in order to send you email that you probably don't want:
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
dnl# Uncomment the line below to send outgoing mail through an external server:
dnl define(`SMART_HOST',`mailserver.example.com')
dnl# No timeout for ident:
define(`confTO_IDENT', `0')dnl
dnl# Enable the line below to use smrsh to restrict what sendmail can run:
dnl FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
dnl# See the README in /usr/share/sendmail/cf for a ton of information on
dnl# how these options work:
FEATURE(`use_cw_file')dnl
FEATURE(`use_ct_file')dnl
FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl
FEATURE(`access_db', `hash -T<TMPF> /etc/mail/access')dnl
FEATURE(`blacklist_recipients')dnl
FEATURE(`local_procmail',`',`procmail -t -Y -a $h -d $u')dnl
FEATURE(`always_add_domain')dnl
FEATURE(`redirect')dnl
define(`SMART_HOST',`smtp.phonymailer.com')dnl
define(`RELAY_MAILER_ARGS', `TCP $h 1025')dnl
dnl# DAEMON_OPTIONS(`Port=1025,Addr=127.0.0.1, Name=MTA')dnl
dnl# define(`confAUTH_MECHANISMS', `LOGIN PLAIN')dnl
FEATURE(`authinfo',`hash /etc/mail/authinfo.db')dnl
dnl# Turn this feature on if you don't always have DNS, or enjoy junk mail:
dnl FEATURE(`accept_unresolvable_domains')dnl
EXPOSED_USER(`root')dnl
dnl# Also accept mail for localhost.localdomain:
LOCAL_DOMAIN(`localhost.localdomain')dnl
MASQUERADE_AS(datadrivendesign.com)
MASQUERADE_DOMAIN(localdomain)
FEATURE(masquerade_envelope)
FEATURE(masquerade_entire_domain)
MAILER(local)dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
authinfo
Code:
AuthInfo:smtp.phonymailer.com "U:username" "P:password" "M:LOGIN"
AuthInfo: "U:username" "P:password" "M:LOGIN"
My username & password & smtp server have been changed to protect the not so innocent.
 
  


Reply



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 and ISP SMTP Devyn Linux - Software 2 06-29-2005 08:21 PM
Sendmail Relay to ISP Question darkhonor Linux - Networking 1 03-11-2005 02:28 PM
Using sendmail to send mail from your ISP nrmx Linux - Software 2 12-16-2004 12:43 PM
sendmail and isp smart host adafos Linux - Networking 3 09-22-2004 08:41 AM
Sendmail Can't Send Mail To My Isp Account paperdiesel Linux - Software 5 04-14-2004 11:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:10 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