Hylafax Mailing List Archives

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

[hylafax-users] modifying mailaddr variable in notify.awk for winbind fax users via smbfax






Hi all,

Getting down to the wire i have one last issue i'm trying to tackle on
email notifications for winbind authenticated users.

I'm using smbfax to enable faxing from any application from the Windows
desktop. It works quite well. The problem i have is with how usernames and
subsequent email addresses
are passed and used by hylafax.

smbfax takes the authenticated domain+ username and adds a trailing_email
variable set in it's config, this being the local domain. Problem being
most people don't have an email of
DOMAIN+user@domain.com

I was able to modify the smbfax perl script to send out the initial email
to the user after they print. The modified section of
/usr/local/smbfax/smbfax is:

## Mail a user the URL to their fax document#


sub mail_user {

my ($user, $code) = @_;
   my $stripdomain;
   my $smtp = Net::SMTP->new($SMTP_HOST, Timeout => 60);
   $stripdomain = $user;
   $stripdomain =~ s/DOMAIN\+//g;
   open (OUT, ">/tmp/blah");
   print OUT "Sending email to $stripdomain$TRAILING_EMAIL\n";
   close OUT;

   $smtp->mail($stripdomain . $TRAILING_EMAIL);
   $smtp->to($stripdomain . $TRAILING_EMAIL);
   $smtp->data();
   $smtp->datasend("To: $stripdomain$TRAILING_EMAIL\n");
   $smtp->datasend("Subject:  $SUBJECT\n");
   $smtp->datasend("\n");
   $smtp->datasend("\nOpen the following $stripdomain web link to complete
your fax:\n\n");
   $smtp->datasend("$BASE_URL?ID=$code\n\n");
   $smtp->datasend("The server will keep this document available for ");
   $smtp->datasend($DEAD_TIME . " minutes.  After that, you will need to
re-");
   $smtp->datasend("submit it to fax it out.\n");
   $smtp->dataend();

   $smtp->quit();

}

This solves the first problem of getting the user to the smbfax generated
web page to fill out their fax info and send it. What happens for
subsequent status notification emails are sent using the  notify.awk script
in /var/spool/hylafax/bin This uses the switch -Mailaddr which is
understood by sendfax. The address is pulled from the session log in
/var/spool/hylafax/log/
This of course is a guess, if i'm wrong please let me know :-)

Looking at the notify.awk script the Mailaddr variable it is first set as a
string (printItem("%s", "Mailaddr", mailaddr);)  and passed in the To: line
(print "To: " mailaddr;) of all notification emails.

Here is where i need help. I am not sure on how to pass a command string to
this variable to strip whatever is used by mailaddr

i.e Mailaddr="s/DOMAIN\+//g"

Any ideas??

Cheers,


Stuart




____________________ HylaFAX(tm) Users Mailing List _______________________
  To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
 On UNIX: mail -s unsubscribe hylafax-users-request@hylafax.org < /dev/null
  *To learn about commercial HylaFAX(tm) support, mail sales@hylafax.org.*



Home
Report any problems to webmaster@hylafax.org

HylaFAX is a trademark of Silicon Graphics Corporation.
Internet connectivity for hylafax.org is provided by:
VirtuALL Private Host Services