gateway.c 499 B

1234567891011121314151617181920212223
  1. #include "common.h"
  2. #include "send.h"
  3. #define isspace(c) ((c)==' ' || (c)=='\t' || (c)=='\n')
  4. /*
  5. * Translate the last component of the sender address. If the translation
  6. * yields the same address, replace the sender with its last component.
  7. */
  8. extern void
  9. gateway(message *mp)
  10. {
  11. char *base;
  12. String *s;
  13. /* first remove all systems equivalent to us */
  14. base = skipequiv(s_to_c(mp->sender));
  15. if(base != s_to_c(mp->sender)){
  16. s = mp->sender;
  17. mp->sender = s_copy(base);
  18. s_free(s);
  19. }
  20. }