LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Outbound Maillist in Sendmail: confusion (https://www.linuxquestions.org/questions/linux-server-73/outbound-maillist-in-sendmail-confusion-689413/)

Rush_898 12-09-2008 03:31 PM

Outbound Maillist in Sendmail: confusion
 
So we use sendmail as a relay host to get mail out onto the internet from a location that should not receive mail. Email is only needed for alerts, essentially. All of our servers use this one sendmail server as a smarthost relay. My hope is to get it set up so that if any mail is relayed through this sendmail server to group-list@email.com that is will actually go to the aliased addresses in the include file. :include:/etc/mail/group-list. So far this has not worked. When I try to email group-list@email.com I get a "User unknown" message. From what I am reading this should work with the configuration below. Am I not understanding how sendmail is thinking about this? In my mind I am aliasing all mail to group-list to the list of emails in /etc/mail/group-list, and so they should be the emails that the message actually is delivered too. Any sendmail people that can help me out? Thanks for any help.


These are my additions to /etc/aliases

Quote:

rush_898: rush_898@email.com

group-list: :include:/etc/mail/group-list
group-list-request: rush_898
owner-group-list: rush_898
/etc/mail/group-list
This is what I seen in /var/log/maillog when I try to send a message to group-list@email.com using the sendmail server as a smarthost relay from another server

Quote:

Dec 9 15:15:33 HOST sendmail[3903]: mB9LFW2Z003901: to=<group@email.com>, delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=120668, relay=mail.awesome.com. [63.x.x.x], dsn=5.1.1, stat=User unknown
This is followed shortly by...

return to sender


I have been working off of a lot of pages trying to get this to work, but one of the main ones is:

http://www.cs.bgu.ac.il/~arik/usail/mail/lists/

bathory 12-09-2008 04:56 PM

Quote:

This is what I seen in /var/log/maillog when I try to send a message to group-list@email.com using the sendmail server as a smarthost relay from another server

Quote:
Dec 9 15:15:33 HOST sendmail[3903]: mB9LFW2Z003901: to=<group@email.com>, delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=120668, relay=mail.awesome.com. [63.x.x.x], dsn=5.1.1, stat=User unknown
If it's not a typo, then you're trying to send mail to group@email.com and not to group-list@email.com, so the error you get is normal.

Rush_898 12-10-2008 09:56 AM

Quote:

Originally Posted by bathory (Post 3369689)
If it's not a typo, then you're trying to send mail to group@email.com and not to group-list@email.com, so the error you get is normal.

Garr! I'm sorry, it is a typo. I shot myself in the foot there. I tried again just to make absolutely sure with the group-list@email.com style syntax and it is the same error message.

Quote:

Dec 10 09:41:31 HOST sendmail[7578]: mBAFfVqi007576: to=<group-list@email.com>, delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=120670, relay=mail.awesome.com. [63.x.x.x], dsn=5.1.1, stat=User unknown
Dec 10 09:41:31 HOST sendmail[7578]: mBAFfVqi007576: mBAFfVqi007578: DSN: User unknown
My setup looks like this.


[original mail host]->(smart relay)->[sendmail server]->[destination mail server]

I did some traffic sniffing and looking up of DSN messages. I think what is happening is that my sendmail server is attempting to deliver too group-list at the destination domain, and that mail server is responding with a message saying there is no such user and so it fails. What I want to happen is that anything to group-list@awesome.com gets translated on MY server into the email addresses in the alias list. I'm not sure if this is one of the intentions of the alias feature or not. Thank you for your reply, again sorry for the confusion on my typo. Anyone know how I can translate that from address before it leaves my sendmail server?

Rush_898 12-10-2008 02:39 PM

Well, I kind of solved this for myself. I will detail my solution here in case anyone has the same misconceptions as me.

What I was trying:

I wanted to send an email to group-list@email.com and have it aliased as it was relayed off my server. This did not work as my sendmail instance kept trying to deliver to group-list@email.com directly and that user does not exist. No idea why I thought this was a good idea, it has been a long couple of weeks.

What Does Work:

To do an email distribution list in sendmail. First point, send the original email to a "user" on the sendmail server itself. I set up a dummy user using: useradd -M -s /bin/false group-list. Then I set up my /etc/aliases file:


Quote:

email-list-admin: rush_898@email.com

group-list: :include:/etc/mail/group-list
group-list-request: email-list-admin
owner-group-list: email-list-admin
The file /etc/mail/group-list is just a list of emails in a verticle column.

such as

#This is an email distrib-list for group-list
bob@email.com
sue@email.com


The cool thing about this is you can put the group-list file wherever you want and make it so people other than root can add names and remove names from their own lists, and you don't need to restart sendmail or remake the aliases db to do it. (remake aliases db by running 'newaliases')


All times are GMT -5. The time now is 01:59 AM.