Koozali.org: home of the SME Server

Alias problem

Offline netrs

  • *
  • 22
  • +0/-0
Alias problem
« on: August 22, 2019, 02:17:03 PM »
Helo.

My SME server has developed an error which I cant't fix in any way.

I have several domains on my server and when I create a new user and then an email alias, it si not possible to send mail to that alias.

Server reply with the message "recipient unknown"

In qmail log there is the line:

starting delivery 1: msg 6166506 to local alias-localdelivery-info@xxxxxx.xx

it shoul be:

starting delivery 10: msg 6166516 to local username-info@xxxxxxx.xx

Ca anybody help, please?



Offline janet

  • ****
  • 4,812
  • +0/-0
Re: Alias problem
« Reply #1 on: August 22, 2019, 06:34:29 PM »
netrs

.......when I create a new user and then an email alias, it is not possible to send mail to that alias.......

I am not sure what your issue is, BUT sme server by default can accept mail for
user1-anything@yourdomain & deliver it to user1 Inbox, & so on for other users.
You can "make up" email addresses "on the fly" so to speak without having to add or configure them in sme server.

So you really do not need to create an alias. Maybe your alias creation nethod is in error or conflicts with sme server defaults.
Try removing the alias & send to user-info@xxxxxxxx

To troubleshoot further, you need to tell us a lot more about your server, contribs & custom templates installed etc.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline netrs

  • *
  • 22
  • +0/-0
Re: Alias problem
« Reply #2 on: August 22, 2019, 10:20:28 PM »
I apologyze for not being ckear enough. English is not my native language.

When creating a user in sme manager you get automatic creation if two emails with the default domain. Those two emails are working fine.

But if I try to make a alias email for another domain on the server which is linked to the username, that mail doesnt work. It creates fine, without an error, but I get the errors specified in my first post.
It was working fine for many years and then suddenly stoped. So now I cant add an email for any doman histing on my server.
I’m dealing with this problem for some time now. My next step I guess is to make a new clean install and restore the last backup.

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: Alias problem
« Reply #3 on: August 23, 2019, 01:57:06 AM »
netrs

Are you referring to the Pseudonyms panel in server manager ?

Where & how do you create an alias ?

Please read the Pseudonyms section of the Manual, it explains how Pseudonyms work with multiple domains & limitations that apply.

You say "It was working fine for many years and then suddenly stoped".

So what changes did you make to the server ?

Please give full example of what you do, & what you expect to happen, & advise us what actually happens, step by step please.

Quote
My next step I guess is to make a new clean install and restore the last backup.

That might fix the problem but it also might NOT fix the problem. At this stage the problem has not been identified so it is guessing.

You need to tell us the history of the server & what changes you have made etc.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline netrs

  • *
  • 22
  • +0/-0
Re: Alias problem
« Reply #4 on: August 23, 2019, 08:06:36 AM »
Thanks for your replays.

I have checked the online documents of  SME and yes the pseudonyms are the problem. I have the
SME manager in my native language so I was wrongly talking about aliases instead of pseudonyms.

The problem is when I create a pseudonym, the forwarding to the user being associated with the pseudonym doesnt work.

I receive the replay email "recipient unknown". IN the pseudonyme panel on the SME manager everything looks OK and when I link the username with the pseudonyme no errors are displayed.


Offline janet

  • ****
  • 4,812
  • +0/-0
Re: Alias problem
« Reply #5 on: August 23, 2019, 09:37:56 AM »
netrs

OK so pseudonyms are the problem area.

What changes did you make to the server just before this problem started ?

I am going on holidays tonite so someone else can take over assisting this query.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline ReetP

  • *
  • 3,730
  • +5/-0
Re: Alias problem
« Reply #6 on: August 23, 2019, 01:28:49 PM »
The OP needs to tell us some history and what was changed and when.

It worked 'before' something changed.

It didn't work 'after' something changed.

When? What did you do? Any errors in your logs?
...
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,730
  • +5/-0
Re: Alias problem
« Reply #7 on: August 23, 2019, 01:29:46 PM »
I am going on holidays tonite so someone else can take over assisting this query.

Have a great break !!!!
...
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 #8 on: August 23, 2019, 03:02:18 PM »
Thank you for all the answers.

This server is going on from version 6.0 for nearly 16 years. We have made some changes to it. The last was to implement a comercial SSL certificate because we have problems with google and their security policy - it didn't work. Google is still saying that "our domain is not encript this message" and put our emails in spam folder of their recipients. This is another issue I have to deal with.

I really dont have a history of changes. I know we should have it, but we don't.

So, can you help me withought a history of changes made to the server?

I'm ready to give any informattion that can help you to solve my problem.

Offline ReetP

  • *
  • 3,730
  • +5/-0
Re: Alias problem
« Reply #9 on: August 23, 2019, 06:30:41 PM »
Please don't confuse things.

Pseudonyms are for incoming mail.

Ssl is for outgoing mail. Leave that for now (DKIM etc).

So when did this first occur? A week ago? A month? After some updates?

...
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 #10 on: August 23, 2019, 07:28:34 PM »
I’m dealing with this issue for about five months now. And I really can’t tell when exactly this occour, because I do not add new users every day.

Now I have to add one new and I cant.

Offline netrs

  • *
  • 22
  • +0/-0
Re: Alias problem
« Reply #11 on: August 23, 2019, 07:31:58 PM »
I can make a team viewer connection to my server if someone is interested and show exactly where the problem is.

Offline netrs

  • *
  • 22
  • +0/-0
Re: Alias problem
« Reply #12 on: August 26, 2019, 04:00:58 PM »
Help, please?

Offline ReetP

  • *
  • 3,730
  • +5/-0
Re: Alias problem
« Reply #13 on: August 26, 2019, 08:07:07 PM »
We'll help if and when we can. This is not our job.

So it first occurred 5 months ago? Why did you leave it so long to report?

You are not making it easy to try and find the problem.

What do your logs say when you add a new pseudonym?

Watch the log when you add a pseudonym.

Code: [Select]
tail -f /var/log/messages
Please go to your server manager and run a 'bug report' and paste the results here or pastebin/gist please. Perhaps we can see what you have done to your server.

...
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 #14 on: August 27, 2019, 08:10:15 AM »
Thanks for the answer.

« Last Edit: August 27, 2019, 08:12:03 AM by netrs »

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,730
  • +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,730
  • +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,730
  • +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,730
  • +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,730
  • +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,760
  • +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.