[ZendTo] change the 'from" email address to the user dropping off the file

Jules Jules at Zend.To
Fri Mar 2 10:17:23 GMT 2018


Jake,

As Mike says, this will only work if *only* internal users are allowed 
to send drop-offs. Otherwise SPF and DMARC will shoot you down.

Take a look at /opt/zendto/lib/NSSDropbox.php.
Provided you're reasonably up to date, around like 1287 you should see a 
little section of code like this:
(search for "addReplyTo" if you can't immediately find it)

       if ($fromAddr!="") {
         if (preg_match('/ /', $fromAddr)) {
           $s = array();
           $s = $mail->parseAddresses($fromAddr);
           $mail->addReplyTo($s[0]['address'], $s[0]['name']);
         } else {
           $mail->addReplyTo($fromAddr);
         }
       }

Add 2 lines to it (highlighted in bold below) so it says this instead:

       if ($fromAddr!="") {
         if (preg_match('/ /', $fromAddr)) {
           $s = array();
           $s = $mail->parseAddresses($fromAddr);
           $mail->addReplyTo($s[0]['address'], $s[0]['name']);
*          $mail->setFrom($s[0]['address'], $s[0]['name']);*
         } else {
           $mail->addReplyTo($fromAddr);
*          $mail->setFrom($fromAddr);*
         }
       }

That should do what you want.
No need to restart Apache or anything, it will use the new code immediately.

Note that if you make this change, it will get removed again when you 
next update ZendTo.

Let me know how you get on.

Cheers,
Jules.


On 02/03/2018 9:22 am, Mike Brudenell wrote:
> Hi, Jake -
>
> You'll run into problems doing this if the person dropping off the 
> file has an email address outside of your own domains. Effectively 
> you'd be setting up your mail server to forge emails to be from 
> someone else's domain: something their SPF and DMARC email 
> authentication records might forbid, in which case the messages you 
> generate would likely be marked as spam or rejected if going to 
> someone whose mail service checks and respects SPF and DMARC.
>
> However if, as you say, only your own internal users are allowed to 
> drop off files and so are using your own email addresses there's less 
> likely to be a problem. (If you manage to set it up do make a note to 
> yourself somewhere not to enable uploads for external people without 
> changing the From configuration! :-)
>
> Cheers,
> Mike B-)
>
> On 1 March 2018 at 21:34, Sallee, Jake <Jake.Sallee at umhb.edu 
> <mailto:Jake.Sallee at umhb.edu>> wrote:
>
>     Hello all!
>
>     I would like to be able to configure ZendTo to use the email
>     address of the person dropping off the file as the "from"
>     address.  Doing this allows me to setup rules in my email server
>     that change the email path based on my AD, which I like.
>
>     #1) Is this possible?
>
>     and
>
>      #2) Is this a bad thing?
>
>     In my environment only my AD users are allowed to drop off files
>     that are bound for external users so the email ZendTo would be
>     using would always be a legitimate email.
>
>     I have Googled this but to no avail.  If anyone has any input
>     please feel free to contribute.  Thank you in advance.
>
>     Jake Sallee
>     Godfather of Bandwidth
>     System Engineer
>     University of Mary Hardin-Baylor
>     WWW.UMHB.EDU <http://WWW.UMHB.EDU>
>
>     900 College St.
>     Belton, Texas
>     76513
>
>     Fone: 254-295-4658
>     Phax: 254-295-4221
>
>     _______________________________________________
>     ZendTo mailing list
>     ZendTo at zend.to <mailto:ZendTo at zend.to>
>     http://mailman.ecs.soton.ac.uk/mailman/listinfo/zendto
>     <http://mailman.ecs.soton.ac.uk/mailman/listinfo/zendto>
>
>
>
>
> -- 
> Systems Administrator & Change Manager
> IT Services, University of York, Heslington, York YO10 5DD, UK
> Tel: +44-(0)1904-323811
>
> Web:www.york.ac.uk/it-services <http://www.york.ac.uk/it-services>
> Disclaimer:www.york.ac.uk/docs/disclaimer/email.htm 
> <http://www.york.ac.uk/docs/disclaimer/email.htm>
>
>
> _______________________________________________
> ZendTo mailing list
> ZendTo at zend.to
> http://mailman.ecs.soton.ac.uk/mailman/listinfo/zendto

Jules

-- 
Julian Field MEng CEng CITP MBCS MIEEE MACM

'The paths we take sometimes lead us away from people we know and
love. But in the end what matters is that we affect the lives of
others for the better somehow, whomever we are, whatever our story.
Obsession always destroys what it intended to nurture: but if
you're able to let yourself love honestly and without fear, maybe
that huge heart you have will somehow set you free.' - Eve Lockhart

www.Zend.To
Twitter: @JulesFM
PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/zendto/attachments/20180302/57409447/attachment-0001.html 


More information about the ZendTo mailing list