Re: [courier-users] From: rewrite

2015-10-26 Thread Sam Varshavchik

Szépe Viktor writes:



Good afternoon!

I am using an Email-SMS gateway that needs a certain "From:" address.
Every message going to a specific account (s...@szepe.net) needs to be
redirected to the SMS provider and From: header should be rewritten to
a fixed one.

Is it a good idea?

s...@szepe.net:  |/usr/sbin/sendmail -f sen...@szepe.net
12345special-sms-addr...@textlocal.co.uk

I think a simple alias does not change the message's content.

Please help me.


The above is not going to change the From: header.

The From: header, and the envelope return path, what gets set by the -f  
option, are two completely different things.


You need to use something along the lines of reformail, to change the From:  
header.




pgp9oE4yBGPk6.pgp
Description: PGP signature
--
___
courier-users mailing list
courier-users@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users


Re: [courier-users] From: rewrite

2015-10-26 Thread Szépe Viktor
Thank you for your answer.

Actually I am not able to write a courier filter.

I've noticed than sendmail -f rewrites the From: header OR Textlocal  
receives it even if only MAIL FROM: <> contains the specified address.

So now you can send me an SMS! s...@szepe.net

All the best wishes to you!



Idézem/Quoting Bowie Bailey :

> On 10/26/2015 1:21 PM, Szépe Viktor wrote:
>> Good afternoon!
>>
>> I am using an Email-SMS gateway that needs a certain "From:" address.
>> Every message going to a specific account (s...@szepe.net) needs to be
>> redirected to the SMS provider and From: header should be rewritten to
>> a fixed one.
>>
>> Is it a good idea?
>>
>> s...@szepe.net:  |/usr/sbin/sendmail -f sen...@szepe.net
>> 12345special-sms-addr...@textlocal.co.uk
>>
>> I think a simple alias does not change the message's content.
>
> I would do that from a .courier or .mailfilter file rather than an alias.
>
> I had to do something similar for almost the exact same reason.  In my
> case, I also needed to change the info in the From and To headers before
> the email would go through.  I wrote a small Perl script to modify the
> message and re-submit it to the server.
>
> The user's .mailfilter delivery line looks like this:
>
> to "| /home/mailuser/sendtext.pl"
>
> There are also a few checks in there to filter out any non-local mail
> that might find its way to the mailbox.
>
> If you don't need to change the existing email headers, you could use
> your sendmail line from above in place of the perl script.
>
> --
> Bowie
>
> --
> ___
> courier-users mailing list
> courier-users@lists.sourceforge.net
> Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users



Szépe Viktor
-- 
+36-20-4242498  s...@szepe.net  skype: szepe.viktor
Budapest, XX. kerület





--
___
courier-users mailing list
courier-users@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users


Re: [courier-users] From: rewrite

2015-10-26 Thread Bowie Bailey
On 10/26/2015 1:21 PM, Szépe Viktor wrote:
> Good afternoon!
>
> I am using an Email-SMS gateway that needs a certain "From:" address.
> Every message going to a specific account (s...@szepe.net) needs to be
> redirected to the SMS provider and From: header should be rewritten to
> a fixed one.
>
> Is it a good idea?
>
> s...@szepe.net:  |/usr/sbin/sendmail -f sen...@szepe.net
> 12345special-sms-addr...@textlocal.co.uk
>
> I think a simple alias does not change the message's content.

I would do that from a .courier or .mailfilter file rather than an alias.

I had to do something similar for almost the exact same reason.  In my 
case, I also needed to change the info in the From and To headers before 
the email would go through.  I wrote a small Perl script to modify the 
message and re-submit it to the server.

The user's .mailfilter delivery line looks like this:

to "| /home/mailuser/sendtext.pl"

There are also a few checks in there to filter out any non-local mail 
that might find its way to the mailbox.

If you don't need to change the existing email headers, you could use 
your sendmail line from above in place of the perl script.

-- 
Bowie

--
___
courier-users mailing list
courier-users@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users