LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Sendmail Email Aliases not accepting mail (https://www.linuxquestions.org/questions/linux-software-2/sendmail-email-aliases-not-accepting-mail-860429/)

manutdfan1988 02-03-2011 04:55 AM

Sendmail Email Aliases not accepting mail
 
Have tried to setup email aliases in sendmail so I can have multiple address pointing to one linux login. However none of the aliases seem to be accepting mail. I get the following error message when trying to send to them.

550 5.1.1 User unknown (in reply to RCPT TO command)


I have tried restarting sendmail, have mapped the /etc/mail/virtusertable across to virtusertable.db with the following command.

Code:

makemap -v hash ./virtusertable.db < ./virtusertable
Output of sendmail -bv is as follows and looks correct.

Code:

[root@HLLCBlueCapServer ~]# sendmail -bv admin@sigfin.co.uk
admin@sigfin.co.uk... deliverable: mailer local, user admin
[root@HLLCBlueCapServer ~]#

Have also added new domain into local-host-names file. I am stuck on what is left to check and why the messages are getting bounced back.

goossen 02-03-2011 05:38 AM

For my experience, you should add the alias in "/etc/aliases" and then run the "newaliases" command.

bathory 02-03-2011 06:08 AM

Quote:

I have tried restarting sendmail, have mapped the /etc/mail/virtusertable across to virtusertable.db with the following command.

Code:

makemap -v hash ./virtusertable.db < ./virtusertable
Assuming you're in /etc/mail directory, you should use:
Code:

makemap -v hash virtusertable < virtusertable
If it still doesn't work post etc/mail/virtusertable

Regards

manutdfan1988 02-03-2011 07:37 AM

goossen, what would I need to add into /etc/aliases. Would it be the same as I have added to virtusertable (posted below).

bathory, have tried the makemap command you posted and still no luck unfortunately. Below is virtusertable file.


Code:

admin@sigmared.co.uk            admin
admin@sigfin.co.uk              admin

Thanks both for your assistance.

bathory 02-03-2011 08:21 AM

The virtusertable looks OK.
Is this user admin a regular user, or a special one? Try to replace admin with a regular user (e.g your username) and rebuild virtusertable. Note that there is no need to restart sendmail after editing and rebuilding virtusertable.
Also take a look at the bounced mail and /var/log/maillog to see if you find something strange

Regards

manutdfan1988 02-03-2011 09:14 AM

Admin is a standard user with no login priveleges below I have copied in contents of /etc/passwd file. I will create another user for testing purposes and try this aswell just in case.

Code:

admin:x:512:512::/home/admin:/sbin/nologin
Can't see any errors in the maillog file that show the bounceback, below is the actual log from the message that came back. Again I cannot spot anything weird looking at it myself but I hopefully you guys will.

Code:

Reporting-MTA: dns; XX.XXXnyms-it.co.uk
X-Postfix-Queue-ID: 357C11C49103
X-Postfix-Sender: rfc822; AaronH@Tharion.com
Arrival-Date: Thu,  3 Feb 2011 13:30:08 +0000 (GMT)

Final-Recipient: rfc822; admin@sigfin.co.uk
Original-Recipient: rfc822;admin@sigfin.co.uk
Action: failed
Status: 5.1.1
Remote-MTA: dns; 87.84.XXX.XX
Diagnostic-Code: smtp; 550 5.1.1 User unknown


bathory 02-03-2011 11:51 AM

If you don't see any errors in maillog, then the mail is going to some other mailserver and not your sendmail!
What does:
Code:

dig mx sigfin.co.uk
show from the box you're trying to send the mail
Also note that there is no MX for sigfin.co.uk when tested from here

Regards

manutdfan1988 02-09-2011 07:44 AM

Been a bit busy so only just had time to re-look at this, as you can probably tell I am pretty new to all this mail stuff.

The MX records are not set on either of the 2 domain that are supposed to be pointing mail at that box, the one that works I have copied the DNS settings over sigfin.co.uk.

In the DNS it has an @, mail and www records all of which look to be pointing at the correct address. I have also tried adding an MX record, but that doesn't seem to have helped either.

I am sending the mail through a MS exchange server and the error message in the queue is 'the remote computer did not respond to a connection attempt' so like you said this looks like it is sending to the wrong place.

bathory 02-09-2011 08:33 AM

Have a look at the dig output for both domains.
For the working domain:
Quote:

; <<>> DiG 9.7.3rc1 <<>> mx sigfin.co.uk
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15729
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2

;; QUESTION SECTION:
;sigfin.co.uk. IN MX

;; ANSWER SECTION:
sigfin.co.uk. 86350 IN MX 10 87.84.127.51.sigfin.co.uk.

;; AUTHORITY SECTION:
sigfin.co.uk. 86336 IN NS ns2.123-reg.co.uk.
sigfin.co.uk. 86336 IN NS ns.123-reg.co.uk.
For the not working:
Quote:

; <<>> DiG 9.7.3rc1 <<>> mx sigmared.co.uk
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 22168
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;sigmared.co.uk. IN MX

;; AUTHORITY SECTION:
sigmared.co.uk. 10700 IN SOA ns.123-reg.co.uk. hostmaster.sigmared.co.uk. 2011012801 86400 3600 1209600 86400
So the MX record must be added in ns.123-reg.co.uk (and ns2.123-reg.co.uk) being the authoritative dns.

Quote:

In the DNS it has an @, mail and www records all of which look to be pointing at the correct address. I have also tried adding an MX record, but that doesn't seem to have helped either.
I don't know how you're trying to add the MX record, but I suspect you're using some kind of control panel. So you have to find out how to add this entry

Regards

manutdfan1988 02-09-2011 09:21 AM

Yeh there is a control panel through our domain hosting package.

It is actually the other way round the sigmared.co.uk is the working domain and sigfin.co.uk is the broken one.

I have added the MX record for both and now neither one accepts email, they both simply get stuck in the exchange queue with the error as my previous post and I get no log in the mailog file on the Red Hat box.


Thanks for your time.

bathory 02-09-2011 10:29 AM

They both look OK from here now.
Maybe you need to restart that exchange server

manutdfan1988 02-09-2011 11:13 AM

Have tried that and still they are stuck in the queue, I have tried sending from a completely external source as well using my personal Gmail account.

The message from Gmail has not had a bounceback but hasn't reached the server either, as is not in the maillog or the mailbox.

bathory 02-09-2011 01:06 PM

Quote:

sigfin.co.uk. 86350 IN MX 10 87.84.127.51.sigfin.co.uk.
I don't know how your control panel works, but the above looks wrong. You have to define the MX record for the domain(s) and then make sure that the MX host has an A record. In terms of dns:
Code:

sigfin.co.uk MX mail.sigfin.co.uk.
mail.sigfin.co.uk. A 87.84.127.51

Just saw that the A RR exists already:
Quote:

DiG 9.7.2-P3 <<>> mail.sigfin.co.uk
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 10257
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2

;; QUESTION SECTION:
;mail.sigfin.co.uk. IN A

;; ANSWER SECTION:
mail.sigfin.co.uk. 86400 IN A 87.84.127.51

manutdfan1988 02-09-2011 05:54 PM

Aha that is possibly the issue then I put the IP in the MX records rather than a pointer.

Have updated it as you suggested so the MX record now points to mail.sigfin.co.uk and this then points at the IP through the A record.

Still doesn't look like its working but maybe the DNS changes will take a while to filter through will try again tomorrow moring to see if it has resolved.

Thanks Again.

manutdfan1988 02-10-2011 02:04 AM

Perfect, it is now working as expected. Aliases are both receiving mail.

Thanks for all your time and effort on this bathory it was much appreciated.

On another side note, do you know if it is possible to change the originator address in a message. Ideally mail sent from this server should look like it has originated at the server itself rather than a client PC. As it then gives out details of our local network on sent mail.

bathory 02-10-2011 02:30 AM

Hi,

Glad to see it's working.
About your question, I guess you mean masquerading

Regards


All times are GMT -5. The time now is 07:25 AM.