Menu

Seeing double..

2001-02-19
2001-02-22
  • Stuart Clark

    Stuart Clark - 2001-02-19

    Hi..

    I have used the sendmail-mysq-8.11.1 patch against Sendmail 8.11.2 and after a few version number changes to get it to patch, it patched cleanly.
    I am having a problem in that on doing an alias lookup it will return the alias from the database, and the alias with hostname conversion:

    Consider "test.com.au" is a localally deliverable domain on "host.test.com.au" and that an alias definition exists as..

    Alias      |  Destination
    ------------+------------------------
    testing    |  test@host.test.com.au

    sendmail -bv  testing@test.com.au
    testing@test.com.au... deliverable: mailer local, user test123
    testing@host.test.com.au... deliverable: mailer local, user test123

    I have debugging output at http://mr.stoo.com.au/sendmail/output

    It will actually deliver the same message to test123 twice.

    Note that if the destination points to a username and not username@host, then the duplication does not occur.

    Can someome simulate this and get the same result? .. and what is the solution?
    The goal is to have an alias file point users mail to a particular host machine, and for thah machine to deliver it locally.

    Kind regards,  Stuart.

     
    • Kev Green

      Kev Green - 2001-02-19

      Stuart,

      Looking at all your debugging output, this part makes me instantly suspicious...

      self_reference(testing@host.test.com.au)
              ... cannot break loop for "testing@host.test.com.au"

      It looks then like sendmail is delivering to both addresses as the best way out of an infinite loop.

      I could be wrong (it's waaay too early in the morning and I've just been woken up by work's emergency pager system!), but I reckon you've got an entry in your /etc/sendmail.cw file for host.test.com.au, or somewhere which has the same effect in /etc/mail, which is causing a loop.

      Can you post us your /etc/sendmail.cw too? also, if you can post us the messages you received as a result of this problem including full headers, that would be even better as well.

      I'll look into this in more detail myself later on, eg. once I've woken up and find time.

      Yours,

      Kev.

       
    • Stuart Clark

      Stuart Clark - 2001-02-20

      Kev,

      You are right.  My whole approach may be flawed.

      my sendmail.cw file contains:

      test.com.au
      host.test.com.au

      Maybe you would be able to point me in the right direction.
      I am trying to set up a system that routes mail to the desired host machine, directed by the alias definition.

      I will try to explain this:

        A
      / \
      B   C

      Host "A" has the primary MX for the domain test.com.au
      User X has mail that resides on server "B"
      User Y has mail that resides on server "C"

      All mail coming through host "A" for user "X@test.com.au" will use the MySQL database to find that the alias "X" has the destination "X@B.test.com.au".  Mail should be delivered then to the host "B".
      Host "B" should determine that mail for domain "test.com.au" and "B.test.com.au" be delivered locally, and that from the MySQL database user "X"'s mail will be delivered to user "X" on this host.
      Host "C" holds mail for user "Y" and is deliverable in the same manner as above.

      Is this the wrong use of aliases? 
      Should I be using the virtuser table to achieve this?
      Why can't host "B" do a lookup correctly for the alias "X@B.test.com.au" and determine that it is for user "X" locally on host "B".

      Thanks in advance.  :)  Stuart

       
    • Kev Green

      Kev Green - 2001-02-22

      Sorry I took so long to reply.

      Yes, you should be using a virtusertable - on your "server A" - you can do entries for it by domain or by fully qualified address I believe, to map eg.

      domain1.com -> a.domain1.com (Map in DNS to Server A)

      domain2.com -> b.domain2.com (Map in DNS to Server  B)

      OR:

      bob@domain1.com -> bob@a.domain1.com
      fred@domain1.com -> fred@b.domain1.com
      joe@domain2.com -> joe@a.domain2.com
      alice@domain2.com -> alice@b.domain2.com

      That would be a better way in most respects to achieve what you want, as long as a you don't put a.domain2.com, b.domain1.com etc. in /etc/sendmail.cw on server A (but you've probably learned that lesson already ;).

      It's probably better for simplicity's sake to route on a per domain basis if you're in an ISP situation, but if it's just for one domain, you'll have to fully qualify addresses.

      Hope this makes sense.

      Oh, and if you want it to look cleaner, you'll have to set a.domain1.com, b.domain2.com etc. to then rewrite their host addresses back to the appropriate thing for the email address (possibly!), which you can do quite easily I think, though I forget how.

      K.

       

Log in to post a comment.