5 #include "auto_qmail.h"
12 substdio_putsflush(subfderr,"sendmail: fatal: out of memory\n");
28 if (chdir(auto_qmail) == -1)
30 substdio_putsflush(subfderr,"sendmail: fatal: unable to switch to qmail home directory\n");
36 while ((opt = getopt(argc,argv,"vimte:f:p:o:B:F:EJx")) != opteof)
40 case 't': flagh = 1; break;
41 case 'f': sender = optarg; break;
42 case 'F': if (!env_put2("MAILNAME",optarg)) nomem(); break;
43 case 'p': break; /* could generate a Received line from optarg */
45 case 'i': break; /* what an absurd concept */
46 case 'x': break; /* SVR4 stupidity */
47 case 'm': break; /* twisted-paper-path blindness, incompetent design */
48 case 'e': break; /* qmail has only one error mode */
52 case 'd': break; /* qmail has only one delivery mode */
53 case 'e': break; /* see 'e' above */
54 case 'i': break; /* see 'i' above */
55 case 'm': break; /* see 'm' above */
58 case 'E': case 'J': /* Sony NEWS-OS */
59 while (argv[optind][optpos]) ++optpos; /* skip optional argument */
67 if (str_equal(optprogname,"mailq"))
69 substdio_putsflush(subfderr,"sendmail: fatal: please use qmail-qread instead\n");
73 if (str_equal(optprogname,"newaliases"))
75 substdio_putsflush(subfderr,"sendmail: fatal: please use the qmsmac newaliases instead\n");
79 qiargv = (char **) alloc((argc + 10) * sizeof(char *));
83 *arg++ = "/usr/sbin/qmail-inject";
84 *arg++ = (flagh ? "-H" : "-a");
91 for (i = 0;i < argc;++i) *arg++ = argv[i];
94 execv(*qiargv,qiargv);
96 substdio_putsflush(subfderr,"sendmail: fatal: unable to run qmail-inject\n");