Koozali.org: home of the SME Server

Alias problem

Offline netrs

  • *
  • 22
  • +0/-0
Re: Alias problem
« Reply #15 on: August 27, 2019, 08:14:59 AM »
here is the log and the aparent error:

Aug 27 08:06:49 mailsrv esmith::event[58475]: Processing event: pseudonym-create test@XXXXXXX.XX
Aug 27 08:06:49 mailsrv esmith::event[58475]: Running event handler: /etc/e-smith/events/actions/generic_template_expand
Aug 27 08:06:49 mailsrv esmith::event[58475]: expanding /var/qmail/control/badrcptto
Aug 27 08:06:50 mailsrv esmith::event[58475]: expanding /var/qmail/control/virtualdomains
Aug 27 08:06:50 mailsrv esmith::event[58475]: ERROR in /etc/e-smith/templates//var/qmail/control/virtualdomains/90pseudonyms: Program fragment delivered error <<Can't call method "prop" on an undefined value at /etc/e-smith/templates//var/qmail/control/virtualdomains/90pseudonyms line 18.>> at template line 1
Aug 27 08:06:50 mailsrv esmith::event[58475]: ERROR: Template processing failed for //var/qmail/control/virtualdomains: 1 fragment generated errors
Aug 27 08:06:50 mailsrv esmith::event[58475]:  at /etc/e-smith/events/actions/generic_template_expand line 56
Aug 27 08:06:50 mailsrv esmith::event[58475]: expanding /var/qmail/users/assign
Aug 27 08:06:50 mailsrv esmith::event[58475]: expanding /var/service/qpsmtpd/config/goodrcptto
Aug 27 08:06:50 mailsrv esmith::event[58475]: expanding /var/service/qpsmtpd/config/forcespamcheck
Aug 27 08:06:50 mailsrv esmith::event[58475]: generic_template_expand=action|Event|pseudonym-create|Action|generic_template_expand|Start|1566886009 883278|End|1566886010 465640|Elapsed|0.582362
Aug 27 08:06:50 mailsrv esmith::event[58475]: Running event handler: /etc/e-smith/events/pseudonym-create/S55email-assign
Aug 27 08:06:50 mailsrv esmith::event[58475]: S55email-assign=action|Event|pseudonym-create|Action|S55email-assign|Start|1566886010 466015|End|1566886010 625274|Elapsed|0.159259
Aug 27 08:06:50 mailsrv esmith::event[58475]: Running event handler: /etc/e-smith/events/actions/adjust-services
Aug 27 08:06:50 mailsrv esmith::event[58475]: adjusting supervised qmail (sighup)
Aug 27 08:06:50 mailsrv esmith::event[58475]: adjusting supervised qmail (up)
Aug 27 08:06:50 mailsrv esmith::event[58475]: adjust-services=action|Event|pseudonym-create|Action|adjust-services|Start|1566886010 625845|End|1566886010 733081|Elapsed|0.107236

Offline netrs

  • *
  • 22
  • +0/-0
Re: Alias problem
« Reply #16 on: August 27, 2019, 09:53:21 AM »
Here is the BUG Report:



Report a Bug
Configuration report created Tue Aug 27 09:50:27 2019

==================
Base configuration
==================

SME server version: 9.2
SME server mode:    serveronly
Running Kernel:     2.6.32-754.18.2.el6.x86_64



===========================
New RPMs not in base system
===========================
       
Loaded plugins: fastestmirror, post-transaction-actions, smeserver
Loading mirror speeds from cached hostfile
 * base: ftp.arnes.si
 * smeaddons: sme-mirror.firewall-services.com
 * smeos: sme-mirror.firewall-services.com
 * smeupdates: sme-mirror.firewall-services.com
 * updates: ftp.arnes.si
