Mailfromd Manual (split by section):   Section:   Chapter:FastBack: Upgrading   Up: Upgrading   FastForward: Copying This Manual   Contents: Table of ContentsIndex: Concept Index

D.5 Upgrading from 5.x to 6.0

The 6.0 release is aimed to fix several logical inconsistencies that affected the previous versions. The most important one is that until version 5.2, the filter script file contained both the actual filter script, and the run-time configuration for mailfromd (in form of ‘#pragma option’ and ‘#pragma database’ statements). The new version separates run-time configuration from the filter script by introducing a special configuration file mailfromd.conf (see Mailfromd Configuration).

Consequently, the ‘#pragma option’ and ‘#pragma database’ statements become deprecated. Furthermore, the following deprecated pragmas are removed: ‘#pragma option ehlo’, ‘#pragma option mailfrom’. These pragmas became deprecated in version 4.0 (see 31x-400).

The second problem was that the default filter script file had ‘.rc’ suffix, which usually marks a configuration file, not the source. In version 6.0 the script file is renamed to mailfromd.mf. In the absence of this file, the legacy file mailfromd.rc is recognized and parsed. This ensures backward compatibility.

This release also fixes various inconsistencies and dubious features in the MFL language.

The support for unquoted literals is discontinued. This feature was marked as deprecated in version 3.0.

The following features are deprecated: ‘#pragma option’ (pragma-option and ‘#pragma database’ (pragma-database) directives, the legacy style of function declarations (old-style function declarations), calls to functions of one argument without parentheses (operational notation), the ‘#require’ statement (See import, for the new syntax) and implicit concatenation (implicit concatenation). See Deprecated Features, for more information about these.

This release also introduces important new features, which are summarized in the table below:

FeatureReference
ConfigurationSee Mailfromd Configuration.
Module systemSee Modules.
Explicit type castsSee explicit type casts.
Concatenation operatorSee Concatenation.
Scope of visibilitySee scope of visibility.
Precious variablesSee rset.

Mailfromd version ‘6.0’ will work with unchanged scripts from ‘5.x’. When started, it will verbosely warn you about any deprecated constructs that are used in your filter sources and will create a script for upgrading them.

To upgrade your filter scripts, follow the steps below:

  1. Run ‘mailfromd --lint’. You will see a list of warnings similar to this:
    mailfromd: Warning: using legacy script file
     /usr/local/etc/mailfromd.rc
    mailfromd: Warning: rename it to /usr/local/etc/mailfromd.mf
     or use script-file statement in /usr/local/etc/mailfromd.conf
     to disable this warning
    mailfromd: /usr/local/etc/mailfromd.rc:19: warning: this pragma is
     deprecated: use relayed-domain-file configuration statement instead
    mailfromd: /usr/local/etc/mailfromd.rc:23: warning: this pragma is
     deprecated: use io-timeout configuration statement instead
    mailfromd: Info: run script /tmp/mailfromd-newconf.sh
     to fix the above warnings
    … 
    
  2. At the end of the run mailfromd will create a shell script /tmp/mailfromd-newconf.sh for fixing these warnings. Run it:
    $ sh /tmp/mailfromd-newconf.sh
    
  3. When the script finishes, run mailfromd --lint again. If it shows no more deprecation warnings, the conversion went correctly. Now you can remove the upgrade script:
    $ rm /tmp/mailfromd-newconf.sh
    

Notice, that the conversion script attempts to fix only deprecation warnings. It will not try to correct any other type of warnings or errors. For example, you may get warning messages similar to:

mailfromd: /etc/mailfromd.mf:7: warning: including a module file is unreliable and may cause subtle errors
mailfromd: /etc/mailfromd.mf:7: warning: use `require dns' instead

This means that you use ‘#include’ where you should have used ‘require’. You will have to fix such warnings manually, as suggested in the warning message.

If, for some reason, you cannot upgrade your scripts right now, you may suppress deprecation warnings by setting the environment variable MAILFROMD_DEPRECATION to ‘no’ before starting mailfromd. Nonetheless, I recommend to upgrade as soon as possible, because the deprecated features will be removed in version ‘6.1’.

Mailfromd Manual (split by section):   Section:   Chapter:FastBack: Upgrading   Up: Upgrading   FastForward: Copying This Manual   Contents: Table of ContentsIndex: Concept Index