[TECHNICAL KNOWHOW ABOUT MHPOPD] 1.Identifiers for Machine Dependency In machine.h, or config.h built by "make config", the various identifiers are defined. These identifiers are established to merge the differences from each OS. If you cannot compile successfully or find some strange behaviors, you can define/undefine these identifiers to modify it. The following is the meaning of each identifier. SYSV SVR4 BSD4 BSD43 This indicates the oriented type of OS. SYSV, SVR4 is referred in the latter part of machine.h for the definition unique with OS. BSD4, BSD43 is defined only as an information, not to be referred in actual sources. OSTYPE This indicates the OS name. It is used to setup the floppy drive in the default value, according to each OS. CODEEUC This means to use EUC-JP (Extended Unix Code) as the Kanji code. If undefined, it means Shift JIS is used. This concerns the man page after installation, and the default value when you don't define the Kanji code, and so on. You can dynamically change the Kanji code used in input/output and filename, after compiled. DEFKCODE This specifies the string which indicates Kanji code used as the OS standard. If defined, it is used as the default value of each internal variables for Kanji code. UTF8DOC This means to use UTF-8 as the Kanji code of documents. If undefined, it follows the definition of CODEEUC. You can also define the value of DEFKCODE as 'utf8-mac' or 'utf8-iconv', which specified the UNICODE mapping. UTF8LANG This specifies the string which indicates Kanji code used as the OS standard and Kanji code of documents, if the environment variable LANG includes "UTF". It will be meaningless in case that LANG does not include "UTF". NOMULTIKANJI It is not necessary to consider the environment which has multiple Kanji codes. PATHNOCASE System calls ignore case for any filename. COMMNOCASE Shell ignore case for any shell command name. ENVNOCASE System calls ignore case for any environment variable. NOUID Neither user ID nor group ID don't exist. NODIRLOOP Any directory structure can never loop. NOSYMLINK Symbolic link system is not implemented. BSPATHDELIM The path delimiter is a backslash character. USECRNL The character who indicates end of line is CR-NL. CWDINPATH The current work directory is always included in the command search path implicitly. DOUBLESLASH The pathname which starts with // (or \\) is allowed as the some special pathname (e.g. the shared folder on Cygwin). USEMANLANG The search pathname referred to man(1) includes the string shown by the environment variable LANG, such as '/usr/man/ja_JP.SJIS/', to support M17N. LANGWIDTH In case that USEMANLANG is defined, this specifies width of the string included by the search pathname of man(1) from the beginning of the string shown by the environment valiable LANG. It will be 2 or 5 letters with the standard NLS (Native Language System). SUPPORTSJIS cc(1) or man(1) supports Shift JIS perfectly. Even for the Kanji whose second byte is '\', this '\' is not treated as a meta character. BSDINSTALL The BSD-like install(1) is installed on the standard command search path, and can use the option -c (copy) and -s (strip). BSDINSTCMD If the command name of the BSD-like install(1) is not "install", you can define that command name. It will be meaningless in case that BSDINSTALL is not defined. TARUSESPACE tar(1) with t option will output the list in which each file mode string (Ex:rw-rw-rw-) is always followed by spaces. In the BSDish OS, it seems usually followed by not spaces but UID/GID. In the GNU tar, it is followed by spaces. Even if you are wrong to define, the description of .fd2rc and /etc/fd2rc can change it dynamically. TARFROMPAX The implementation of tar(1) comes from pax(1), and the output of -t option follows the format used by pax(1). Even if you are wrong to define, the description of .fd2rc and /etc/fd2rc can change it dynamically. BUGGYMAKE make(1) cannot evaluate correctly a time relationship between the files created continuously within 1 second. CPP7BIT cpp(1) cannot pass through any 8bit character, such as the Kanji. OLDARGINT cc(1) treats any old-fashioned argument as integer. CCCOMMAND This indicates the fullpath of the C compiler which you want to use as standard. In some OS, both of BSD version cc and SYSV version cc exists at once, you should choose only one. If undefined, 'cc' is used. EXTENDCCOPT This indicates the option gave to cc(1). If undefined, "-O" is assigned. In case it cannot support "-O" (Optimize), you should define null. CCOUTOPT This indicates the option to give cc(1) the output filename, when it only compile and don't link (with -c option). This must include the make(1) macro for output filename. You must define this, when you don't need the default value "-o $@". CCLNKOPT This indicates the option to give cc(1) the output filename, when it links the executable file (without -c option). This must include the make(1) macro for output filename. You must define this, when you don't need the default value "-o $@". USETERMINFO The terminfo(5) library is used as the terminal database instead of the termcap(5) library. TERMCAPLIB This indicates the library which is need to be link as the termcap(5) library. If undefined, -ltermcap is assigned. REGEXPLIB This indicates the library which is need to be link as the regular expression library, if need. SOCKETLIB This indicates the libraries which are need to be link as the socket libraries, if need. EXTENDLIB This indicates the other library which is need to be link, if need. NOFILEMACRO cc(1) cannot evaluate the macro __FILE__. NOFUNCMACRO cc(1) cannot evaluate the macro __FUNCTION__. NOLINEMACRO cc(1) cannot evaluate the macro __LINE__. FORCEDSTDC Although __STDC__ is not pre-defined, the compiler requires the ANSI standard C format in the prototype declaration and so on. If you trust it is based on ANSI, it is no problem to define this unconditionally. STRICTSTDC The compiler has the strict ANSI standard C specifications not to allow the coexistence of the modern type prototype declaration and the classical type function declaration of K&R. You should define this, when there are a number of errors concerned the type of function argument. NOSTDC Although __STDC__ is pre-defined, the compiler expects the classical C language specifications of K&R. NOCONST Although __STDC__ is pre-defined, the compiler does not support the "const" qualifier. NOVOID The "void" type cannot be used. NOUINT The "u_int" type cannot be used. NOLONGLONG The "long long" type cannot be used. HAVELONGLONG The "long long" type is supported. NOUID_T uid_t, gid_t is not defined in USEPID_T fork(2) and wait(2) treat a prosess ID as a type of pid_t. DECLSIGLIST The global variable sys_siglist[] is declared in , not to need to declare again in the source list. NOSIGLIST The global variable sys_siglist[] don't exist in the standard library. DECLERRLIST The global variable sys_siglist[] is declared in or , not to need to declare again in the source list. PWNEEDERROR Linking /lib/libPW.a requires to prepare the global variable Error[] in the source, NOERRNO The global variable errno is not declared in . NOFILEMODE The constant S_IRUSR, S_IWUSR, etc. are not declared in . NOUNISTDH don't exist. NOSTDLIBH don't exist. NOTZFILEH don't exist. USELEAPCNT The structure tzhead has the member tzh_leapcnt. USESELECTH The structure fd_set which is needed when use the function select(2) is defined in . USESYSDIRH The constant DEV_BSIZE which indicates the block of the directory file is defined in . USETIMEH The structure tm is not defined in nor , to require . USESTDARGH The type va_list for variable argument is defined in . USEMKDEVH The macro (or function) major()/minor() for the device number is defined . USEMKNODH The macro (or function) major()/minor() for the device number is defined . USELOCKFH The constants which indicate the commands for the function lockf(2) to lock files is defined in . USETERMIO The structure termio is used as the terminal interface. USETERMIOS The structure termios is used as the terminal interface. If both USETERMIO and USETERMIOS is undefined, the structure sgttyb is used. HAVECLINE The structure termios has the member c_line. USEDEVPTMX The device file /dev/ptmx and /dev/pts/? are used for the pseudo terminal. USEDEVPTY The device file /dev/ptyXX and /dev/ttyXX are used for the pseudo terminal. USEDIRECT The structure direct is used instead of dirent. SYSVDIRENT The structure dirent doesn't have the member d_fileno and has the member d_ino. NODNAMLEN The structure dirent doesn't have the member d_namlen. NODRECLEN The structure dirent doesn't have the member d_reclen. It has the member d_fd instead. DNAMESIZE The size of tha member d_name of the structure dirent. HAVETIMEZONE The global variable timezone indicates the offset value from GMT. NOTMGMTOFF The structure tm doesn't have the member tm_gmtoff. NOSTBLKSIZE The structure stat doesn't have the member st_blksize. NOFLAGS The structure stat has the member st_flags, which is not supported actually. NOFTPH don't exist. USEINSYSTMH is needed for . NOHADDRLIST The structure hostent doesn't have the member h_addr_list. (The following 5 identifiers is exclusive. These can not be defined simultaneously.) USESTATVFSH The functions declared in is used to get the filesystem information. USESTATFSH The functions declared in is used to get the filesystem information. USEVFSH The functions declared in is used to get the filesystem information. USEMOUNTH The functions declared in is used to get the filesystem information. USEFSDATA The functions using the structure fs_data is used to get the filesystem information. USEFFSIZE The structure statfs has the member f_fsize, which indicates the block size of the filesystem. If undefined, member f_bsize is referred. In case that USESTATVFSH, USEFSDATA is defined, this is meaningless. NOFBLOCKS The structure statfs doesn't have the member f_blocks. NOFBFREE The structure statfs doesn't have the member f_bfree. NOFFILES The structure statfs doesn't have the member f_files. USESTATVFS_T The structure statvfs_t is used instead of statvfs. STATFSARGS This indicates the number of arguments used by function statfs(2). In case that USESTATVFSH, USEFSDATA is defined, this is meaningless. USEFSTATFS The function statfs(2) is unavailable to get the filesystem information, and fstatfs(2) is used instead. (The following 10 identifiers is exclusive. These can not be defined simultaneously.) USEMNTENTH The functions declared in is used to get the mount information. USEMNTTABH The functions declared in is used to get the mount information. USEGETFSSTAT The function getfsstat(2) is used to get the mount information. USEGETVFSTAT The function getvfsstat(2) is used to get the mount information. USEMNTCTL The function mntctl(3) is used to get the mount information. USEMNTINFOR The function getmntinfo_r(3) is used to get the mount information. USEMNTINFO The function getmntinfo(3) is used to get the mount information. USEGETMNT The function getmnt(3) is used to get the mount information. USEGETFSENT The function getfsent(3) is used to get the mount information. (This method can get only the information before mount, not to be recommended. Suppose that it is a last resort.) USEREADMTAB /etc/mtab is read directly to get the mount information. USEPROCMNT The file /proc/mounts is used as the mount information file. (This method can get only the information from kernel, instead of mount(8), not to be recommended. Suppose that it is a last resort.) HAVEPROCMNT The file /proc/mounts is used as the mount information file only if /etc/mtab does not exist. (The following 2 identifiers is exclusive. These can not be defined simultaneously. In case that the identifier except USEMNTINFO is defined among the above 8 choices, this is meaningless.) USEVFCNAME The structure vfsconf has the member vfc_name, which indicates the string to mean the mount type. And, getvfsbytype() is used to get the type vfsconf. USEFFSTYPE The structure statfs has the member f_fdtypename, which indicates the string to mean the mount type. (The following 3 identifiers is exclusive. These can not be defined simultaneously.) USERE_COMP The function re_comp(3) is used to search the regular expression. USEREGCOMP The function regcomp(3) is used to search the regular expression. USEREGCMP The function regcmp(3) is used to search the regular expression. USERAND48 The function for random number generator is not random(3) but rand48(3). USESETENV The function setenv(3) is available to set the environ variables. NOSELECT The function select(2) is unavailable for the low level input/output. DEFFDSETSIZE The function select(2) needs the FD_SETSIZE identifier to be pre-defined as the maximum number of openable files. SELECTRWONLY The function select(2) cannot respond the file descriptor opened as read/write. NOVSPRINTF The function vsprintf(3) is unavailable for the formatted output. NOTERMVAR The termcap(5) library has not the global variables; PC, ospeed, BC and UP. USEUTIME The function utimes(2) is unavailable to set the timestamp, and utime(3) is used instead. USEGETWD The function getcwd(3) is unavailable to get the current directory, and getwd(3) is used instead. ULONGIOCTL The second argument of the I/O control function inctl(2) must be the type of unsigned long. NOFTRUNCATE The function ftruncate(2) is unavailable to resize files. USEFCNTLOCK The function fnctl(2) is used instead of flock(2) to lock files. USELOCKF The function flock(2) is unavailable to lock files, and lockf(2) is used instead. NOFLOCK Both of the function flock(2) and lockf(2) are unavailable to lock files. NOSYSLOG The function syslog(3) is unavailable for system logger. USETIMELOCAL The function timelocal(3) is available as the inverse function of localtime(3) for the time conversion. USEMKTIME The function mktime(3) is used instead of timelocal(3) for the time conversion. USESYSCONF The function sysconf(3) is used to get the system configurations. USELLSEEK The function _llseek(2) is used instead of lseek(2) for the file control. In the 32bit Linux environment, lseek(2) cannot specify the offset value over 2^32 bytes, so that _llseek(2) is necessary. USEUNAME The function uname(2) is used instead of gethostname(2) to get the hostname. NOKILLPG The function killpg(2) is unavailable to manage the process group. USEWAITPID The function waitpid(2) is used instead of wait3(2) to wait the software signals. USESIGACTION The function sigaction(2) is used instead of signal(2) to control the signals. USESIGPMASK The function sigprocmask(2) is used instead of sigsetmask(2) to control the signals. NODTABLESIZE The function getdtablesize(2) is unavailable to get the descriptor size. USERESOURCEH The functions declared in is used to get/set the resource information. USEULIMITH The functions declared in is used to get/set the resource information. USEGETRUSAGE The function getrusage(2) is used to get the process time information. USETIMES The function times(2) is used to get the process time information. GETPGRPVOID The function getpgrp(2) has no argument, to get the process group. USESETPGID The function setpgid(2) is used instead of setpgrp(2) to set the process group. NOSETPGRP The function setpgrp(2) is not available to set the process group. USETCGETPGRP The function tcgetpgrp(3)/tcsetpgrp(3) is used instead of ioctl(2) to get/set the control terminal. USESETVBUF The function setvbuf(3) is used instead of setlinebuf(3) to buffer the stream. SIGARGINT The second argument of the software signal function signal(3) must be the pointer to the function which returns the type int. SIGFNCINT The second argument of the software signal function signal(3) must be the pointer to the function which has the argument of the type int. USESTRERROR The function strerror(3) is used instead of sys_errlist[] to get error messages. GETTODARGS This indicates the number of arguments used by the time-getting function gettimeofday(3). The default value is 2. GETTODNULL The second argument of the time-getting function gettimeofday(3) must be NULL. USESETSID The function setsid(2) can be used to control session. USEMMAP The function mmap(2) can be used to map files. NOGETPASS The function getpass(3) is not avaliable to input password. USESOCKLEN The third argument of the socket function bind(2)/ connect(2)/accept(2) must be the type socklen_t. NOSENDFLAGS The fourth argument of the socket function send(2) cannot be specified as flags. USEINETATON The function inet_aton(3) is used instead of inet_addr(3) to manipulate the Internet address. USEINETPTON The function inet_pton(3) is used instead of inet_addr(3) to manipulate the Internet address. NOGETPWENT The function getpwent(3) is not available to get the user ID. NOGETGRENT The function getgrent(3) is not available to get the group ID. USESETREUID The function setreuid(2) is used instead of geteuid(2) to set the user ID. USESETRESUID The function setresuid(2) is used instead of geteuid(2) to set the user ID. USESETREGID The function setregid(2) is used instead of getegid(2) to set the group ID. USESETRESGID The function setresgid(2) is used instead of getegid(2) to set the group ID. USEGETGROUPS The function getgroups(2) is used to get the group access list. SENSEPERSEC This indicates the number to sense the key input per second. It is suitable in case that the terminal communication speed is slow. The default value is 50 per second. WAITKEYPAD This indicates the time to wait after getting the inputted keycode of ESC. It is suitable in case that the terminal communication speed is slow. The default value is 360ms. WAITTERMINAL This indicates the time to wait for each characters in the escape sequence received from the terminal. It is suitable in case that the terminal response is slow. The default value is inherited from the value of WAITKEYPAD. WAITKANJI This indicates the time to wait the next keycode while some multi-byte character is inputted. It is suitable in case that the terminal communication speed is slow. The default value is 120ms. HDDMOUNT This causes the floppy drive function to support the hard disk drive. It will be defined in case that you want this function on the environment except PC-UNIX. 2.Invoking the MH Command MHpopd will use each MH command such as inc(1) and send(1), which can be replaced with another command by configurations. It is assumed as the MH command, so that the command need to correspond to it. You can refer to the following condition whan each MH command is invoked. o inc(1) Command name: specified by incproc the parameter Arguments: none Current directory: ~/Mail/inbox Current folder: inbox o rmm(1) Command name: specified by rmmproc the parameter Arguments: list of the object message number Current directory: the object folder directory Current folder: the object folder o send(1) Command name: specified by sendproc the parameter Arguments: "draft" or "/" Current directory: ~/Mail Current folder: no specified o pick(1) Command name: specified in the mail sort controlling file Arguments: specified in the mail sort controlling file Current directory: ~/Mail/inbox Current folder: inbox 3.Executing the Command inc(1) It is a necessary condition for using MHpopd that the environment for each MH command is configured. Above all, you need to take care of executing inc(1). First of all, inc(1) requires your password if it receives mails from some outer server. Then it cannot be automatically executed. It is a solution that you specify the password prompt with incprompt the parameter of the server configuration file. This method will automatically input your password to inc(1) with the pseudo teminal. This password string is only the password specified by passwordfile or my-password. It is another solution that you use the pseudo terminal software like expect(1) to make the script which input password to inc(1). For example, the following script will be available for except(1). #!/usr/local/bin/expect -f spawn /usr/local/bin/inc expect "Password *:" send "PASSWORD\r" expect eof exit If you want to treat more strictly such as error handling, you should refer to each documents of expect(1). It is another solution that you will not need to input password with .netrc. You write the following line in .netrc just under your home directory. "machine SERVER.DOMAIN passwd PASSWORD" Then the password string "PASSWORD" will use to access the mail server "SERVER.DOMAIN". This is purely a function of MH, you can refer to each MH documents for details. You should make inc(1) executed from MHpopd, after you confirm it enough in the local environment. Next, you should notice that inc(1) itself cannot sort nor filter mails. It is a solution that you specify the assignment to sort with pick(1) and pickfile the parameter of the server configuration file. This may be the easiest method, in case that mails can be sorted simply with pick(1) and refile(1) the MH command. It is another solution that you write the script for inc(1). You can write the script, which will select mails from inbox with pick(1) and sort mails with refile(1) after inc(1) has been executed. This way is purely to list some statements, so that the script may be a simple shell script. pock(1) and refile(1) are the MH command too, you can refer to each MH documents for details. Another solution is slocal(1) the MH command. It is the software to filter mails before receiving them into your mail box, and sort mails according to description of .maildelivery under your home directory. This is purely a function of MH too, you can refer to each MH documents for details. 4.Permission to Execute It may be safe that you don't specify shell scripts as each command invoked from MHpopd, as possible. It is to avoid some security holes. But, MHpopd will be executed with the permission of each user after user authentication, then these command cannot execute as root. It mey be safer that MHpopd runs not as root but as a normal user from the start. In this case, you may be forbidden to use the port under 1024, the "well-known port", for POP3 or SMTP. You should specify a large port number to avoid it. But, it is no wonder that the server executed as a normal user cannot send/receive mails of the other user. Then you need to run servers which are assigned diferrent port as many as client users. Though you can also run servers as a normal user when they will be invoked from inetd(8), you should describe service names as many as users in /etc/services for different port.