Linux - SoftwareThis 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.
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.
You can't (or rather shouldn't) masquerade for a domain you don't own (nor a hostname that can't be resolved or PTRed) as remote MTA's won't accept it anyway AFAIK. I can confirm the tut you used works, and wrt masking even internally, try adding FEATURE(allmasquerade)dnl. I wonder what's keeping it from masqing properly. Maybe it would be good to re-check and list slash post all the changes you made, check logs and all that?
hi there, i tried adding FEATURE(allmasquerade)dnl but to no avail.
I've so far followed the tutorial and make the same changes, but naturally the domain is according to my setup.
Code:
MASQUERADE_AS(domain name I want to masquerade as)dnl
MASQUERADE_DOMAIN(hostname of machine)dnl
I test sending of mail to my mail account (on google apps) with this command:
Code:
echo "test mail" | mail -sTest4 my@email.com
I did a tail -f on var/log/maillog all this while with the output the same hostname of machine is reflected as staging.hostname.com.
My email add is my@email.com. They are bold
Not entirely your fault but it's hard to deal with this without a combination of /etc/mail/ configuration files, logs and message headers. And saying "but to no avail" kinda equals "doesn't work". I'd rather read specific, factual info like "no, the headers remain unchanged". Also testing as unprivileged user is preferred, maybe not relevant here, but root usually overrides a lot of checks and such. Is "staging.hostname.com" a FQDN that can be resolved by remote MTA's? Do you send directly or do you use a smarthost? Did the message you sent arrive? Did it show no or partial header changes?
Not entirely your fault but it's hard to deal with this without a combination of /etc/mail/ configuration files, logs and message headers. And saying "but to no avail" kinda equals "doesn't work". I'd rather read specific, factual info like "no, the headers remain unchanged". Also testing as unprivileged user is preferred, maybe not relevant here, but root usually overrides a lot of checks and such. Is "staging.hostname.com" a FQDN that can be resolved by remote MTA's? Do you send directly or do you use a smarthost? Did the message you sent arrive? Did it show no or partial header changes?
hi unSpawn,
mails received after masquerading options are implemented still have the same values in their mail header. i.e. the domain is still reflecting the hostname of the machine.
I did a test using both a non-privilege user (mis) and root to send to a public domain
mydomain is my server domain, domain.com is the email recipient
Sending using mis
Command used: echo "test masqurading" | mail -sTest2 me@domain.com
output on screen: /home/mis/dead.letter... Saved message in /home/mis/dead.letter
command: echo "test masqurading" | mail -sTest3 me@domain.com
output on screen: nothing
maillog
Code:
Jun 24 19:26:11 web5 sendmail[2428]: m5OBQBnu002428: from=root, size=55, class=0, nrcpts=1, msgid=<200806241126.m5OBQBnu002428@web5.mydomain.com>, relay=root@localhost
Jun 24 19:26:11 web5 sendmail[2429]: m5OBQBZP002429: <me@domain.com>... Unrecognized host name domain.com.
Jun 24 19:26:11 web5 sendmail[2428]: m5OBQBnu002428: to=me@domain.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30055, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.2, stat=User unknown
Jun 24 19:26:11 web5 sendmail[2429]: m5OBQBZP002429: from=<root@web5.mydomain.com>, size=55, class=0, nrcpts=0, proto=ESMTP, daemon=MTA, relay=web5.mydomain.com [127.0.0.1]
Jun 24 19:26:11 web5 sendmail[2428]: m5OBQBnu002428: m5OBQBnv002428: DSN: User unknown
I have not touch any other settings since I last posted here on LQ abt this matter. Strangely, I have not receive the mail at my domain.com account yet... its a google apps account, not sure if it is lagging, but nonetheless I will monitor...
but strangely when user mis send I tend to get dead.letter. what's that?
Lastly.. if you can see server hostname is web5.mydomain.com
In my sendmail.mc, I have set it to masquearade to mydomain.com but to no avail
I have not touch any other settings since I last posted here on LQ abt this matter.
I don't know if that's comforting to know or not :-]
Quote:
Originally Posted by Swakoo
Strangely, I have not receive the mail at my domain.com account yet... (..) but strangely when user mis send I tend to get dead.letter. what's that?
Nothing about Google, it seems the machine can't resolve (or the user hasn't got rights to resolver methods) the given address "me@domain.com". If you check your maillog you'll see a note it can't resolve the host or can't find the user @domain.com.
If you want to test resolving (preferably as user "mis") you can use 'dig mx domain.com' and 'echo "/mx domain.com"|/usr/sbin/sendmail -v -bt -d8.99'. One is a system-centric view, the other of course is how Sendmail perceives things. Should be the first thing to fix if it fails.
If all of this doesn't work then I suggest you restore your MTA back to working order w/o masquerading RSN so it *at least* works. Then we'll run an instance of your MTA with different configs on a different port to "play" with. That way we don't hamper traffic. OK?
Heh unSpawn, I hope that's comforting
As in... I didn't mess around with any other settings.. thats what I meant
I'll check out the link Arpita provided to see if I can figure this out.
Btw.. my web servers can resolve domain normally. Thats why its interesting to see that sendmail can't resolve.
ping, dig etc.. works like a charm
Mail is still being send as per normal but mails are getting bounced back as they can't resolve domains like hotmail.com.
Through mutt, I see this:
Quote:
----- The following addresses had permanent fatal errors ----- user@yahoo.com
(reason: 553 5.1.2 <user@yahoo.com>... Unrecognized host name yahoo.com.)
(expanded from: user@yahoo.com)
i replaced userid with user for privacy reasons
But I can resolve yahoo over the CLi, so thats what is perplexing heh.
And interestingly, for the bounced mails, it is now showing mail.domain.com, which is what I wanted... haha.. but I don't know why sendmail can't resolve domains now.. trying to figure that out now...
As in... I didn't mess around with any other settings.. thats what I meant
Yeah, I know... You see in essence that means two things: you didn't proceed on your own (bad) but also you didn't mess up things more (good). I'm just playing. Lets move on...
Quote:
Originally Posted by Swakoo
But I can resolve yahoo over the CLi
Does this mean no e-mails get sent? All fail with resolver errrors? Or just some? What does 'echo "/mx yahoo.com"|/usr/sbin/sendmail -v -bt -d1-20.99' return? What does maillog say? BTW, IIRC e-mail to domains like hotmail, yahoo and such should be handled cautiously: some domains have anti-spam features that will block you automagically and for prolonged periods of time after one mistake, so once you're "caught" any following errors don't mean much anymore. Better use some other, "less aggressive" domains as crash test dummies.
Quote:
Originally Posted by Swakoo
And interestingly, for the bounced mails, it is now showing mail.domain.com, which is what I wanted...
Ah. Now who said you can't always get what you want? ;-p
Does this mean no e-mails get sent? All fail with resolver errrors? Or just some? What does 'echo "/mx yahoo.com"|/usr/sbin/sendmail -v -bt -d1-20.99' return? What does maillog say? BTW, IIRC e-mail to domains like hotmail, yahoo and such should be handled cautiously: some domains have anti-spam features that will block you automagically and for prolonged periods of time after one mistake, so once you're "caught" any following errors don't mean much anymore. Better use some other, "less aggressive" domains as crash test dummies.
Ah. Now who said you can't always get what you want? ;-p
Well, my experience with Sendmail, especially on the matter on the masquerading so far, is always of mixed results.
Though now I suddenly got it working, here I have another machine which I tried to masquerade. Pump in the same settings but, nah doesn't work.
Also, realise that gmail receives the masquearded mail as such:
Quote:
Received: from web1.domain.com (mail.domain.com [this.is.my.ip])
by mx.google.com with ESMTP id i9si115199tid.15.2008.07.03.09.01.05;
Thu, 03 Jul 2008 09:02:18 -0700 (PDT)
mail.domain.com is the masqueraded address, but it still captures the hostname... I guess there's no masking that?
When I send as root, the "From" field is always the hostname of the machine
when I send as non-root, the "From" field will be the masqueraded one, but the above quoted text will still be in the mail header... normal?
For your earlier suggestion, I got the following result:
also, i have been trying to send mail, either via mutt or via mail command... i keep getting bounce with the following:
Quote:
----- The following addresses had permanent fatal errors ----- validuser@validdomain.com
(reason: 553 5.1.2 <validuser@validdomain.com>... Unrecognized host name
+validdomain.com.)
(expanded from: validuser@validdomain.com)
Strangely, ping is very fine.
maillog shows the same too
Quote:
Unrecognized host name validdomain.com
it does seems that no email can get sent... weirdly.
when i try to send as a non-root user from the problem server, i get this:
Quote:
/home/user/dead.letter... Saved message in /home/user/dead.letter
I mentioned this a post earlier... and googling it.. does seems to be because of the unresolvable domain
Just strangely... ping/traceroute have no problem...
perplexing...
i've checked ip routes, network config etc. its all fine.
i tried ssh <publicdomainname> and I can connect, no problem. it recognises the name.
But when I send mail to the same domain, it doesn't.
Is there, perhaps, a separate mechanism/file/config that controls the dns lookup for sendmail?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.