Page MenuHomePhabricator

Make tools-mail route mail for @tools-*.pmtpa.wmflabs correctly
Closed, ResolvedPublic

Description

Small script I use currently to reroute stuck mail.

From time to time, there are hiccups in cron or wherever and mail gets sent to $user@tools-login.pmtpa.wmflabs et al. These stew in tools-mail:

tools-mail: 34m 2.1K 1WFiPT-00027M-9N <>
tools-mail: local-theoslittlebot@tools-login.pmtpa.wmflabs

because tools-login has no SMTP service listening, and if it had, it would probably create a loop :-).

I use a small script (attached) to reroute such mail, but I don't want to any longer.

tools-mail should, as the mail relay for Tools, accept such mail as its own and process it as if it has been sent to $user@tools.wmflabs.org.


Version: unspecified
Severity: normal

Attached:

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:01 AM
bzimport added a project: Toolforge.
bzimport set Reference to bz61484.
coren removed coren as the assignee of this task.Mar 25 2015, 6:40 PM
coren triaged this task as Medium priority.
coren set Security to None.

Recent example courtesy of T106462:

Received: from tools-webgrid-lighttpd-1201.tools.eqiad.wmflabs ([10.68.18.45] ident=Debian-exim)
	by mail.tools.wmflabs.org with esmtp (Exim 4.76)
	(envelope-from <root@tools.wmflabs.org>)
	id 1ZFJDM-0007Nr-Lt
	for tools.anagrimes@tools-bastion-01.eqiad.wmflabs; Wed, 15 Jul 2015 09:42:56 +0000
Received: from root by tools-webgrid-lighttpd-1201.tools.eqiad.wmflabs with local (Exim 4.76)
	(envelope-from <root@tools.wmflabs.org>)
	id 1ZFJDM-0002Lj-K0
	for tools.anagrimes@tools-bastion-01.eqiad.wmflabs; Wed, 15 Jul 2015 09:42:56 +0000

So assuming tools-bastion-01 is arbitrary, tools-mail would need to have a list of all Toolforge instances? Because in this case, the mail was submitted on tools-webgrid-lighttpd-1201 so it's not just that the local hostname gets (incorrectly) appended. With the new DNS structure, the check could be reduced to *.tools.eqiad.wmflabs, but these "extended" hostnames do not appear in the mail addresses. Hmmm.

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

And /etc/mailname on tools-bastion-01 is (correctly):

scfc@tools-bastion-01:~$ cat /etc/mailname 
tools-bastion-01.tools.eqiad.wmflabs
scfc@tools-bastion-01:~$

Maybe gridengine uses the old hostnames and we need to switch it to the new scheme first?

Rereading the man page for mailname, of course the other approach to try would be to set /etc/mailname to tools.wmflabs.org and see what happens. Issues to look out for:

  • Is /etc/mailname only used to qualify mail addresses or (mis)used by a sending/receiving exim to identify itself?

I set /etc/mailname to tools.wmflabs.org, restarted gridengine-master, submitted a job on toolsbeta-master and qstat -j 4 still gave:

[…]
mail_list:                  scfc@toolsbeta-master.toolsbeta.eqiad.wmflabs
[…]

So this path is not a viable solution.

Change 237863 had a related patch set uploaded (by Tim Landscheidt):
Tools: Accept mail for all submit hosts

https://gerrit.wikimedia.org/r/237863

Change 237863 merged by Yuvipanda:
Tools: Accept mail for all submit hosts

https://gerrit.wikimedia.org/r/237863

Tested this by qsub -m e -b y sleep 60 on tools-bastion-01 and while:

scfc@tools-bastion-01:~$ qstat -j 408481
[…]
mail_list:                  scfc@tools-bastion-01.eqiad.wmflabs
[…]
scfc@tools-bastion-01:~$

the message was successfully delivered to me.