[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch for SMTP



Here's a patch for smtp that fixes the problem previously discussed on
this list. Replace the following lines in deliver ():

------------------------------------------------------------------

  if (strcmp(startrp->addr->link->channel,"error")==0)
          sprintf(SMTPbuf, "MAIL From:<>");
  else
          sprintf(SMTPbuf, "MAIL From:<%s>", startrp->addr->link->user);

------------------------------------------------------------------

With the following code:

-------------------------------------------------------------------
  if (strcmp(startrp->addr->link->channel,"error")==0)
          sprintf(SMTPbuf, "MAIL From:<>");
  else
    {
      if (strchr (strchr (startrp->addr->link->user, '@'), '.')) /* FQDN ?*/

          sprintf (SMTPbuf, "MAIL From:<%s>", startrp->addr->link->user);

      else                /* no, convert to route */

          sprintf (SMTPbuf, "Mail From:<@%s:%s>", myhostname, startrp->addr->link->user);

    }


--------------------------------------------------------------------

Perhaps it would be best to do it in the cf files. I don't have the
time to figure it out. If someone else does, and it is better, I would
certainly appreciate it.

sdb