LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 02-07-2007, 01:10 PM   #16
isuck@linux
Member
 
Registered: Jun 2006
Distribution: messed up debian
Posts: 250

Rep: Reputation: 30

I don't know if I missed something here, but are you sure you don't have an iptables rule that block EST, SYn outgoing connections to port 110? Ping is an icmp packet, your problem is a Syn tcp packet. That would block a promiscuos relay. What the sendmail logs say? do you have ethereal to check what is going on with the connection? For what I see sendmail and bind are working just fine. Another thing is, do you have a mailertable or you are just sending as localhost.localdomain? maybe that host is blacklisted
 
Old 02-07-2007, 03:55 PM   #17
fukawi2
Member
 
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 449

Rep: Reputation: 34
Not nessicarily...

I had a similar problem on my mail server with qmail 2 days ago - outbound mail for remote sites not being delivered with an error about not being able to connect to the remote server.

It turned out to be iptables on the Mail Server itself not allowing the connections to/from our firewall.

The interesting part was that I could telnet a session fine, but qmail couldn't. Turned off iptables and it was all good.

I haven't managed to completely nut out completely the problem, but I solved by adding a rule to the chain to exit the chain if the source address was our firewall's internal address.

Don't discount a firewall problem just yet...
 
Old 02-08-2007, 11:26 AM   #18
JustinK101
Member
 
Registered: Jan 2007
Posts: 55

Original Poster
Rep: Reputation: 15
fukawi2,

Ok, how do I go about turning off iptables?
 
Old 02-08-2007, 11:33 AM   #19
JustinK101
Member
 
Registered: Jan 2007
Posts: 55

Original Poster
Rep: Reputation: 15
Ok I stopped the iptables service.

Code:
service iptabes stop
But no luck, still getting, Message deferred. Any othe ideas? I think that the problem may lie with the fact that it thinks the server name is localhost.localdomain, is that correct?
 
Old 02-08-2007, 12:03 PM   #20
JustinK101
Member
 
Registered: Jan 2007
Posts: 55

Original Poster
Rep: Reputation: 15
Ok i noticed something interesting as well, when I send an email from PHP the from address is:

Apache <apache@localhost.localdomain>

This is wierd though, because my hostname is BELVEDERE.

Code:
/etc/sysconfig/network

In that file its BELVEDERE
Here is contents of my hosts file:

Code:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       BELVEDERE localhost localhost.localdomain
Here is the contents of my /etc/mail/access file:

Code:
   UW PICO(tm) 4.10                                        File: access

# Check the /usr/share/doc/sendmail/README.cf file for a description
# of the format of this file. (search for access_db in that file)
# The /usr/share/doc/sendmail/README.cf is part of the sendmail-doc
# package.
#
# by default we allow relaying from localhost...
localhost.localdomain           RELAY
localhost                       RELAY
127.0.0.1                       RELAY
BELVEDERE                       RELAY
Is this helpful? Thanks again for the help guys.
 
Old 02-08-2007, 12:05 PM   #21
asommer
Member
 
Registered: Mar 2003
Location: North Carolina
Distribution: Gentoo
Posts: 168

Rep: Reputation: 30
Is there a way in PHP to specify the sender? Maybe that's all you really need. If PHP can't do it you can configre an MTA sendmail, postfix, or whichever you choose to change the sender to whatever you want it to be.
 
Old 02-08-2007, 12:09 PM   #22
JustinK101
Member
 
Registered: Jan 2007
Posts: 55

Original Poster
Rep: Reputation: 15
Here is my full sendmail.mc maybe it will help.

