[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
uucp setup and rmail
Greetings,
Well, as usual instead of a solution I've got more questions
about the uucp setup and this is what I've found: basically one does
not really want to use i-uucp.cf and p-uucp.cf config files, the only
useful thing from there namely uucpname=uucp-name should go into
/etc/mail.conf in the routes database for every uucp system there
should be two records uucp-host.uucp uucp!uucp-host and
domain.top uucp!uucp-host in order to implement domain to uucp
mapping. When a message is routed through uucp channel it gets
properly rewritten with uucproute() in rrouter.cf The only thing is
to generate proper smtp return paths and for this purpose smtproute()
has to be modified like this (to ensure we always have proper return
path and dns-resolvable ``mail from:''):
mtp.cf
*** p-smtp.cf Mon Mar 4 01:05:39 1996
--- /etc/mail/cf/p-smtp.cf Tue Dec 2 15:32:27 1997
***************
*** 48,53 ****
--- 48,55 ----
sift "$address" in
(.*)<@(.+)>(.*)
address="\1@\2\3" ;;
+ (.*)@(.+).uucp
+ address="$(uucproute \1@\2)@$mydomain" ;;
[^@]+ address="$address@$mydomain" ; break ;;
,?((@[^:]+):)?(([^!%@]\.)+(.))!(.+)@(.+)
if [ "$(istoplevel "\3")" ]; then
Perhaps $mydomain above should be something different,
like $uucprelay. Thus:
host!user host!user@$mydomain
host!domain.top!user host!domain.top!user@uucp.NL.net
domain.top!user user@domain.top
host!user@domain.top host!user@domain.top
The last thing is rmail which has to be modified to use
sysexits.h Below attached the patch...
alexis
*** 1.1 1997/12/03 09:16:50
--- rmail.c 1997/12/03 09:41:16
***************
*** 6,11 ****
--- 6,12 ----
/* Rmail -- handle remote mail received via UUCP */
#include <stdio.h>
+ #include <sysexits.h>
#include "hostenv.h"
#include <ctype.h>
#include "mail.h"
***************
*** 89,95 ****
break;
case 'V':
prversion("rmail");
! exit(0);
break;
default:
++errflg;
--- 90,96 ----
break;
case 'V':
prversion("rmail");
! exit(EX_OK);
break;
default:
++errflg;
***************
*** 99,105 ****
if (errflg || optind >= argc) {
fprintf(stderr,"Usage: %s [-d -h default_host] address ...\n",
progname);
! exit(1);
}
initline(0L);
flmax = 0;
--- 100,106 ----
if (errflg || optind >= argc) {
fprintf(stderr,"Usage: %s [-d -h default_host] address ...\n",
progname);
! exit(EX_USAGE);
}
initline(0L);
flmax = 0;
***************
*** 112,121 ****
printf("'\n");
}
if ((sc = breakdown(linebuf, n-1)) == NULL)
! exit(1); /* message printed below */
if (flmax >= MAXHOPS) {
fprintf(stderr,"%s: too many hops\n",progname);
! exit(1);
}
fl[flmax++] = copyfrom_(sc);
} else
--- 113,122 ----
printf("'\n");
}
if ((sc = breakdown(linebuf, n-1)) == NULL)
! exit(EX_SOFTWARE); /* message printed below */
if (flmax >= MAXHOPS) {
fprintf(stderr,"%s: too many hops\n",progname);
! exit(EX_SOFTWARE);
}
fl[flmax++] = copyfrom_(sc);
} else
***************
*** 124,130 ****
if (n <= 0) { /* what's the point? */
fprintf(stderr, "%s: empty message\n", progname);
! exit(1);
}
if (debug) {
--- 125,131 ----
if (n <= 0) { /* what's the point? */
fprintf(stderr, "%s: empty message\n", progname);
! exit(EX_DATAERR);
}
if (debug) {
***************
*** 141,147 ****
mfp = (debug ? stdout : mail_open(MSG_RFC822));
if (mfp == NULL) {
fprintf(stderr, "%s: cannot send mail, try later\n", progname);
! exit(1);
}
fprintf(mfp, "external\n");
--- 142,148 ----
mfp = (debug ? stdout : mail_open(MSG_RFC822));
if (mfp == NULL) {
fprintf(stderr, "%s: cannot send mail, try later\n", progname);
! exit(EX_TEMPFAIL);
}
fprintf(mfp, "external\n");
***************
*** 201,207 ****
if (cp == NULL) { /* egad! */
fprintf(stderr,"%s: malformed From_ line\n", progname);
if (!debug) mail_abort(mfp);
! exit(1);
}
fprintf(mfp, "%s\n", cp);
fprintf(mfp,"env-end\n");
--- 202,208 ----
if (cp == NULL) { /* egad! */
fprintf(stderr,"%s: malformed From_ line\n", progname);
if (!debug) mail_abort(mfp);
! exit(EX_DATAERR);
}
fprintf(mfp, "%s\n", cp);
fprintf(mfp,"env-end\n");
***************
*** 225,233 ****
fprintf(stderr,"%s: error while creating message, try later\n",
progname);
mail_abort(mfp);
! exit(1);
}
! exit(0);
/* NOTREACHED */
return 0;
}
--- 226,234 ----
fprintf(stderr,"%s: error while creating message, try later\n",
progname);
mail_abort(mfp);
! exit(EX_TEMPFAIL);
}
! exit(EX_OK);
/* NOTREACHED */
return 0;
}
--
Where the wild horses run