Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exim v4.97 #672

Closed
chirpy2605 opened this issue Nov 10, 2023 · 2 comments · Fixed by #673
Closed

Exim v4.97 #672

chirpy2605 opened this issue Nov 10, 2023 · 2 comments · Fixed by #673

Comments

@chirpy2605
Copy link

Exim v4.97 has changed the length of the Message-ID, this breaks mail delivery in MailScanner.

As noted on the MailScanner mailing list, the magic number 19 used in EximDiskStore.pm needs to be changed to 26 in 3 locations. There is an additional subroutine that needs to change:

sub OutQDir {
  my $name = shift;

  if (MailScanner::Config::Value('spliteximspool')) {
    return '/' . substr($name,-13,1) . '/';
  } else {
    return '/';
  }
}

This is determining which of the exim split spools to place the new message. In exim this is determined by the 6th character of the Message-ID.

For the magic number 19, 19 - 13 = 6

Now that exim is using magic number 26, this needs changing so that 26 - 20 = 6, otherwise the email goes into the wrong split spool directory and exim ignores it. So it needs to change to:

sub OutQDir {
  my $name = shift;

  if (MailScanner::Config::Value('spliteximspool')) {
    return '/' . substr($name,-20,1) . '/';
  } else {
    return '/';
  }
}

I also changed all the references (3) from 19 to 26. As a serious workaround hack I stored these changes in a different perl module name and tested the exim version in the main MailScanner script:

if (/exim/i) {
  $MTAmod = 'Exim.pm';
  $MTADSmod = 'EximDiskStore.pm';
  my @out = `exim -bV`;
  my @line = split(/ /, $out[0]);
  my $ver = $line[2];
  $ver =~ /\d+\.\d+/;
  if ($ver >= 4.97) {
    $MTAmod = 'Exim.pm';
    $MTADSmod = 'EximDiskStoreNew.pm';
  }
}
Copy link

Thank you for submitting your first issue to MailScanner! We will respond to you soon!

@shawniverson
Copy link
Member

@chirpy2605 I like how you are pulling the exim version. I would like to adapt this in a way that two nearly identical EximDiskStore.pm files are not needed. Maybe check the version and store the value in a config variable, then check it inside of EximDiskStore.pm to conditionally choose the right values for the Message-ID handling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants