The blogger email list notification option limits the user to 10 email addresses. I wanted to expand that list and I saw an alias file as the solution. Eventually the goal is to write a script that would allow my wife to add names herself.
After configuring virtmaps and running new virtmaps, I configured the aliases file to include:
cancerlist: :include: /home/rvlad/aliases/cancer.maillist
This is per the instructions in the 'man' file. When sending test emails to the list I kept getting permission denied errors.
----- The following addresses had permanent fatal errors -----
:include: /home/rvlad/cancer.maillist
----- Transcript of session follows -----
550 5.2.4 :include: /home/rvlad/aliases/cancer.maillist...
Cannot open /home/rvlad/aliases/cancer.maillist: Permission denied
Permission denied? Okay, it is a permissions issue. I am smart enough to change permissions. HA. I need to become super user - su the root.
Now, simple chmod command on the file. I don't know what the permissions need to be so I'll start with rwx on everything.
chmod 777 cancer.maillist
Send another test email - Permission denied. What? 777 means user/group/world readable, writable, and executable. How can permissions be denied?
After scouring the Internet, 10 variations on the search and reading countless posts I found a comment on http://www.linuxquestions.org/questions/linux-software-2/sendmail-permission-denied-when-using-includefile-61141/, that permissions on all parent folders had to be at least 701. Hmmm. I checked the parent folders. User and world were all "at least" 701 or rwx-----x. In fact I placed the folder in server root and made the folder and file 777 again. Test again. Failed again. Search the Internet again.
I found another helpful post with instructions on how to see quickly what is going on from the command line. He targeted the default mail user.
sendmail -bv -d44.4 alias
... where alias is the name of the email alias used. Cool script which told me that user 26 was the default user. So user 26 had to have permissions. Okay... doesn't make sense to me that if it was world executable that user 26 wouldn't have adequate permissions but what the heck. I'll try it. I checked vipw to see the name of user 26 - mailnull. Okay move the folder is still in the server's root, eliminating as many links in the chain as possible.
chown -R alaises mailnull
sendmail -bv -d44.4 cancerlist
Now the error I got was "Cannot open... Group writable file". Okay, maybe there was something to the "at least 701" comment earlier.
chmod 701 cancer.maillist
sendmail -bv -d44.4 cancerlist
SUCCESS!!!
I get the message that it is - deliverable. I now go back and test from Outlook... click send and receive and sure enough, it works.
At first, I thought that the file must be owned by mailnull. The user permissions had to be readable... I tested many different variations to try to identify exactly what the permissions needed to be. The parent folder did not have to be executable as I had previously read and it didn't have to be owned by mailnull. Interestingly, if it was owned by mailnull and in the mailnull group, the parent fold simply had to be readable. However, if it was owned by another user it did have to world executable. That made me wonder about the file itself. Again, the goal was to have my wife able to update the mailing list eventually so I needed to be able to write to the file. In the end here is what worked for me.
- If the file was owned by mailnull it simply had to have read permissions for user and could not have group or world writable permissions.
- If the file was owned by some other user, it had to be world readable and world executable and could not have group writable permissions or world writable permissions.
- The parent folders must also be world readable and executable and cannot be world or group writable - assuming they are not owned by the default mail user.
Although I did not find this to be well documented anywhere, trial and error once again wins out. I am not saying it isn't well documented somewhere, just that I wasn't able to find it. It is probably in one of the countless Sendmail books or like many things it is assumed to be common sense. As often is the case, geeks common sense is not all that common.
No comments:
Post a Comment