SlackwareThis Forum is for the discussion of Slackware Linux.
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.
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.
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
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:
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)
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.
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.
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.