Results 1 to 2 of 2
Hello,
I have been spending a day and a half reading all the threads I could find about the topic (and there's a lot of them). Yet I could never ...
- 04-06-2009 #1Just Joined!
- Join Date
- Mar 2007
- Posts
- 4
Yet another victim of sendmail/masquerade
Hello,
I have been spending a day and a half reading all the threads I could find about the topic (and there's a lot of them). Yet I could never find the answer to my problem.
So here it is:
I have a mail server behind a gateway.
Postfix is configured and running, but for some reason, when procmail is invoked for some email copy/forwarding, it calls /usr/sbin/sendmail
This wouldn't be a very big deal if sendmail was using the right domain.
Instead of sending copies of our emails from user@domain, it sends them from user@localhostname.domain, which leads in most cases to our forwarded emails as spam by the final mailbox.
This sets the context of my story.
Now to the heart of the problem.
The idea is, we don't use the sendmail service (which is down), just the command /usr/sbin/sendmail
using the command /bin/mail gives the same result.
I was trying to force sendmail to replace localhostname.domain by domain using masquerade.
Here is the relevant part of my sendmail.mc:
next is the command line rule test which works:Code:MASQUERADE_AS(`domain')dnl FEATURE(masquerade_envelope)dnl FEATURE(masquerade_entire_domain)dnl MASQUERADE_DOMAIN(domain)dnl
So it seems it is up and ready to work until we try this (I remove the server answers as what is sent only is relevant):Code:/usr/sbin/sendmail -bt /tryflags ES /try esmtp user@localhostname.domain ... final returns: user@domain Rcode = 0, addr = user@domain
Here, obviously, the disappointment comes from the RCPT TO command which is sent with the address including localhostname, when we tried so hard to only get domain.Code:/usr/sbin/sendmail -v someaddress@somedomain >>> EHLO localhostname.domain >>> MAIL From:<user@localhostname.domain> size=*** >>> RCPT To:<someaddress@somedomain> >>> DATA >>> . >>> QUIT
I could get the EHLO command to be sent with domain only by making modifications to submit.mc and doing a make, but could not find why is the RCPT TO command still using the localhostname.
This is as far as I could get and I am now really running out of ideas.
I ran my test as a non-root user, so this is not the problem.
If anyone has had a similar experience, please do not hesitate to share your knowledge.
Regards
- 04-07-2009 #2Just Joined!
- Join Date
- Mar 2007
- Posts
- 4
Here is a quick update to let people potentially in the same situation know how things turned out for me.
After some more playing around with the hostnames and other environment variables, I ended up finding out that there were a /usr/sbin/sendmail.postfix executable.
Postfix being running perfectly, I replaced /usr/sbin/sendmail by this executable, and it now works like a charm (since /usr/mail and procmail both use this command).
I guess the sendmail.sendmail is half way relying on the background sendmail service and that once it is off you have to give up on any extra functionality.
Anyways, now things work and I will go sendmail free for a good while.
Cheers


Reply With Quote