Code:
divert(-1)dnl
dnl #
dnl # This is the sendmail macro config file for m4. If you make changes to
dnl # /etc/mail/sendmail.mc, you will need to regenerate the
dnl # /etc/mail/sendmail.cf file by confirming that the sendmail-cf package is
dnl # installed and then performing a
dnl #
dnl #     make -C /etc/mail
dnl #
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
VERSIONID(`setup for Red Hat Linux')dnl
OSTYPE(`linux')dnl
dnl #
dnl # default logging level is 9, you might want to set it higher to
dnl # debug the configuration
dnl #
dnl define(`confLOG_LEVEL', `9')dnl
dnl #
dnl # Uncomment and edit the following line if your outgoing mail needs to
dnl # be sent out through an external mail server:
dnl #
dnl define(`SMART_HOST',`smtp.your.provider')
dnl #
define(`confDEF_USER_ID',``8:12'')dnl
dnl define(`confAUTO_REBUILD')dnl
define(`confTO_CONNECT', `1m')dnl
define(`confTRY_NULL_MX_LIST',true)dnl
define(`confDONT_PROBE_INTERFACES',true)dnl
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl
define(`ALIAS_FILE', `/etc/aliases')dnl
define(`STATUS_FILE', `/var/log/mail/statistics')dnl
define(`UUCP_MAILER_MAX', `2000000')dnl
define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
define(`confAUTH_OPTIONS', `A')dnl
dnl #
dnl # The following allows relaying if the user authenticates, and disallows
dnl # plaintext authentication (PLAIN/LOGIN) on non-TLS links
dnl #
dnl define(`confAUTH_OPTIONS', `A p')dnl
dnl #
dnl # PLAIN is the preferred plaintext authentication method and used by
dnl # Mozilla Mail and Evolution, though Outlook Express and other MUAs do
dnl # use LOGIN. Other mechanisms should be used if the connection is not
dnl # guaranteed secure.
dnl # Please remember that saslauthd needs to be running for AUTH.
dnl #
dnl TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
dnl #
dnl # Rudimentary information on creating certificates for sendmail TLS:
dnl #     cd /usr/share/ssl/certs; make sendmail.pem
dnl # Complete usage:
dnl #     make -C /usr/share/ssl/certs usage
dnl #
dnl define(`confCACERT',`/usr/share/ssl/certs/ca-bundle.crt')
dnl define(`confSERVER_CERT',`/usr/share/ssl/certs/sendmail.pem')
dnl define(`confSERVER_KEY',`/usr/share/ssl/certs/sendmail.pem')
dnl #
dnl # This allows sendmail to use a keyfile that is shared with OpenLDAP's
dnl # slapd, which requires the file to be readble by group ldap
dnl #
dnl define(`confDONT_BLAME_SENDMAIL',`groupreadablekeyfile')dnl
dnl #
dnl define(`confTO_QUEUEWARN', `4h')dnl
dnl define(`confTO_QUEUERETURN', `5d')dnl
dnl define(`confQUEUE_LA', `12')dnl
dnl define(`confREFUSE_LA', `18')dnl
define(`confTO_IDENT', `0')dnl
dnl FEATURE(delay_checks)dnl
FEATURE(`no_default_msa',`dnl')dnl
FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl
FEATURE(redirect)dnl
FEATURE(always_add_domain)dnl
FEATURE(use_cw_file)dnl
FEATURE(use_ct_file)dnl
dnl #
dnl # The following limits the number of processes sendmail can fork to accept
dnl # incoming messages or process its message queues to 12.) sendmail refuses
dnl # to accept connections once it has reached its quota of child processes.
dnl #
dnl define(`confMAX_DAEMON_CHILDREN', 12)dnl
dnl #
dnl # Limits the number of new connections per second. This caps the overhead
dnl # incurred due to forking new sendmail processes. May be useful against
dnl # DoS attacks or barrages of spam. (As mentioned below, a per-IP address
dnl # limit would be useful but is not available as an option at this writing.)
dnl #
dnl define(`confCONNECTION_RATE_THROTTLE', 3)dnl
dnl #
dnl # The -t option will retry delivery if e.g. the user runs over his quota.
dnl #
FEATURE(local_procmail,`',`procmail -t -Y -a $h -d $u')dnl
FEATURE(`access_db',`hash -T<TMPF> -o /etc/mail/access.db')dnl
FEATURE(`blacklist_recipients')dnl
EXPOSED_USER(`root')dnl
dnl #
dnl # The following causes sendmail to only listen on the IPv4 loopback address
dnl # 127.0.0.1 and not on any other network devices. Remove the loopback
dnl # address restriction to accept email from the internet or intranet.
dnl #
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
dnl #
dnl # The following causes sendmail to additionally listen to port 465, but
dnl # starting immediately in TLS mode upon connecting. Port 25 or 587 followed
dnl # by STARTTLS is preferred, but roaming clients using Outlook Express can't
dnl # do STARTTLS on ports other than 25. Mozilla Mail can ONLY use STARTTLS
dnl # and doesn't support the deprecated smtps; Evolution <1.1.1 uses smtps
dnl # when SSL is enabled-- STARTTLS support is available in version 1.1.1.
dnl #
dnl # For this to work your OpenSSL certificates must be configured.
dnl #
dnl DAEMON_OPTIONS(`Port=smtps, Name=TLSMTA, M=s')dnl
dnl #
dnl # The following causes sendmail to additionally listen on the IPv6 loopback
dnl # device. Remove the loopback address restriction listen to the network.
dnl #
dnl DAEMON_OPTIONS(`port=smtp,Addr=::1, Name=MTA-v6, Family=inet6')dnl
dnl #
dnl # enable both ipv6 and ipv4 in sendmail:
dnl #
dnl DAEMON_OPTIONS(`Name=MTA-v4, Family=inet, Name=MTA-v6, Family=inet6')
dnl #
dnl # We strongly recommend not accepting unresolvable domains if you want to
dnl # protect yourself from spam. However, the laptop and users on computers
dnl # that do not have 24x7 DNS do need this.
dnl #
FEATURE(`accept_unresolvable_domains')dnl
dnl #
dnl FEATURE(`relay_based_on_MX')dnl
dnl #
dnl # Also accept email sent to "localhost.localdomain" as local email.
dnl #
LOCAL_DOMAIN(`BELVEDERE')dnl
dnl #
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
MAILER(smtp)dnl
MAILER(procmail)dnl
 
Old 02-08-2007, 12:14 PM   #23
JustinK101
Member
 
Registered: Jan 2007
Posts: 55

Original Poster
Rep: Reputation: 15
Asommer:

Thanks for the help, but PHP inst the problem here, because I tried the following from the console, with the message doing the same thing, Message Deferred.

Code:
echo hello |sendmail -v justin@ftops.com
 
Old 02-08-2007, 03:44 PM   #24
fukawi2
Member
 
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 449

Rep: Reputation: 34
Just following up on my first message, is there are specific reason you still want to run sendmail instead of postfix or exim or qmail?

I haven't actually run CentOS yet, but it has yum installed so it should be as easy running:
Code:
yum install postfix
 
Old 02-08-2007, 04:33 PM   #25
JustinK101
Member
 
Registered: Jan 2007
Posts: 55

Original Poster
Rep: Reputation: 15
Yeah I tried postfix and couldnt get it working, I am much closer with sendmail then I got with postfix.
 
Old 02-08-2007, 04:55 PM   #26
ColinAnderson
LQ Newbie
 
Registered: Sep 2003
Distribution: RHEL 4, 5; Gentoo
Posts: 20

Rep: Reputation: 0
If you need to use an external mail server, you'll need to make a small change to your sendmail configuration file so that it knows which external server to use. You mentioned something about SMTP on the previous page, so I'm wondering if this could be your problem.

For example, I was experiencing the same problems as you, where all of the messages I would try to send would be queued and deferred. We use Exchange here at work, and it wasn't accepting any of the mail that the server was sending, though I could telnet into it from the server without any problems.

So I began combing through the /etc/mail/sendmail.mc configuration file and quickly spotted the following:
Code:
dnl # Uncomment and edit the following line if your outgoing mail needs to
dnl # be sent out through an external mail server:
dnl #
#define(`SMART_HOST',`[127.0.0.1]')
dnl #
I removed the comment and changed the IP address in the brackets.
Code:
dnl # Uncomment and edit the following line if your outgoing mail needs to
dnl # be sent out through an external mail server:
dnl #
define(`SMART_HOST',`[mail.mydomain.com]')
dnl #
Then I rebuilt the sendmail config file (double check your paths as they may be different)
Code:
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
And restarted sendmail.
Code:
service sendmail restart
My inbox was immediately flooded with the last three days worth of email that had been sitting in the queue.

.Colin
 
Old 02-08-2007, 08:12 PM   #27
isuck@linux
Member
 
Registered: Jun 2006
Distribution: messed up debian
Posts: 250

Rep: Reputation: 30
question here:
Why would you relay localhost.localdomain? I'd rather use a mailertable to change that one to a real domain or somethink like
FEATURE(`always_add_domain')dnl
MASQUERADE_AS(`xxx.com')dnl
FEATURE(`allmasquerade')dnl
FEATURE(`masquerade_envelope')dnl

or maybe a mailertable too.
 
Old 02-09-2007, 11:20 AM   #28
JustinK101
Member
 
Registered: Jan 2007
Posts: 55

Original Poster
Rep: Reputation: 15
Ignore This.

Last edited by JustinK101; 02-09-2007 at 11:38 AM.
 
Old 02-09-2007, 11:38 AM   #29
JustinK101
Member
 
Registered: Jan 2007
Posts: 55

Original Poster
Rep: Reputation: 15
Horray, Progress:

The emails send now, but they get bounced back because the following:

The original message was received at Fri, 9 Feb 2007 09:32:48 -0800
from BELVEDERE [127.0.0.1]

----- The following addresses had permanent fatal errors -----
<myemail@fieldtechnologies.com>
(reason: 550 Host unknown)

----- Transcript of session follows -----
550 5.1.2 <jkeller@fieldtechnologies.com>... Host unknown (Name server: 127.0.0.1: host not found)

Here are the changes I made to my sendmail.mc file:

Code:
LOCAL_DOMAIN(`BELVEDERE')dnl
dnl #
dnl # The following example makes mail from this host and any additional
dnl # specified domains appear to be sent from mydomain.com
dnl #
MASQUERADE_AS(`ftbelvedere.dyndns.org')dnl
dnl #
dnl # masquerade not just the headers, but the envelope as well
dnl #
FEATURE(masquerade_envelope)dnl
dnl #
dnl # masquerade not just @mydomainalias.com, but @*.mydomainalias.com as well
dnl #
FEATURE(masquerade_entire_domain)dnl
define(`SMART_HOST',`127.0.0.1')
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
 
Old 02-09-2007, 01:09 PM   #30
ColinAnderson
LQ Newbie
 
Registered: Sep 2003
Distribution: RHEL 4, 5; Gentoo
Posts: 20

Rep: Reputation: 0
I'm no expert in email protocols by any means, but if I were to guess, I would say that Host unknown (Name server: 127.0.0.1: host not found) is a clue.

You're specifying your SMART_HOST ... directive, whatever you want to call it, as localhost.

Try using your SMTP server, or whatever outgoing email provider (your ISP maybe?).
Code:
define(`SMART_HOST',`[smtp.yourprovider.com]')
I'm not sure, but I think it would be a better idea in keeping with sendmails own conventions and keeping brackets[] around the domain/ip address.

Either way, just throwing out ideas.

As I understand it, to be a "full fledged" email provider, they need to have valid MX records, or something of that nature, with the receiving host and I think that's why it is getting bounced back; but like I said I'm no expert ... yet.

.Colin

Last edited by ColinAnderson; 02-09-2007 at 01:10 PM.
 
  


Reply

Tags
email, sendmail, sendmailmc, smarthost, smtp



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 stopped sending....sitting in queue caykroyd Linux - Server 6 09-01-2006 12:56 PM
problem with sendmail over ppp - message queue stuck julot Slackware 1 07-17-2006 04:44 AM
Sendmail sending dubious messages rotsky Linux - Security 1 05-16-2006 05:52 PM
sendmail: stat=Deferred: Connection timed out with email.mydomain.com intranet_man Linux - Software 1 07-19-2005 11:04 AM
sendmail Deferred: Connection refused by localhost.localdomain. 360 Linux - Software 6 03-31-2003 01:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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