Extra Packages
perl-File-Find-Rule.noarch                0.34-1.el6.sme            @smecontribs
perl-Unicode-IMAPUtf7.noarch              2.00-1.el6.rf             @smecontribs
perl-rrdtool.x86_64                       1.4.7-1.el6.rfx           @smecontribs
php-kolab-net-ldap3.noarch                1.0.3-1.el6               @smecontribs
php-pear-Net-IDNA2.noarch                 0.1.1-3.el6               @smecontribs
php-pear-Net-LDAP2.noarch                 2.1.0-1.el6               @smecontribs
php-pear-Net-Sieve.noarch                 1.3.4-1.el6               @smecontribs
roundcubemail.noarch                      1.1.3-101.el6.sme         @smecontribs
roundcubemail_plugins.noarch              1.2-2.el6.sme             @smecontribs
rrdtool.x86_64                            1.4.7-1.el6.rfx           @smecontribs
smeserver-certificate.noarch              0.0.4-6.el6.sme           @smecontribs
smeserver-dovecot-extras.noarch           0.1.1-2.el6.sme           @smecontribs
smeserver-mailsorting.noarch              1.4-9.el6.sme             @smecontribs
smeserver-qmHandle.noarch                 1.4-9.el6.sme             @smecontribs
smeserver-remoteuseraccess.noarch         1.3-2.el6.sme             @smecontribs
smeserver-roundcube.noarch                1.2-9.el6.sme             @smecontribs
smeserver-userpanel.noarch                1.2-3.el6.sme             @smecontribs
smeserver-vacation.noarch                 1.1-25.el6.sme            @smecontribs
smeserver-wbl.noarch                      0.3.0-18.el6.sme          @smecontribs
 



===========================
Custom and modified templates
===========================
/etc/e-smith/templates-custom/var/qmail/control/doublebounceto: MANUALLY_ADDED, OVERRIDE
/etc/e-smith/templates-custom/home/e-smith/ssl.crt: MANUALLY_ADDED, OVERRIDE




===========================
Modified events
===========================
/etc/e-smith/events/email-update/templates2expand/var/qmail/control/badmailfrom: MULTIPLE_RPM_OWNERS smeserver-wbl-0.3.0-18.el6.sme, smeserver-qpsmtpd-2.4.0-39.el6.sme
/etc/e-smith/events/email-update/templates2expand/var/service/qpsmtpd/config/badhelo: MULTIPLE_RPM_OWNERS smeserver-wbl-0.3.0-18.el6.sme, smeserver-qpsmtpd-2.4.0-39.el6.sme




=======================
Additional repositories
=======================

base: enabled
centosplus: disabled
contrib: disabled
extras: disabled
fasttrack: disabled
smeaddons: enabled
smecontribs: disabled
smedev: disabled
smeextras: enabled
smeos: enabled
smetest: disabled
smeupdates: enabled
smeupdates-testing: disabled
updates: enabled
         

DONE!
Download this report !
SME Server 9.2
Copyright 1999-2006 Mitel Corporation
All rights reserved.
Copyright (c) 2013-2016 Koozali Foundation Inc.

Offline ReetP

  • *
  • 3,740
  • +5/-0
Re: Alias problem
« Reply #17 on: August 27, 2019, 11:12:56 AM »
First can you confirm that you add the pseudonym via the server-manger or do you use another method eg command line?? Lazy admin tools?

Next.

So the issue is here.

Aug 27 08:06:50 mailsrv esmith::event[58475]: ERROR in /etc/e-smith/templates//var/qmail/control/virtualdomains/90pseudonyms: Program fragment delivered error <<Can't call method "prop" on an undefined value at /etc/e-smith/templates//var/qmail/control/virtualdomains/90pseudonyms line 18.>> at template line 1

So lets look at that file (whilst I have cafe at the bar and make notes to myself)

Code: [Select]
cat -n /etc/e-smith/templates//var/qmail/control/
virtualdomains/90pseudonyms


