#include #include "internal.h" #include #include "mailconf.m" #include static MAILCONF_HELP_FILE help_basic ("basic"); extern CONFIG_FILE f_sendmail; /* Define the help list for the available mailer */ void basic_setmailer (FIELD_COMBO *comb) { comb->addopt ("esmtp",MSG_U(F_ESMTP,"Enhanced smtp")); comb->addopt ("smtp",MSG_U(F_SMTP,"Normal smtp")); comb->addopt ("esmtprem",MSG_U(F_ESMTPREM,"Expensive esmtp (on demand links)")); comb->addopt ("uucp-dom",MSG_U(F_MODERNUUCP,"Recommended modern UUCP")); comb->addopt ("uucp",MSG_U(F_OLDUUCP,"Old uucp")); } static char servedomain[50]; // string for the virtual registry static char servehost[50]; // string for the virtual registry PUBLIC int MAILCONF::basicedit() { DIALOG dia; dia.newf_title (MSG_U(T_BASEINFO,"Base info"),1,"",MSG_R(T_BASEINFO)); dia.newf_str (MSG_U(F_PRESENT,"Present your system as"),mailas); { // The virtual registry expect fixed address message. This // is why we use those static variables above. THISHOST h; snprintf (servedomain,sizeof(servedomain)-1 ,MSG_U(F_MAINSERV,"Accept email for %s") ,h.getdomain()); snprintf (servehost,sizeof(servehost)-1 ,MSG_R(F_MAINSERV) ,h.getname1()); // Limit the dialog width in text mode if (dialog_mode == DIALOG_CURSES){ servedomain[31] = '\0'; servehost[31] = '\0'; } dia.newf_chk ("",mainserv,servedomain); dia.newf_chk ("",hostserv,servehost); } dia.newf_str (MSG_U(F_MAILHOST,"Mail server"),mailhost); dia.newf_str (MSG_U(F_SMARTHOST,"Mail gateway"),smarthost); FIELD_COMBO *comb = dia.newf_combo (MSG_U(F_SMARTMAIL ,"Mail gateway protocol"),smartmailer); basic_setmailer (comb); dia.newf_title (MSG_U(T_FEATURES,"Features"),1,"",MSG_R(T_FEATURES)); dia.newf_chk ("",features.usegecos,MSG_U(F_USEGECOS,"match full user name")); dia.newf_chk ("",features.relayctrl,MSG_U(F_SPAMENABLE ,"Enable relay control (spammers)")); dia.newf_chk ("",features.userbl,MSG_U(F_USERBL,"Block open relay (ORDB)")); dia.newf_chk ("",features.mailq,MSG_U(F_MAILQ,"Anyone may run mailq")); dia.newf_chk ("",features.run,MSG_U(F_RUN,"Anyone may run sendmail -q")); dia.newf_chk ("",features.probeinterface,MSG_U(F_PROBEINTERFACE ,"Builds server aliases from net interfaces")); dia.newf_str (MSG_U(F_LISTENPORT,"Listen on TCP port"),listen.port); dia.newf_str (MSG_U(F_LISTENADDR,"Listen on TCP address"),listen.addr); { static int tb[]={0,1,2}; static const char *tbv[]={ MSG_R(I_DISABLED), MSG_U(I_DEVNULL,"to /dev/null"), NULL }; dia.newf_chkm_str (MSG_U(F_DOUBLEBOUNCE,"Double bounce dest.") ,features.doublebounce ,features.doublebouncedest ,tb,tbv); } dia.newf_title (MSG_U(T_SMTPFEATURES,"SMTP features"),1,"",MSG_R(T_SMTPFEATURES)); dia.newf_chk ("",features.verify,MSG_U(F_VERIFY,"Enable the VERIFY SMTP command")); dia.newf_chk ("",features.expn,MSG_U(F_EXPN,"Enable the EXPN SMTP command")); dia.newf_chk ("",features.etrn,MSG_U(F_ETRN,"Enable the ETRN SMTP command")); dia.newf_chk ("",features.verb,MSG_U(F_VERB,"Enable the VERB SMTP command")); dia.newf_chk ("",features.receipts,MSG_U(F_RECEIPTS,"Return success DSNs21")); dia.newf_chk ("",features.goaway,MSG_U(F_GOAWAY,"Allow most SMTP status queries")); { static int tb[]={0,0}; static const char *tbv[]={ MSG_U(I_DISABLED,"Disabled"), NULL }; dia.newf_chkm_num (MSG_U(F_AUTHTIMEOUT,"AUTH timeout (seconds)"),features.tmoutident ,tb,tbv); } dia.newf_chk ("",features.authwarnings,MSG_U(F_AUTHWARNINGS ,"Authentication warnings")); dia.newf_title (MSG_U(T_DELIVERY,"Delivery"),1,"",MSG_R(T_DELIVERY)); static const char *tblimit[]={MSG_U(I_NOLIMIT,"No limit"),NULL}; static const int tblimitv[]={0,0}; dia.newf_chkm_num (MSG_U(F_MAXSIZE,"Messages size limit") ,features.maxmsgsize,tblimitv,tblimit); dia.newf_chk ("",features.deferdeliv ,MSG_U(F_DEFERDELIV,"Don't try to deliver immediatly")); { static const char *tbdel[]={MSG_U(I_MANUAL,"Manual"),NULL}; static const int tbdelv[]={0,0}; dia.newf_chkm_num (MSG_U(F_QUEUEDELAY ,"Process queue every (minutes)"),features.queuedelay ,tbdelv,tbdel); } dia.newf_chk ("",features.usesmrsh,MSG_U(F_USESMRSH,"Use special shell smrsh")); static const char *tbvals[]={MSG_U(I_DEFAULTS,"Defaults"),NULL}; static int vals[]={0,0}; dia.newf_chkm_num (MSG_U(F_MAXRECIPIENTS,"Maximum recipients per msg.") ,features.maxrecipients,vals,tbvals); dia.newf_str (MSG_U(F_QUEUEWARN,"Queue: Warn after"),features.queuewarn); dia.newf_str (MSG_U(F_QUEUERETURN,"Queue: Return after"),features.queuereturn); dia.newf_title ("",MSG_U(T_DNSFEATURES,"DNS features")); dia.newf_chk ("",features.dnsneeded,MSG_U(F_WAITDNS,"wait for DNS")); dia.newf_chk ("",features.nodns,MSG_U(F_NODNS,"don't use DNS")); dia.newf_title (MSG_U(T_MISC,"Misc."),1,"",MSG_R(T_MISC)); dia.newf_chk ("",features.uucpnobatch,MSG_U(F_NOBATCH ,"no batching for uucp mail")); dia.newf_num (MSG_U(F_UUCPMAXSIZE,"Max size of uucp messages") ,features.uucpmax); dia.newf_str (MSG_U(F_DELIVER,"Deliver locally to users") ,users.deliverlocal); dia.newf_str (MSG_U(F_NOMASQ,"No masquerade from users") ,users.dontmasque); dia.newf_str (MSG_U(F_TRUST,"Trusted users"),users.trust); dia.newf_chk (MSG_U(F_USEMTABLE,"special routing db.") ,features.mailertable,MSG_U(I_USEMTABLE,"Enabled")); comb = dia.newf_combo (MSG_U(F_SPECIAL ,"Special routing db. format") ,features.dbformat); comb->addopt ("btree"); comb->addopt ("hash"); comb->addopt ("dbm"); comb->addopt ("NIS"); comb = dia.newf_list (MSG_U(F_LOCALMAILER,"Local delivery agent") ,deliver); comb->addopt ("",MSG_U(O_PROBED,"Let linuxconf probe")); comb->addopt ("deliver","/usr/bin/deliver"); comb->addopt ("mail.local","/bin/mail.local"); comb->addopt ("procmail","/usr/bin/procmail"); comb->addopt ("amavis","/usr/sbin/scanmails"); dia.newf_chk ("",features.bogushelo ,MSG_U(F_BOGUSHELO,"Support bogus mail clients(HELO)")); #ifdef DNS_LIMIT /* #Specification: mailconf / limiting DNS scope An attempt was made to somewhat limit the DNS usage of sendmail. One way is to desactivate DNS canonification in ruleset 96. mailconf allows this. This is fine for small site with a single mailhost for example. Larger site may have several mailhost with several subdomain and yet no full connectivity to the internet, and to make things worst, have sometime some connectivity on the internet. It means that the DNS knows how to resolv any name but will generally fail, unless someone establish the internet connection. So on one hand, we need DNS flexibility and MXs, and on the other hand we must avoid it to make sure sendmail won't timeout needlessly. In fact, in this setup, email is either local or through a forwarder which knows better anyway. This half DNS solution is still a problem. One solution would be to restart the DNS with or without a root.cache file when connected or not connected to the internet. If this problem rings bell to you, I would be happy to talk about it. I am pretty sure something generally useful would come out of it. */ dia.newf_title ("",MSG_U(F_LIMITDNS,"Limit DNS for those domains")); for (int d=0; dis_empty()) nb_empty--; } for (int e=0; eothers.getnb(); } // Collect all domain name in tbname[] MAILCONFLICT tbname[nbname]; int no = 0; THISHOST thishost; basic_addinfo (tbname,no,thishost.getname1() ,MSG_U(E_IMPLICITCONFIG,"implicit linuxconf rule")); if (mainserv){ const char *dom = thishost.getdomain(); if (dom != NULL){ basic_addinfo (tbname,no,dom,MSG_U(E_MAINCONFIG ,"main email configuration")); } } for (i=0; iget() ,MSG_U(E_MAINALIASES,"aliases for your system")); } for (i=0; idomain.get(); basic_addinfo (tbname,no,domname,domname); for (int a=0; aothers.getnb(); a++){ const char *o = dom->others.getitem(a)->get(); basic_addinfo (tbname,no,o,domname); } } // Check for duplicates int ret = 0; for (i=1; i static PUBLISH_VARIABLES_MSG basic_var_list1[]={ {"presentas",P_MSG_R(F_PRESENT)}, {"mailhost",P_MSG_R(F_MAILHOST)}, {"mailrelay",P_MSG_R(F_SMARTHOST)}, {"usegecos",P_MSG_R(F_USEGECOS)}, {"relayctrl",P_MSG_R(F_SPAMENABLE)}, {"maxmsgsize",P_MSG_R(F_MAXSIZE)}, {"noautodeliver",P_MSG_R(F_DEFERDELIV)}, { NULL, NULL } }; static REGISTER_VARIABLES basic_registry1("mailconf",basic_var_list1 ,NULL,basic_editdef); static PUBLISH_VARIABLES_STR basic_var_list2[]={ {"servedomain",servedomain}, {"servehost",servehost}, { NULL, NULL } }; static REGISTER_VARIABLES basic_registry2("mailconf",basic_var_list2 ,NULL,basic_editdef);