Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Yet another victim of sendmail/masquerade

    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
    next is the command line rule test which works:
    /usr/sbin/sendmail -bt
    /tryflags ES
    /try esmtp user@localhostname.domain
    final            returns: user@domain
    Rcode = 0, addr = user@domain
    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):
    /usr/sbin/sendmail -v someaddress@somedomain
    >>> EHLO localhostname.domain
    >>> MAIL From:<user@localhostname.domain> size=***
    >>> RCPT To:<someaddress@somedomain>
    >>> DATA
    >>> .
    >>> QUIT
    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.
    I could get the EHLO command to be sent with domain only by making modifications to 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.

  2. #2
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts