You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Jason Tjankilisan <ja...@yahoo.com> on 2019/08/09 11:40:08 UTC

Forwarding Email

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 test1@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