-
All replies
-
Helpful answers
-
Dec 1, 2014 10:56 AM in response to Migglby Miggl,Scratch the above code ... a pain to update as the edit link expires after 15 minutes.
Here is the corrected version of the script:
on idle set currentTime to current date -- execute once per day after midnight no matter what if the time of currentTime is greater than 0 and the time of currentTime is less than 3600 then do shell script "shopt -s nullglob mkdir /Users/<admin username here>/Desktop/badmails cd /Library/Server/Mail/Data/listserver/messages/inbound/ for dir in * do cd $dir for file in * do mv $file /Users/<admin username here>/Desktop/badmails/ break done cd .. done killall list_server_mgr" password "<admin password here>" with administrator priveleges end if -- execute once an hour if more than 5 messages are piling up in a given queue do shell script "shopt -s nullglob mkdir /Users/<admin username here>/Desktop/badmails cd /Library/Server/Mail/Data/listserver/messages/inbound/ for dir in * do cd $dir if [$(ls | ec -l) -gt 5]; then for file in * do mv $file /Users/<admin username here>/Desktop/badmails/ break done fi cd .. done killall list_server_mgr" password "<admin password here>" with administrator privileges -- run again in an hour return 3600 end idle
Update: just fixed a logic error in the script on the hourly checks.
-
Dec 1, 2014 11:19 AM in response to Migglby Miggl,This is getting rather tedious, sorry for the multiple posts. I found a few errors and updated the script:
on idle set currentTime to current date -- execute once per day after midnight no matter what if the time of currentTime is greater than 0 and the time of currentTime is less than 3600 then do shell script "shopt -s nullglob emailDir=/Users/<admin username here>/Desktop/badmails mkdir -p $emailDir cd /Library/Server/Mail/Data/listserver/messages/inbound/ for dir in * do cd $dir for file in * do mv $file $emailDir/ break done cd .. done killall list_server_mgr" password "<admin password here>" with administrator privileges end if -- execute once an hour if more than 5 messages are piling up in a given queue do shell script "shopt -s nullglob emailDir=/Users/<admin username here>/Desktop/badmails mkdir -p $emailDir cd /Library/Server/Mail/Data/listserver/messages/inbound/ for dir in * do cd $dir if [$(ls | wc -l) -gt 5]; then for file in * do mv $file $emailDir/ break done fi cd .. done killall list_server_mgr" password "<admin password here>" with administrator privileges -- run again in an hour return 3600 end idle
-
Dec 1, 2014 11:34 AM in response to Migglby dpritchardASC,That's awesome! I'll give it a try sometime this week.
Have you noticed anything about the msgs that cause trouble - like are they large or have large attachments or something like that?
David
-
Dec 1, 2014 11:36 AM in response to dpritchardASCby Miggl,I haven't had a chance to delve into that yet. I'm still collecting bad emails and will evaluate them as I get more of them. Right now I'm suspecting they are malformed (as in missing closing tags, or something like that), or are from a specific email client that formats them in a specific way.
-
Dec 3, 2014 1:32 PM in response to Migglby JonThompson,Rather than posting code over and over again, it would be beneficial for you to create a project on github and link that once here.
-
Dec 3, 2014 2:42 PM in response to JonThompsonby Miggl,Hi Jon, thanks. I have to laugh at myself, because it takes someone else to tell me to use a repo for code, when I do it everyday in all my other work. Doh! Will post link here when I have it there.
-
Dec 6, 2014 7:08 PM in response to Migglby sandorferenczy,Thanks for your work!
we were just running into this problem Friday, I'm going to try your script.
-
Dec 9, 2014 6:18 PM in response to Migglby Eric Naujock,★HelpfulJust for fun I took a look inside the email messages on my server when it was exhibiting the issue. I turns out in the server it is forwarding to user@servername.mydomain.com. So what I did was added an email alias for user@servername.mydomin.com alongside the user@mydomain.com name. Once I did that I ended up releasing the flood of inbound emails to the groups. This may help fix the problem for some of the others having this issue.
Just for reference This change was made in the users account on the server.
-
Dec 9, 2014 7:04 PM in response to Eric Naujockby Miggl,Awesome info! Thanks for the heads up ... but what a hack that is, huh. I will try it out.
-
Dec 10, 2014 5:05 AM in response to Eric Naujockby Eric Naujock,One other detail just in case it wasn't obvious you may need to make sure your email server accepts email for servername.mydomain.com and not just mydomain.com.
-
-
Dec 11, 2014 1:59 AM in response to Migglby Lynda Leung,Oddly, deleting stuck messages didn't do it for me. Nor all the other hacks.
also my old solution to fix the problem by simply restarting from a crontab for Server 3.x didn't work.
I really am amazed apple reintroduced the same problem in Server.app 4 after that that happened for 3.x . Why did they even have tho touch those codes in the first place when it's stable? -
Dec 11, 2014 4:07 AM in response to Lynda Leungby sweh,Same here. I have the exact same problem with Server 4 under Yosemite, my mailing list is not working, always says: <Error> no recipients for: …
The really bad thing with this is that I upgraded to Yosemite and Server 4 last night because there is a bug in Server 3 under Mavericks with mailing lists where some mails are not delivered because of an "invalid charracters in message" (yes, with double r). [1]
I hope that this problem gets fixed soon or maybe some genius out there has a workaround. I would me very much interested!
-
Dec 11, 2014 6:00 AM in response to Migglby sweh,Miggl, did the hint about servername in the domain help you? If so, could you tell me in detail, what alias you added? I understand the fix so that you need to add a new user with email <hello@genealabs-server.genealabs.com> (assuming you server id is genealabs-server) and have that user redirect its emails to <hello@genealabs.com>. Is that right? Or did you just enter <hello@genealabs-server.genealabs.com> as another email alias for the group <hello>?
Thanks in advance,
Sebastian
-
Dec 11, 2014 6:15 AM in response to swehby Miggl,Hi sweh!
Yes, Eric's instructions solved my problem. Here are the steps I followed:
- I had <username>@<mydomain.com> already assigned to each user, naturally. Now I needed to add <username>@<hostname>.<servername.com> to each user as well. I did this in the "Users" area of Server app by double-clicking on each user and adding a new email address. In my instance this was something like mike@server.genealabs.com.
- Then I went the "Mail" area of Server app. There I added a new domain <hostname>.<servername.com>. As soon as I did this, it included the aliases I added on each user automatically, and no further action was necessary.
- After that I disabled my script outlined earlier in this thread, and haven't had any issues so far.
Let me know how this works for you. If it doesn't, you may be experiencing a different issue.

