Halo Benoit,

Thank you so much for the clarification, turns out the solution was so easy, 
now my local james email and my gmail can receive the message. I thought the 
passthrough was a sensitive stuff so I didn’t change it and follow the default 
setting.

But another problem that I discovered is gmail think the forwarded mail is a 
spoofed message . Gmail said that the sender location are different from what 
google send to. I checked the header and the info still looks like im sending 
it to my local james email.

What I did basically :
- Send email to my local james email using my Gmail account
- local james mail server forward the message to my main Gmail account

So im thinking that I should change the info from the header so it looks like 
my local james email was the one sending the mail. Reading the documentation of 
forward and resend, I think only resend mailet that has the ability to change 
its content and header, but I cant test it since for some reason, resend didn’t 
work for me. I was thinking about setmimeheader, maybe set the header again 
manually, but I still cannot make it work.

Is there any way to change the header information before being forwarded? Any 
info could be really usefull.

Thank you so much once again.

Sincerely, 
Jason

Sent from Mail for Windows 10

From: Tellier Benoit
Sent: Tuesday, August 13, 2019 11:38 AM
To: server-user@james.apache.org
Subject: Re: Forwarding Email

Hi Jason,

Reading your 'mailetcontainer.xml' file, you trigger an infinite loop.
Every time you receive an email, you 'resend it to yourself and forward it'.

I'd try to:
- Only forward it to the GMail address
- Set the passthrough option to 'true': this enable the mail processing
to proceed and thus local deliver the mail.

----------------

Regarding RRT, this component is enabled by default. However CLI (only
way to configure RRT with James Spring App) does not allow setting
**Forward mappings** (allowing to forward while keeping a local copy).
Thus I do not think this could be a solution for your issue (this could
be a simpler solution for James Guice product).

Cheers,

Benoit

On 09/08/2019 18:40, Jason Tjankilisan wrote:
> Hiya,
> 
> I wanted to make some forwarding function, in example when my user email in 
> james received a mail, it will be also forwarded to my gmail account. I try 
> to experiment by trying the Resend, Forward mailet, but nothing seem to be 
> working. Still trying to figure out where to put it.
> MailetContainer.xml : 
> https://github.com/JasonTjankilisan/James-3.3.0-setup_tutorial/blob/Branch/debug/mailetcontainer.xml
> 
> I try creating a custom mailet to change the mail recipient forcefully, but 
> as I expected it create some kind of infinite loop error probably because 
> James detect something is changing in the middle of sending. I put this 
> mailet on the very top of the root process, probably that;s cause the 
> infinite loop, still trying to find where to put the mailet for it to take 
> changes (Basically it get the mail recipient, detecting a unique email 
> address in the recipient, adding the gmail recipient inside the collection 
> and setting it back to mail)
> https://github.com/JasonTjankilisan/James-3.3.0-setup_tutorial/blob/Branch/debug/ForwardMail.java
> 
> I also try using the mappings on james-cli.sh but it didn’t seem to forward 
> the mail to my gmail account.
> Link : https://james.apache.org/server/manage-cli.html#Managing_mappings
> The command I just should just be correct :
> sudo bash james-cli.sh AddUserMapping P1 sub.example.com te...@gmail.com
> 
> I try doing the recipientrewriteemail.xml also, but I have no idea how to use 
> it since if I uncomment the XML version, its seems to throw some error.
> https://svn.apache.org/repos/infra/websites/staging/james/trunk/content/server/3/config-recipientrewritetable.html
> 
> (sadly I would include the James log file error, but the list become so big 
> that that the scp download keep failing, its over 10000 line of error)
> 
> is there something im doing wrong, or is there other way to forward email?
> 
> Thank you.
> Sincerely, Jason
> 
> Sent from Mail for Windows 10
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org
For additional commands, e-mail: server-user-h...@james.apache.org


Reply via email to