LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-24-2011, 07:52 AM   #1
baldur2630
Member
 
Registered: Jan 2007
Location: Belgium
Distribution: CentOS & Ubuntu
Posts: 175

Rep: Reputation: 22
Sendmail - Domain Masquerading Problem


I have a Centos 5.5 Server, Servername is CentOS1.
It has a Forum and a HelpDesk.
The Help Desk software SENDS and acknowledgement to the user and emails to all the people on the support desk.
Users can reply to emails only by accessing the helpdesk NOT by mail
Thus the server is configured to only SEND mail and not to receive any mail at all.
Mail Server is Sendmail.
Hosts file reads : -
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 CentOS1.tech.xxxxx.com CentOS1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6

There is NO MX Record because this server receives NO mail, it's send only.

Unfortunately, the mail it sends has a From Header which is @CentOS1.tech.xxxxx.com.

I want it to send from @xxxxx.com

I've read all the howtos on Masquerading and I've tried many, many things, but with the same results. It will NOT change the From.

I had it working perfectly a long time ago with a SuSE server, but I can't for the life of me remember what I did. I know I also battled a bit.

I'm missing something, but I have no idea what.

The last few lines of sendmail.mc read : -

LOCAL_DOMAIN(`localhost.localdomain')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(`xxxxx.com')dnl
dnl FEATURE(masquerade_envelope)dnl
dnl FEATURE(masquerade_entire_domain)dnl
dnl MASQUERADE_DOMAIN(localhost)dnl
dnl MASQUERADE_DOMAIN(localhost.localdomain)dnl
dnl MASQUERADE_DOMAIN(CentOS1.tech.xxxxx.com)dnl
dnl MASQUERADE_DOMAIN(CentOS1)dnl
dnl MASQUERADE_DOMAIN(tech.xxxxx.com)dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
dnl MAILER(cyrusv2)dnl

I've tried each one of the MAQUERADE_DOMAIN in turn, none of them work and yes, I have remade it.

Can anyone tell me what I'm missing. It must be something stupid. It usually is!
 
Old 04-24-2011, 11:46 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,223
Blog Entries: 1

Rep: Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076
Hi,

If you use dnl at the beginning of each line, this line is treated as a comment. So with this .mc file, you're actually not masquerading anything

Regards
 
1 members found this post helpful.
Old 04-24-2011, 11:49 AM   #3
baldur2630
Member
 
Registered: Jan 2007
Location: Belgium
Distribution: CentOS & Ubuntu
Posts: 175

Original Poster
Rep: Reputation: 22
Well, I did say it was probably something really stupid. Let me kick myself a few times and then remove the dnl and try again.

I'll get back to you

Last edited by baldur2630; 04-24-2011 at 11:50 AM.
 
Old 04-24-2011, 12:28 PM   #4
baldur2630
Member
 
Registered: Jan 2007
Location: Belgium
Distribution: CentOS & Ubuntu
Posts: 175

Original Poster
Rep: Reputation: 22
Now I've REALLY screwed it up!

Tried to send a message to techserv@xxxxx.com (that's our GroupWise mailserver) from fred (aliased to fred@xxxxx.com)
techserv is a GroupWise Nickname for Joe@xxxxx.com, so all mail addresses to techserv gets delivered to joe

Apr 24 19:01:15 CentOS1 sendmail[9677]: p3OH1FCq009677: from=fred@CentOS1.tech.xxxxx.com, size=315, class=0, nrcpts=1, msgid=<1303664475.9675@CentOS1.tech.xxxxx.com>, relay=root@localhost
Apr 24 19:01:15 CentOS1 sendmail[9678]: p3OH1FxN009678: <techserv.tech.xxxxx.com@CentOS1.tech.xxxxx.com>... User unknown
Apr 24 19:01:15 CentOS1 sendmail[9677]: p3OH1FCq009677: to=techserv.tech.xxxxx.com, ctladdr=fred@CentOS1.tech.xxxxx.com (500/500), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30315, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.1, stat=User unknown
Apr 24 19:01:15 CentOS1 sendmail[9678]: p3OH1FxN009678: from=<fred@CentOS1.tech.xxxxx.com>, size=315, class=0, nrcpts=0, proto=ESMTP, daemon=MTA, relay=CentOS1.tech.xxxxx.com [127.0.0.1]
Apr 24 19:01:15 CentOS1 sendmail[9677]: p3OH1FCq009677: p3OH1FCr009677: DSN: User unknown
Apr 24 19:01:15 CentOS-55 sendmail[9678]: p3OH1FxP009678: from=<>, size=2703, class=0, nrcpts=1, msgid=<201104241701.p3OH1FCr009677@CentOS1.tech.xxxxx.com>, proto=ESMTP, daemon=MTA, relay=CentOS1.tech.xxxxx.com [127.0.0.1]
Apr 24 19:01:15 CentOS1 sendmail[9677]: p3OH1FCr009677: to=fred@CentOS1.tech.xxxxx.com, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31339, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (p3OH1FxP009678 Message accepted for delivery)

Fred@xxxxx.com received the following bounce in his GroupWise mailbox

The original message was received at Sun, 24 Apr 2011 19:01:15 +0200
from root@localhost

----- The following addresses had permanent fatal errors -----
joe.tech.xxxxx.com
(reason: 550 5.1.1 <joe.tech.xxxxx.com@CentOS1.tech.xxxxx.com>... User unknown)
(expanded from: joe.tech.xxxxx.com)

----- Transcript of session follows -----
... while talking to [127.0.0.1]:
>>> DATA
<<< 550 5.1.1 <techserv.tech.xxxxx.com@CentOS1.tech.xxxxx.com>... User unknown
550 5.1.1 techserv.tech.xxxxx.com... User unknown
<<< 503 5.0.0 Need RCPT (recipient)

I'll put all the dnl back, there's obviously another problem. - Sendmail needs multiple degrees in astrophysics and biochemistry!
 
Old 04-24-2011, 12:58 PM   #5
baldur2630
Member
 
Registered: Jan 2007
Location: Belgium
Distribution: CentOS & Ubuntu
Posts: 175

Original Poster
Rep: Reputation: 22
More information.

I tried to send a mail to a colleague with an external address after I put the dnl's back in. This is what I get, and why I need to masquerade : -

----- The following addresses had permanent fatal errors -----
<info@domain.ca>
(reason: 550-Verification failed for <apache@CentOS1.tech.xxxxx.com>)

----- Transcript of session follows -----
... while talking to domain.ca.:
>>> DATA
<<< 550-Verification failed for <apache@CentOS1.tech.xxxxx.com>
<<< 550-The mail server could not deliver mail to apache@centos1.tech.xxxxx.com. The account or domain may not exist, they may be blacklisted, or missing the proper dns entries.
<<< 550 Sender verify failed
550 5.1.1 <info@domain.ca>... User unknown
<<< 503-All RCPT commands were rejected with this error:
<<< 503-Sender verify failed
<<< 503 Valid RCPT command must precede DATA
 
Old 04-24-2011, 06:40 PM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,223
Blog Entries: 1

Rep: Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076
Hi,

You need:
Code:
MASQUERADE_AS(xxxxx.com)dnl
MASQUERADE_DOMAIN(xxxxx.com)dnl
FEATURE(masquerade_envelope)dnl
FEATURE(masquerade_entire_domain)dnl
If you want also to masquerade the recipient use:
Code:
FEATURE(allmasquerade)dns
and in this case you need to add xxxxx.com in /etc/mail/local-host-names, so you can receive mail for techserv@xxxxx.com
 
Old 04-25-2011, 01:30 AM   #7
baldur2630
Member
 
Registered: Jan 2007
Location: Belgium
Distribution: CentOS & Ubuntu
Posts: 175

Original Poster
Rep: Reputation: 22
I assumed (seems correctly) that you meant FEATURE(allmasquerade)dnL and not dnS, so I used dnl.

MAGIC! Thank you kind sir, it works beautifully!

You are a star.

Problem solved
 
Old 04-27-2011, 12:37 AM   #8
baldur2630
Member
 
Registered: Jan 2007
Location: Belgium
Distribution: CentOS & Ubuntu
Posts: 175

Original Poster
Rep: Reputation: 22
I spoke too soon. It didn't work after all. I sent mail to several people OUTSIDE of the xxxxx.com domain and it was (still is 100% BUT...

I suddenly saw the mail queue growing and I didn't get my daily Logwatch. I cleared all the error messages, deleted everything in the queue and tried to send an email to a user in the xxxxx.com domain.

In the queue was the stuck message

from root@localhost

----- The following addresses had permanent fatal errors -----
techserv@xxxxx.org
(reason: 550 5.1.1 <techserv@xxxxx.com>... User unknown)
(expanded from: techserv@xxxxx.com)

----- Transcript of session follows -----
... while talking to [127.0.0.1]:
>>> DATA
<<< 550 5.1.1 <techserv@xxxxx.com>... User unknown
550 5.1.1 techserv@xxxxx.com... User unknown
<<< 503 5.0.0 Need RCPT (recipient)


I did a flush and got the following : -

Running /var/spool/mqueue/p3R5JlNG032014 (sequence 1 of 1)
<techserv@CentOS1.tech.xxxxx.com>... aliased to fred@xxxxx.com
fred@xxxxx.com... User unknown
postmaster... aliased to root
root... aliased to fred@xxxxx.com
fred@xxxxx.com... User unknown
MAILER-DAEMON... aliased to fred@xxxxx.com
fred@xxxxx.com... User unknown
postmaster... aliased to root
root... aliased to fred@xxxxx.com
fred@xxxxx.com... User unknown
MAILER-DAEMON... aliased to fred@xxxxx.com
fred@xxxxx.com... User unknown
savemail: cannot save rejected email anywhere


In the maillog file - NOTHING.

Seems like I can send mail to anyone OUTSIDE of my domain but not local users. What could have caused this and how can I fix it?
 
Old 04-27-2011, 01:49 AM   #9
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,223
Blog Entries: 1

Rep: Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076
Hi,

Did you remembered to add xxxxx.com in /etc/mail/local-host-names?
 
Old 04-27-2011, 02:03 AM   #10
baldur2630
Member
 
Registered: Jan 2007
Location: Belgium
Distribution: CentOS & Ubuntu
Posts: 175

Original Poster
Rep: Reputation: 22
Yes, I did. Just rechecked - it's still there!
 
Old 04-27-2011, 02:28 AM   #11
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,223
Blog Entries: 1

Rep: Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076
Are you sure that your mailserver can receive mail for the domain xxxxx.com?
What gives:
Code:
sendmail -bv techserv@xxxxx.com
 
Old 04-27-2011, 02:37 AM   #12
baldur2630
Member
 
Registered: Jan 2007
Location: Belgium
Distribution: CentOS & Ubuntu
Posts: 175

Original Poster
Rep: Reputation: 22
No, if you look back at my original post, there is no MX record for this server. The MX record is for my GroupWise Server on a different IP address. All that this Centos box must do is SEND mail. The user receives the mail from the Centos box, but if the user then replies to xxxxx.com come to my GroupWise server and this is working perfectly.

That's why it is so important to get the masquerade correct. It works, for everyone in any domain EXCEPT xxxxx.com, so the box can't even send the Logwatch reports and even rejected mail which used to be sent to the Postmaster/root which is Fred is now being held in the queue. Something has changed on the server it WAS working and only the masquerade was the problem. Now the masquerade works but not the sendmail to my domain!
 
Old 04-27-2011, 03:37 AM   #13
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,223
Blog Entries: 1

Rep: Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076
So, remove the
Quote:
FEATURE(allmasquerade)dns
from sendmail.mc and the domain xxxxx.com from /etc/mail/local-host-names
Check with:
Code:
sendmail -bv techserv@xxxxx.com
to see if it lists your GroupWise Server as the smtp server for that domain.
 
Old 04-27-2011, 03:55 AM   #14
baldur2630
Member
 
Registered: Jan 2007
Location: Belgium
Distribution: CentOS & Ubuntu
Posts: 175

Original Poster
Rep: Reputation: 22
That seems to have worked. Thanks for that.

I'll mark it as 'Solved' again - I'm an optimist!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Masquerading in Sendmail. mohitvad Linux - Server 2 02-15-2010 01:03 PM
Sendmail not Masquerading Domains mpgram Linux - Networking 0 06-06-2005 09:20 PM
sendmail domain problem slack66 Linux - General 1 08-17-2003 04:10 PM
domain problem in sendmail klintonray Linux - Software 1 07-28-2003 12:31 AM
sendmail domain name problem terek Linux - Newbie 3 06-16-2002 02:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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