Skip to content

Commit b2b3b16

Browse files
committed
Fixed a problem with broken tolower function in maildrop when compiled with some specific gcc settings by forcing lowercase addresses in master.cf and adding a workaround in case that tolower returns a empty result.
1 parent fe670c6 commit b2b3b16

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

install/dist/lib/fedora.lib.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,16 +161,16 @@ function configure_postfix($options = '')
161161
$content = rf($configfile);
162162
// if postfix package is from fedora or centios main repo
163163
$content = str_replace('# flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}',
164-
' flags=R user='.$cf['vmail_username'].' argv=/usr/bin/maildrop -d ${recipient} ${extension} ${recipient} ${user} ${nexthop} ${sender}',
164+
' flags=DRhu user='.$cf['vmail_username'].' argv=/usr/bin/maildrop -d ${recipient} ${extension} ${recipient} ${user} ${nexthop} ${sender}',
165165
$content);
166166

167167
// If postfix package is from centos plus repo
168168
$content = str_replace('# flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}',
169-
' flags=R user='.$cf['vmail_username'].' argv=/usr/bin/maildrop -d ${recipient} ${extension} ${recipient} ${user} ${nexthop} ${sender}',
169+
' flags=DRhu user='.$cf['vmail_username'].' argv=/usr/bin/maildrop -d ${recipient} ${extension} ${recipient} ${user} ${nexthop} ${sender}',
170170
$content);
171171

172172
$content = str_replace(' flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}',
173-
' flags=R user='.$cf['vmail_username'].' argv=/usr/bin/maildrop -d ${recipient} ${extension} ${recipient} ${user} ${nexthop} ${sender}',
173+
' flags=DRhu user='.$cf['vmail_username'].' argv=/usr/bin/maildrop -d ${recipient} ${extension} ${recipient} ${user} ${nexthop} ${sender}',
174174
$content);
175175

176176

install/dist/lib/opensuse.lib.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,11 @@ function configure_postfix($options = '')
161161
$content = rf($configfile);
162162

163163
$content = str_replace(' flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}',
164-
' flags=R user='.$cf['vmail_username'].' argv=/usr/bin/maildrop -d ${recipient} ${extension} ${recipient} ${user} ${nexthop} ${sender}',
164+
' flags=DRhu user='.$cf['vmail_username'].' argv=/usr/bin/maildrop -d ${recipient} ${extension} ${recipient} ${user} ${nexthop} ${sender}',
165165
$content);
166166

167167
$content = str_replace(' flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}',
168-
' flags=R user='.$cf['vmail_username'].' argv=/usr/bin/maildrop -d ${recipient} ${extension} ${recipient} ${user} ${nexthop} ${sender}',
168+
' flags=DRhu user='.$cf['vmail_username'].' argv=/usr/bin/maildrop -d ${recipient} ${extension} ${recipient} ${user} ${nexthop} ${sender}',
169169
$content);
170170

171171
wf($configfile, $content);

install/lib/installer_base.lib.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ public function configure_postfix($options = '')
517517
$configfile = $config_dir.'/master.cf';
518518
$content = rf($configfile);
519519
$content = str_replace('flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}',
520-
'flags=R user='.$cf['vmail_username'].' argv=/usr/bin/maildrop -d '.$cf['vmail_username'].' ${extension} ${recipient} ${user} ${nexthop} ${sender}',
520+
'flags=DRhu user='.$cf['vmail_username'].' argv=/usr/bin/maildrop -d '.$cf['vmail_username'].' ${extension} ${recipient} ${user} ${nexthop} ${sender}',
521521
$content);
522522
wf($configfile, $content);
523523

install/tpl/mailfilter.master

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ HOST=tolower("$4")
1010
SENDER="$5"
1111
DEFAULT="{dist_postfix_vmail_mailbox_base}/$HOST/$USER/."
1212

13+
# Workaround for broken tolower function in some current fedora releases
14+
15+
if(!$USER)
16+
{
17+
USER=$3
18+
}
19+
if(!$HOST)
20+
{
21+
HOST=$4
22+
}
23+
1324
if ( "$EXTENSION" ne "" )
1425
{
1526
DELIMITER="+"

0 commit comments

Comments
 (0)