Code: [Select]
     1  {
     2      my $dms = $DelegateMailServer;
     3
     4      return "# DelegateMailServer is set"
if ($dms && ($dms !~ /^\s*$/));
     5
     6      $OUT = "";
     7
     8      use esmith::AccountsDB;
     9
    10      my $adb = esmith::AccountsDB->open_ro
 or die "Couldn't open AccountsDB";
    11
    12      for my $pseudo ($adb->pseudonyms)
    13      {
    14          next unless ($pseudo->key =~ /@/)
;
    15
    16          my $account = $pseudo->prop("Acco
unt");
    17          my $acct = $adb->get($account);
    18          if ($acct->prop('type') eq "group
")
    19          {
    20              $account =~ s/\./:/g;
    21          }
    22
    23          $OUT .= $pseudo->key . ":$account
\n";
    24      }
    25  }

So it is looking in the Accounts DB for a type 'group'. But it doesn't find it for an entry.

I need to go look and test on one of boxes to see how it works.

You have probably deleted an account or group or something and it has left something 'dangling'... without a proper setting. Do you remember doing this?

You can see:
Code: [Select]
db accounts show test
Code: [Select]
test=pseudonym
    Account=jcrisp

Then:

Code: [Select]
db accounts show jcrisp
Code: [Select]
jcrisp=user
Blah
Blah

We can check if we have any groups:

Code: [Select]
db accounts show |grep group
And then who belongs to it:

Code: [Select]
db accounts show somegroup
Have a look first and see it you can see one that doesn't have a home.

We might be able to put a bit of code in to detect the problematic entry. I'll take a look later.

Ahhh and then I remembered about this. Here's your problem, and how to find the problematic key.

https://bugs.contribs.org/show_bug.cgi?id=8591
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline netrs

  • *
  • 22
  • +0/-0
Re: Alias problem
« Reply #18 on: August 27, 2019, 11:53:04 AM »
I can confirm that I add the pseudonym via the server-manager condole.

Offline netrs

  • *
  • 22
  • +0/-0
Re: Alias problem
« Reply #19 on: August 27, 2019, 11:54:15 AM »
So the issue is here.

Aug 27 08:06:50 mailsrv esmith::event[58475]: ERROR in /etc/e-smith/templates//var/qmail/control/virtualdomains/90pseudonyms: Program fragment delivered error <<Can't call method "prop" on an undefined value at /etc/e-smith/templates//var/qmail/control/virtualdomains/90pseudonyms line 18.>> at template line 1

Is this OK that there are two // before var?

Offline ReetP

  • *
  • 3,740
  • +5/-0
Re: Alias problem
« Reply #20 on: August 27, 2019, 12:40:29 PM »
Two // are ok.

The problem is

Quote
Can't call method "prop" on an undefined value

Please read the bug. Need a mod to the template to reveal the problematic key.

But I am on holiday too....
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline netrs

  • *
  • 22
  • +0/-0
Re: Alias problem
« Reply #21 on: August 27, 2019, 01:21:17 PM »
Thank you so much for the link to the bug!

I finally fixed it!

The problem was a pseudonym which was linked to a deleted username.

I will buy you dinner and some beers if you ever come to Slovenia.

I have another problem with google, I will make a new post.


Offline ReetP

  • *
  • 3,740
  • +5/-0
Re: Alias problem
« Reply #22 on: August 27, 2019, 01:27:08 PM »
Ok... as a follow up for others...

Code: [Select]
cat /var/qmail/control/virtualdomains
You could also copy the template to templates-custom and modify it something like this:

Code: [Select]
mkdir -p /etc/e-smith/templates-custom/var/qmail/control/virtualdomains
Code: [Select]
cp /etc/e-smith/templates/var/qmail/control/virtualdomains/90pseudonyms /etc/e-smith/templates-custom/var/qmail/control/virtualdomains/90pseudonyms
Now edit the custom template and add the lines indicated:

Code: [Select]
       my $account = $pseudo->prop("Account");
        my $acct = $adb->get($account);
######
# add these lines
my $test = $pseudo->key;
print "Pseudo is $test \n";
print "Acct is $account \n";
######
        if ($acct->prop('type') eq "group")
        {
            $account =~ s/\./:/g;

Then do:

Code: [Select]
expand-template /var/qmail/control
/virtualdomains

Hopefully you'll see where it works and fails.

All done on a mobile phone !!!

Slovenia for :pint: ... sounds nice :-)
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline ReetP

  • *
  • 3,740
  • +5/-0
Re: Alias problem
« Reply #23 on: August 27, 2019, 01:27:56 PM »
I have another problem with google, I will make a new post.

Oh damn :-(
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline TerryF

  • grumpy old man
  • *
  • 1,826
  • +6/-0
Re: Alias problem
« Reply #24 on: August 27, 2019, 01:31:51 PM »
Nice bit of sleuthing there Mr Crisp...
 
--
qui scribit bis legit

Offline ReetP

  • *
  • 3,740
  • +5/-0
Re: Alias problem
« Reply #25 on: August 27, 2019, 01:35:27 PM »
Wish I'd remembered the damn bug !!

Should be confirmed and we should try and find what causes it.

Deleting a user/group and it leaves a dangly bit. Needs your testing prowess.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline Jean-Philippe Pialasse

  • *
  • 2,764
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Alias problem
« Reply #26 on: September 06, 2019, 10:44:30 PM »
Pseudonyms should be handled as group and pointed to admin if user is deleted.


For OP, it is highly probable that your sending email issue is related to qmail-remote tls patch not yet implemented.

We are working on it, a rpm will soon pop in updates.