Page MenuHomePhabricator

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


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 $

Version: unspecified
Severity: normal




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.
scfc created this task.Feb 18 2014, 11:52 AM
coren moved this task from Triage to Backlog on the Toolforge board.Nov 25 2014, 4:15 PM
coren removed coren as the assignee of this task.Mar 25 2015, 6:40 PM
coren triaged this task as Normal priority.
coren set Security to None.
scfc added a comment.Jul 22 2015, 3:37 PM

Recent example courtesy of T106462:

Received: from ([] ident=Debian-exim)
	by with esmtp (Exim 4.76)
	(envelope-from <>)
	id 1ZFJDM-0007Nr-Lt
	for tools.anagrimes@tools-bastion-01.eqiad.wmflabs; Wed, 15 Jul 2015 09:42:56 +0000
Received: from root by with local (Exim 4.76)
	(envelope-from <>)
	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 project: Cloud-Services. · View Herald TranscriptJul 22 2015, 3:37 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
scfc added a comment.Jul 22 2015, 3:43 PM

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

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

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

scfc added a comment.Sep 8 2015, 5:44 PM

Rereading the man page for mailname, of course the other approach to try would be to set /etc/mailname to 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?
scfc added a comment.Sep 11 2015, 9:03 PM

I set /etc/mailname to, 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

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

scfc closed this task as Resolved.Sep 14 2015, 6:48 PM

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

the message was successfully delivered to me.