Closed Bug 505344 Opened 15 years ago Closed 15 years ago

Capture outgoing email and daily DB sync for SFX stage

Categories

(mozilla.org Graveyard :: Server Operations, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: abuchanan, Assigned: fox2mike)

References

()

Details

Hey,

Would it be possible to capture all mail output from spreadfirefox.authstage.m.com and redirect it somewhere useful?  

I want to avoid sending mail to actual users from stage, and having the mail sent to an alias like sfx.stage@mozilla.com would be useful. 

If that's possible, then I'd like to set up a daily database sync of prod to stage.

Thanks.
Summary: Daily DB updates for SFX stage → Capture outgoing email and daily DB sync for SFX stage
Dave, is this possible?
Assignee: server-ops → justdave
Only way I can think of to do this is to write a dummy SMTP server and have it blindly accept anything and write it to a file.
Actually, this looks promising: http://www.lastcraft.com/fakemail.php
oohh, fakemail looks cool, and I'm sure QA would be happy with the option for better testing of emails (which is why I filed this bug)
Shyam, can you look at the tool in comment #3 and see if it's something we can deploy (but still get cron emails out)?
Assignee: justdave → shyam
From what I was able to meddle with today, this will intercept all mails. There doesn't seem to be an exclusion list idea/option implemented...so everything will be blackholed.

Also, I had trouble getting it running. It was hacked up in 2005..and doesn't seem to find stuff it needs :

[root@mrapp-stage02 fakemail]# ./fakemail 
Can't locate Net/Server/Mail/SMTP.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at ./fakemail line 5.
BEGIN failed--compilation aborted at ./fakemail line 5.

I did make sure perl-NetServer-SMTP was installed, so I don't know what else it's looking for.

[root@mrapp-stage02 fakemail]# yum info perl-NetServer-SMTP
Loaded plugins: rhnplugin
Excluding Packages from Extra Packages for Enterprise Linux 5 - i386
Finished
Excluding Packages from Base git repository
Finished
Installed Packages
Name       : perl-NetServer-SMTP
Arch       : noarch
Version    : 0.01
Release    : 1.2.el5.rf
Size       : 22 k
Repo       : installed
Summary    : Minimal SMTP server
URL        : http://search.cpan.org/dist/NetServer-SMTP/
License    : Artistic/GPL
Description: NetServer::SMTP is a perl module that implements a minimal SMTP server as perl RFC 821.

Of course, another option is to sanitized the DB dump so emails are replaced with something local and we ask Postfix to /dev/null that address...
If we go with modifying the emails in the DB, we'll still need them to be unique, because that's what the app code expects.

If I change them to something like {unique}@sfxstagemail.mozilla.com, will that work?  Can you redirect all mail to sfxstagemail.mozilla.com to a mailing list or some place where we can use them for testing?
(In reply to comment #7)
> If we go with modifying the emails in the DB, we'll still need them to be
> unique, because that's what the app code expects.

Yuck :p Code too clever for it's own good ;)

> If I change them to something like {unique}@sfxstagemail.mozilla.com, will that
> work?  Can you redirect all mail to sfxstagemail.mozilla.com to a mailing list
> or some place where we can use them for testing?

I'll give this a quick try, have an idea with postfix in mind and will update.
How does drupal send mail? can it be configured to use an SMTP server or does it pipe to /usr/lib/sendmail or something?  fakemail can listen on an alternate port, so if we can configure how the mail is sent, we can always point it at the fake port.

Also, the concept behind what fakemail is doing is pretty simple... if it's using outdated perl modules or something I can probably fix it up.  I had sorta been toying with the idea of writing something like it myself if I hadn't found that.
ooohhhh, http://drupal.org/node/201981 :)

Some of the options described can be implemented and installed on my end.  I'll try them out and see what works.  The Reroute Email module looks promising.

Thanks.
Alex,

Do you still need anything from us?
I haven't tried it out yet, but I'm pretty sure I can do this one on my own now.  If I need help, I'll (re)open a bug.

Thank you!
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → INVALID
Product: mozilla.org → mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.